Can I visually stop reporting the button status in the GUI?

Hi,

First post ever! :slight_smile:… I’ve been using OH for a month and although there is quite a learning curve for someone like me who more into pictures than text, I’m making good progress and I’m loving the platform! Got so tired of using 10 apps to control my house :rage:

Anyway my issue is that I have a physical light switch that does not provide status updates so the openHAB GUI is almost never in sync (as is impossible of course). I’ve moved away from the standard “toggle” switch in OH and have gone with a “button” switch but the status is still shown in the form of a highlight.

Is there any way I can just have an “on” and “off” button without any selection after clicking?

1 Like

Hey and welcome to the community!
This use case is quite common and there are two prominent solutions for it.

  1. Use the expire binding:
Switch myLight "Light" { zwave="3", expire="1s" }
  1. If you already use a rule to react on the button press change the item to something else at the end of the rule. Full Example here.
rule "Whg_Light_Preset"
when
    Item Whg_Light_Preset received command
then
    //do stuff
    Whg_Light_Preset.postUpdate(-1)
end

WOW, what a fast response, much appreciated! I’ll give the first solution a whirl for now as I’ve not progressed to setting rules just yet.

Thanks again! :beers:

Good luck :wink:

I’ve read what as Expire Binding does but I am still struggling to implement it.

I’m trying to test simply using:

sitemap:

Switch item=Lamp mappings=[ON="On", OFF="Off"]

items:

Switch Lamp {expire="0s"}

The following is what I’m actually trying to get it working on:

Switch Alarm_ST_1 {mqtt=">[broker:smartthings/Siren/alarm:command:ON:siren],>[broker:smartthings/Siren/alarm:command:OFF:off],<[broker:smartthings/Siren/alarm:state:ON:siren],<[broker:smartthings/Siren/alarm:state:OFF:off]"}

Go for it then :wink:

Switch item=Alarm_ST_1 mappings=[ON="On", OFF="Off"]
Switch Alarm_ST_1 {mqtt="
  >[broker:smartthings/Siren/alarm:command:ON:siren],
  >[broker:smartthings/Siren/alarm:command:OFF:off],
  <[broker:smartthings/Siren/alarm:state:ON:siren],
  <[broker:smartthings/Siren/alarm:state:OFF:off]",
  expire="1s"}

(wrapping is not needed but makes it a lot easier to handle, right!?)

1 Like

Sorry, what I meant was, I did try and it still keeps the button highlighted once clicked. Apologies I should have been clearer. I’ve just copy and pasted your code exactly and the selection does not disappear one second after being clicked.

Yes it certainly makes it easier to handle, I will write like that in future rather than running over two screens :grin: :thumbsup:

I’ve sorted it. As mentioned I’m still getting to grips with OH so I neglected to notice that I needed to add an the expire.jar to my addons folder. I know the clue was in the title Expire “Binding”. Thanks for your help @ThomDietrich :+1:

Don’t add the expire.jar manually. You can install the binding from the Add-ons menu in Paper UI. Copying the jar is only needed for bindings in development.
Glad you got it working :wink:

1 Like