Help with Tuya Light via Mqtt Pushbutton

Hi all,

I am relatively new to OH, running OH3 on a Pi. I need help with setting up a light switch using a pushbutton via mqtt commands.

Scenario: So my simplified example room is a corridor with 2 Tuya RGBCW bulbs. I have already installed the Tuya offline add-on. My corridor has 2 Lightswitches at each corridor end. For the 2 lights I have an Item “light_switch” which is liked to the Tuya channel. The switch is a pushbutton connected to an ESP32 which sends commands “pressed” to OH3 via Mqtt. I have a generic Mqtt Thing.

How do I setup OH3 to switch the light on/off? I presume I need a script that gets executed when the “pressed” command is received which checked if the light is on or off and the changes the status of Tuya item “light_switch”.

Thanks
Mike

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.