SmartThings Community

Adding MQTT payload capability to scene controller Device Handler

(Sean) #1

Hey guys, I have several Homeseer HS-WD100+ and HS-WS100+ light switch/scene controllers. I’m running these device handlers from @Darwin. They work great for control inside the SmartThings ecosystem. I also have smartthing-MQTT-bridge which works really good for integrating my ST devices into Home Assistant. What I’d like to do is gain the ability to pass each individual button press to my MQTT broker. Currently, all eight unique button presses are passing the same exact topic/message to the MQTT Bridge.

Incoming message from MQTT: smartthings/Bedroom Light Switch/button = pushed

I’m guessing the device handler for the switch would need to be rewritten to pass on the individual buttons to MQTT. Is this something that’s feasible? It would be amazing to have this:

Incoming message from MQTT: smartthings/Bedroom Light Switch/button = pushed 1
Incoming message from MQTT: smartthings/Bedroom Light Switch/button = pushed 2

etc.

Or perhaps it would work better with each button as it’s own topic:

Incoming message from MQTT: smartthings/Bedroom Light Switch/button/1 = pushed

Or maybe make the payload json formatted like:
Incoming message from MQTT: smartthings/Bedroom Light Switch/{"button_pushed": 1}

Where would I go messing around to experiment with this? Thanks!

0 Likes