logo elektroda
logo elektroda
X
logo elektroda

Reverse engineering of the unusual protocol of the Tuya FS-05R dimmer based on UART

p.kaczmarek2 5091 30
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 21488398
    @GUTEK@
    Level 31  
    I checked, running the tmSensor driver in addition does not change anything. What helps is adding at the end of the script that the command should be sent several times. Although this is not a very elegant solution.
    ...
    refresh:
    // channel 5 is temporary variable, from 0 to 255*3, multiplied also by toggle value
    setChannel 5 $CH2*3*$CH1
    // split into two bytes
    setChannel 3 $CH5/256
    setChannel 4 $CH5%256
    // send the two bytes
    tuyaMcu_sendCmd 0x30 00$CH3$$CH4$
    delay_ms 3
    tuyaMcu_sendCmd 0x30 00$CH3$$CH4$
    delay_ms 3
    tuyaMcu_sendCmd 0x30 00$CH3$$CH4$
    .
  • ADVERTISEMENT

Topic summary

The discussion focuses on reverse engineering the UART communication protocol of the Tuya FS-05R dimmer, which differs from typical TuyaMCU-based dimmers like the EDM-01AA-EU. The FS-05R uses a non-standard protocol between its WiFi module and the microcontroller responsible for dimming. Users successfully flashed the dimmer with OpenBK firmware and scripted it to work with Home Assistant, though some encountered issues with dimming smoothness and responsiveness. Problems included limited dimming range depending on the bulb type, delayed or inconsistent command responses, and the presence of a heartbeat signal (55 AA 00 00 00 00 FF) potentially interfering with communication. Solutions involved updating to the latest OpenBK firmware, adjusting baud rates, sending repeated commands to ensure reception, and disabling or working around the heartbeat. Some users replaced the original WiFi module with ESP-based boards and noted differences in baud rates and frame formats. The dimmer’s smooth transition effect is handled by the MCU, but slowing it further requires custom scripting. Compatibility varies with bulb types; not all bulbs are dimmable or suitable for this dimmer. The discussion also covers scripting techniques to map dimming ranges and attempts to integrate the device with ESPhome. Hardware variations and firmware batches affect behavior, and UART captures helped analyze the protocol. Overall, the thread provides detailed insights into the FS-05R’s unique UART protocol, firmware customization, and practical integration challenges and solutions for smart home automation.
Summary generated by the language model.
ADVERTISEMENT