TheAgentK / tuya-mqtt

Nodejs-Script to combine tuyaapi and openhab via mqtt
MIT License
173 stars 80 forks source link

Support for Tuya dimmer switches #30

Closed owl770 closed 3 years ago

owl770 commented 4 years ago

Does tuya-mqtt currently support dimmer switches (other than on/off control)? If so, are there any instructions/examples available? In the dimmers I have, dps 1 is a bool for on/off and dps 2 is a number (0-255) for the brightness. It would be great if there were topics that increased/decreased the brightness (dps 2), that could then be configured in openhab. Thanks for considering this request.

tsightler commented 3 years ago

Dimmers work fine, you can set any DPS you like via the command topic (examples are in the README). How to do this from OpenHAB I'm not sure as I don't use OpenHAB. To set a specific DPS value you need to send a JSON message like this:

"{ \"dps\": 2, \"set\": 100 }"

Looks like it would be pretty easy to do with a transform in OpenHAB, might want to ask there. You can also monitor any DPS state as well.