I just flashed the plugin on a Tuya wall dimmer (1 gang dimmer Board labeled with YDM_WIFI_SV4). Which was very painful because i had to cut the RX trace on the PCB to make it work. Sending command work but after every command the MQTT connection is lost.
Working (somehow) with tuya / dimmer#2
I`m using the homie controller. When I send commands via SYSTEM/cmd/set I get this
Code: Select all
10008544: SerSW : SetDim 255
10008559: SerSW : Dimmer d1:255
10008844: MQTT : Connection lost, state: Connection lost
10008869: MQTT : Connected to broker with client ID: ESPClient_80:7D:3A:3E:70:FA
10008872: Subscribed to: homie/Wanddimmer-01/+/+/set
10008975: SerSW : ReadState
Here are the rules you need. Configure the homie receiver in (my case index 2) with an integer (1) and a boolean (2) parameter
Code: Select all
on Walldimmer#dimmer do
ydim,%eventvalue1%
let,1,%eventvalue1% // store to restore last dimmer state on switch=1
HomieValueSet,2,1,%eventvalue1% // acknowledge dimmer
endon
on Walldimmer#switch do
if [Walldimmer#switch]=0
relay,0,%eventvalue1%
else
ydim,[var#1]
HomieValueSet,2,1,[var#1] // acknowledge dimmer optional
endif
HomieValueSet,2,2,%eventvalue1% // acknowledge switch
endon
I can live with it for now but if somebody has an idea to fix the update problem I would be thankful. Or anybody has a tip to flash the dimmer without cutting the RX trace. Now writing this I think I have to check if I repaired the RX line correctly.
Thank you for this plugin!
Chris