Toggle lights with one button; how to query ON/OFF state

Keep in mind with the front door example that “Frontdoor” is an Equipment tag, not a location tag.

To help with thinking about it I think maybe an HVAC system might be a better example. I don’t think anyone would argue that an HVAC is not an Equipment. However, there are often multiple actuators:

  • temperature setpoint
  • mode (heating/AC/OFF)
  • separate control for the fan (if a forced air system)

And multiple sensors

  • humidity
  • current temperature
  • status of the system (e.g. heating ON)

These are all naturally a part of a single piece of equipment. But there really isn’t a way to control or understand what’s going on with it using just the parent HVAC Group Item.

However, when it comes to the UI the story changes a little bit. You can assign/configure custom widgets to the Equipment Group Item. That custom widget can in fact be a unified set of buttons and dials that allow for the representation and control of the Equipment in a unified whole. I don’t have my HVAC integrated with OH right now but the examples I put into the Getting Started Tutorial illustrate this.

For the list widgets (those widgets that appear on the cards in the Overview page) you can define a widget that merges multiple Items into one widget. In the tutorial I show that the sensor telling me whether the garage door is open or not is merged with the switch that lets me trigger the garage door opener. I’ve applied this widget to the Switch Item and excluded the Contact sensor Item from the model, though one could also set the visibility to false and keep it in the model.

But to address your light bulb with two controls, you could do something similar. Define a default list item widget and apply it to the Dimmer Item that allows control of both the Dimmer and the Color Temp. Then either hide or exclude the color temp Item from the model. One control and multiple Items.

There are further examples at Example Custom List Widgets.

For the non-automatically generated pages you can do something similar also. For example, in the tutorial I show a unified Chromecast widget. This widget unifies the display and controls from nearly a dozen different Items all associated with the same Chromecast. Once this custom widget is created, I can assign it as the default card widget to the Equipment Group that represents that one Chromecast. Now, on the Overview page or on any other layout page I can select “add from model”, select the parent Chromecast Equipment Group Item and it will drop that unified widget onto the page.

I bring this up because control, from a UI perspective, is indeed able to handle representing more than one Point Item in a single widget. And you can leverage the model, if only a little bit, to make it possible. But from rules and Persistence and Sitemaps and such, you’ll have to deal with each Point Item directly, not through the parent Equipment Group.

1 Like