Push Button Toggling help!

I am trying to accomplish the following and having no luck!

I have two sets of wall lights in my room controlled by separate basic Sonoff units. I am trying to set up push buttons that show status and also toggle like so (Wall Lights in Bedroom):

This would be both lights off:

Push “Right” and this would turn the Right set of lights on and show:

Pushing the “Right” button again should de-illuminate the button and turn the light off.

Is this possible?



With HABPanel one would need to create a custom widget.

In Basic UI/Classic UI, this is not going to be possible. You will only ever be able to have Left or Right highlighted at a time, never both.

Ah ok I see, thanks a lot.

How about if the two buttons were momentary, as in, they didn’t stay illuminated blue (but toggled lights everytime they were pressed) and using dynamic icons to show the status? For example if only the left side is on, the icon would show the left bulb lit, but if both are on, both would be lit etc…


Yes, I’ve done that.

Make the buttons virtual items and link them to the real switch items with a rule that turns on the real switch when the virtual switch items is pressed but turns off the virtual switch item after 500mS (or whatever).

Edit: I just saw that the OP wasn’t using HABpanel so it can’t be done like that!

Challenging. The problem isn’t getting the behavior right, the challenge is getting the UI the way you want it. The problem is the icon is based on the Item’s state. You cannot base the icon on the state of some other Item and you absolutely cannot do it they way you would need to on multiple Items.

So, to make it work with your icon you can do it with a Number Item or String Item but you would have to have four possible states which means four MAPPINGS which means four buttons.

  • OFF
  • Left
  • Right
  • All ON

Then you can create a set of dynamic icons that map to those four states, but I’m pretty sure the requirement to have four buttons will be a deal killer.