Hi everyone, I’m diving into OpenHAB and exploring its capabilities, especially with MQTT. I came across an interesting challenge that I thought I’d share with you all—how to create a button that doesn’t have an On/Off state but sends an MQTT message when clicked. This idea came to me while thinking about integrating smart devices in a way that feels seamless and intuitive.
So, here’s what I’m trying to achieve: I want a button that, when pressed, triggers an action without toggling between On and Off. For example, imagine a button that turns on a light when pressed once and turns it off when pressed again. But in this case, I don’t want the button itself to have any state—it should just send a message to an MQTT topic when clicked. Sounds simple enough, right?
I’ve managed to set up MQTT in OpenHAB and even created a few Switch items that work perfectly. But this button concept is a bit trickier. I’ve looked into the documentation and some forums, and it seems like using a Rule might be the way to go. I’m thinking of using a Rule that triggers when the button is pressed and then sends the MQTT message. But I’m not entirely sure how to set this up properly. Any tips or experiences you’ve had with similar setups would be greatly appreciated!
Another aspect I’m curious about is visual feedback. When the MQTT server receives the message from the button, is it possible to have some kind of confirmation, like the button turning green for a few seconds? This would provide immediate feedback to the user, making the system more user-friendly. I’m not sure if this is feasible, but it would be a cool feature to implement.
I’m also wondering if there are any existing bindings or integrations that make this kind of setup easier. Maybe there’s a plugin or a custom rule that someone has already created that I could use as a starting point. I’d love to hear about any resources or examples you might have come across.
This project has been a great learning experience for me, and I’m excited to see how it unfolds. Whether it’s through trial and error or by learning from others’ experiences, I’m determined to make this button work as intended. If anyone has any insights, suggestions, or just wants to chat about MQTT and OpenHAB, I’m all ears!
Thanks in advance for your help and support. Happy tinkering!