Skip to content

Instantly share code, notes, and snippets.

@billchurch
Last active March 7, 2026 02:16
Show Gist options
  • Select an option

  • Save billchurch/2feb716ef30f03df775da81822f59b12 to your computer and use it in GitHub Desktop.

Select an option

Save billchurch/2feb716ef30f03df775da81822f59b12 to your computer and use it in GitHub Desktop.
# 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
@gohamstergo
Copy link
Copy Markdown

gohamstergo commented Mar 7, 2026

i hoping to do a similar conversion to a tuya-based ceiling fan, but plan to stay on tasmota. can you share what you learned about how you had the fan/light functioning while you had tasmota flashed? before you moved to esphome? im not familiar with esphome, so dont know how the "datapoint" bits of your code interact with the actual GPIO of the esp.

@billchurch
Copy link
Copy Markdown
Author

@gohamstergo
Copy link
Copy Markdown

gohamstergo commented Mar 7, 2026

yup, thats what lead me here. the only thing mentioned after you booted up in tasmota was: "I then worked on sending the commands i learned via the TuyaMCU commands and verified they did indeed operate the various functions of the fan…" but what were those that worked with tasmota?

@billchurch
Copy link
Copy Markdown
Author

Yeah, if it’s not there I don’t have it. It was 3 years ago and I just use the app to send stuff and watched the serial port. The datapoints are in the script above. I’m not a tasmota person so… that’s all I got.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment