Last active
August 18, 2023 05:46
-
-
Save billchurch/2feb716ef30f03df775da81822f59b12 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Carro Home Daisy Smart Fan with replaced ESP-12 wifi chip #1006938428 #318843266 | |
# Store link: https://tinyurl.com/yp44ux4w | |
# Story here: http://1projectaweek.com/blog/2022/2/8/converting-a-carro-home-dc-fan-to-esp-home | |
substitutions: | |
device_name: penfan | |
device_description: Penelope's Ceiling Fan | |
friendly_name: Penelope Fan | |
esphome: | |
name: ${device_name} | |
comment: ${device_description} | |
platform: ESP8266 | |
board: esp01_1m | |
# Disable logging on serial as it is used by the TuyaMCU | |
logger: | |
baud_rate: 0 | |
# Enable Home Assistant API | |
api: | |
password: !secret ha_api | |
reboot_timeout: 0s | |
ota: | |
wifi: | |
ssid: !secret wifissid | |
password: !secret wifipass | |
fast_connect: off #we only have one WiFi AP so just use the first one that matches | |
# domain: !secret domain | |
# Enable fallback hotspot (captive portal) in case wifi connection fails | |
ap: | |
ssid: "${device_name} Fallback Hotspot" | |
password: !secret wifipass | |
captive_portal: | |
web_server: | |
port: 80 | |
time: | |
- platform: homeassistant | |
id: time_homeassistant | |
on_time_sync: | |
- component.update: sensor_uptime_timestamp | |
uart: | |
tx_pin: GPIO01 | |
rx_pin: GPIO03 | |
baud_rate: 9600 | |
# debug: | |
# sequence: | |
# - lambda: UARTDebug::log_hex(direction, bytes, ','); | |
sensor: | |
- platform: uptime | |
id: sensor_uptime | |
- platform: template | |
id: sensor_uptime_timestamp | |
name: "${friendly_name} Uptime" | |
device_class: "timestamp" | |
accuracy_decimals: 0 | |
update_interval: never | |
lambda: |- | |
static float timestamp = ( | |
id(time_homeassistant).utcnow().timestamp - id(sensor_uptime).state | |
); | |
return timestamp; | |
- platform: wifi_signal | |
name: ${friendly_name} Signal | |
update_interval: 60s | |
tuya: | |
fan: | |
- platform: "tuya" | |
name: "Pen Fan" | |
switch_datapoint: 1 | |
speed_datapoint: 3 | |
direction_datapoint: 2 | |
speed_count: 10 | |
light: | |
- platform: "tuya" | |
name: "Pen Fan Yellow" | |
dimmer_datapoint: 10 | |
switch_datapoint: 9 | |
min_value: 100 | |
max_value: 1000 | |
- platform: "tuya" | |
name: "Pen Fan White" | |
dimmer_datapoint: 102 | |
switch_datapoint: 101 | |
min_value: 100 | |
max_value: 1000 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment