I am quite new to openhab. I am migrating from Pimatic, which has a great ruleset and many usefull items, a button for example, very easy to create. I am trying to achive this goal in openhab, but as I read, this is not possible. I tried to do this with a sitemap but I am not able to create a button. Only a switch will be displayed in BasicUI although I used mappings. I used this code:
Switch item=sBedroomMainLight label="Bedroom main light []" icon="light" mappings=[ON="PUSH"]
The sitemap works, but only a switch will be displayed. Am I doing something wrong or does that not work in Openhab 4.3.2?
I am so stu***. I tried only the code without an item behind it. I just changed the code to an existing item and bam, it works.
But now I have another question. After I pushed the button it gets highlighted and stays highlighted. Is there a way, that you push it once and it moves back to an unhighlighted button?
To elaborate a bit on @JimH’s answer, he set an expire timer to command the Item back to OFF after one second. You might want to update it to OFF instead which will not go out to the end device and just change the state of the Item.
Beware though as commands go to the device and are not just changes to the Item’s state.
The button will remain highlighted as long as the Item’s current state matches the mapping.