Hi all,
Many of you are probably familiar with the TuyaMCU setup: devices which have two MCUs - one for WiFi, and another for handling device functions that speaks a protocol known as "TuyaMCU". TuyaMCU devices advertise datapoints to the WiFi MCU. This means that even with OpenBk we can't fully customize the functionality of the device.
Fortunately, one of the devices I got a hold of, the Treatlife DS02S switch contains easy to connect programming headers for the nuvoton (SWD/SWCLK):
I also found Tuya released some version of their TuyaMCU SDK. So I was able to use that with some tricks to build a custom firmware that exposed all the IO to OpenBK, and ultimately pipe it to homeassistant over MQTT.
This works well now and I can use the switch as a scene controller, for US$10 it is very cheap compared to fancy scene controllers, and has several lights I can use to show which scene is selected. Moreover, I can centrally configure all the automations in home assistant.
You can find the repository here:
https://github.com/no2chem/open-tuyamcu
Maybe one day, when OpenBK supports OTA update of TuyaMCU we will be able to flash this firmware without opening the device when combined with CCtr!
Many of you are probably familiar with the TuyaMCU setup: devices which have two MCUs - one for WiFi, and another for handling device functions that speaks a protocol known as "TuyaMCU". TuyaMCU devices advertise datapoints to the WiFi MCU. This means that even with OpenBk we can't fully customize the functionality of the device.
Fortunately, one of the devices I got a hold of, the Treatlife DS02S switch contains easy to connect programming headers for the nuvoton (SWD/SWCLK):


I also found Tuya released some version of their TuyaMCU SDK. So I was able to use that with some tricks to build a custom firmware that exposed all the IO to OpenBK, and ultimately pipe it to homeassistant over MQTT.

This works well now and I can use the switch as a scene controller, for US$10 it is very cheap compared to fancy scene controllers, and has several lights I can use to show which scene is selected. Moreover, I can centrally configure all the automations in home assistant.
You can find the repository here:
https://github.com/no2chem/open-tuyamcu
Maybe one day, when OpenBK supports OTA update of TuyaMCU we will be able to flash this firmware without opening the device when combined with CCtr!
Cool? Ranking DIY