Credit goes to https://github.com/uspass/Tuya-Water-Leak-Sensor
Module 54
TuyaMCU 51,21
Backlog SetOption1 1; SetOption65 1; SetOption36 0; SwitchMode 1
Rule1
ON TuyaReceived#Data$|6501000101 DO publish2 stat/%topic%/WATER ON ENDON
ON TuyaReceived#Data$|6501000100 DO publish2 stat/%topic%/WATER OFF ENDON
Rule2
ON TuyaReceived#Data$|6604000100 DO publish2 stat/%topic%/BATT 100 ENDON
ON TuyaReceived#Data$|6604000101 DO publish2 stat/%topic%/BATT 75 ENDON
ON TuyaReceived#Data$|6604000102 DO publish2 stat/%topic%/BATT 50 ENDON
ON TuyaReceived#Data$|6604000103 DO publish2 stat/%topic%/BATT 1 ENDON
Backlog Rule1 1; Rule2 1
Rule3
ON system#boot do publish2 homeassistant/binary_sensor/%macaddr%_fire/config {"name":"Kitchen Water Leak","state_topic":"stat/%topic%/WATER","device_class":"moisture","unique_id":"%macaddr%_water","device":{"connections":[["mac","%macaddr%"]]}} ENDON
ON system#boot do publish2 homeassistant/sensor/%macaddr%_battery/config {"name":"Kitchen Water Leak Alarm Battery","state_topic":"stat/%topic%/BATT","device_class":"battery","unique_id":"%macaddr%_batt","device":{"connections":[["mac","%macaddr%"]]}} ENDON
Rule3 1