Step-by-Step guide for adding Tuya-bulbs, Wi-Fi smart LED (Smart Life app) to OH2 using tuya-mqtt.js by AgentK

Hello , update for tuya devise.

tsightler has updated the script of TheAgentK ,now it work with device who used the 3.3 protocol. the script is here : https://github.com/tsightler/tuya-mqtt , but in few days it will be update the script on the officiel page. There is also the discovery ip, no need to put ip on the state topic and command topic.

Example :

tuya/<tuyAPI-id>/<tuyAPI-key>/discover/state
tuya/<tuyAPI-id>/<tuyAPI-key>/discover/command

If you want to put the ip , don"t forget to put ver3.3 between tuya and tuyAPI-id , example :

tuya/ver3.3/<tuyAPI-id>/<tuyAPI-key>/<tuyAPI-ip>/state
tuya/ver3.3/<tuyAPI-id>/<tuyAPI-key>/<tuyAPI-ip>/command

With the version 3.3 protocol you need also tu put on on/open value : 1 or ON and off/closed value : 0 or OFF

For device with DPS, as 2 ways device :

On/open value : { "dps": 1, "set": true }
Off/closed value : { "dps": 1, "set": false } 

and in state topic :
tuya/ver3.3/<tuyAPI-id>/<tuyAPI-key>/<tuyAPI-ip>/dps/1
or
tuya/<tuyAPI-id>/<tuyAPI-key>/discover/dps/1
but here i have a problem, because the tuyapi return true or false value for the state and openhab don’t know true or false state, but work with on or off…

2 Likes