User Tools

Site Tools


projects:arlec_smart_fans:overview

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
projects:arlec_smart_fans:overview [2023/10/30 03:35] – created tjhowseprojects:arlec_smart_fans:overview [2023/11/01 04:57] (current) tjhowse
Line 2: Line 2:
 ====== Smart fan ====== ====== Smart fan ======
  
-I bought an Arlec smart fan. It has a WR4 wifi module inside, supposedly based on an RTL8710BN. These are now supported by esphome.+I bought an Arlec smart fan. It has a WR4 wifi module inside, based on an RTL8710BN. These are now supported by esphome. 
 + 
 +https://docs.libretiny.eu/docs/platform/realtek-ambz/#flashing 
 + 
 +https://community.home-assistant.io/t/arlec-grid-connect-ceiling-fans/261127/67 
 + 
 +https://esphome.io/components/libretiny.html 
 + 
 +https://developer.tuya.com/en/docs/iot/wifiwr4module?id=K9605tvu78p3e 
 + 
 +{{:projects:arlec_smart_fans:pasted:20231030-112019.jpeg}} 
 + 
 +{{:projects:arlec_smart_fans:pasted:20231030-112042.png}} 
 + 
 +{{:projects:arlec_smart_fans:pasted:20231030-033719.jpeg}} 
 + 
 +{{:projects:arlec_smart_fans:pasted:20231030-080404.png}} 
 + 
 +{{:projects:arlec_smart_fans:pasted:20231030-080423.png}} 
 + 
 +{{:projects:arlec_smart_fans:pasted:20231101-045735.png}} 
 + 
 +<code> 
 +esphome: 
 +  name: fan-1 
 +  friendly_name: Sam's Room Fan 
 + 
 +rtl87xx: 
 +  board: generic-rtl8710bn-2mb-788k 
 + 
 +# Enable Home Assistant API 
 +api: 
 +  encryption: 
 +    key: "<snip>" 
 + 
 +ota: 
 +  password: "<snip>" 
 + 
 +wifi: 
 +  ssid: !secret wifi_ssid_2 
 +  password: !secret wifi_password_2 
 + 
 +uart: 
 +  rx_pin: GPIO18 
 +  tx_pin: GPIO23 
 +  baud_rate: 9600 
 +tuya: 
 + 
 +fan: 
 +  - platform: "tuya" 
 +    name: "Speed" 
 +    switch_datapoint:
 +    speed_datapoint:
 +    direction_datapoint:
 +    speed_count:
 + 
 + 
 +light: 
 +  - platform: "tuya" 
 +    name: "Light" 
 +    switch_datapoint:
 +    dimmer_datapoint: 10 
 +    min_value: 0 
 +    max_value: 100 
 +    color_temperature_datapoint: 11 
 +    color_temperature_max_value: 100 
 +    cold_white_color_temperature: 150 mireds 
 +    warm_white_color_temperature: 400 mireds 
 +</code> 
 + 
 +Initial flashing done with a USB-TTL serial adaptor using the wiring diagram shown above and ltchiptool. I took a backup of the stock firmware with <code>ltchiptool flash read ambz stock.bin</code> then I used esphome to generate the uf2 file and flashed it using <code>ltchiptool flash write <filename>.uf2</code> 
 + 
 + Works mostly perfectly. OTA updates via wifi only work occasionally, perhaps inside a 30-60 second window after the RTL chip powers on. It takes a fair bit of bouncing the power and retrying the connection to get it to stick. 
projects/arlec_smart_fans/overview.1698636953.txt.gz · Last modified: 2023/10/30 03:35 by tjhowse