openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

Add support for Scenes in OpenHab

Open ErikApption opened this issue 3 years ago • 7 comments

Following up on the debate on this thread

Scenes

Definition

A scene is a preset that will change all items that are effected, so if you set a scene in a room, all lights in that room will be changed to the settings of that scene.

Scenes in Hue

Scenes is the main user flow in the Hue interface. Other features such as triggers, buttons and other integrations are secondary in the user interface. image

Scenes in Home Assistant

Since version 0.15, Home Assistant has a support for scenes. See this link for more details. A scene in HA has a name, icon and a series of entities. Each entity in each scene has any number parameter values.

image

HA also supports transitions for scenes to gradually transition the values when possible. HA enables to create snapshots of multiple entities into a scene using their scene service.

To clarify some of the debate in the thread above, the HA concept and features don't seem to be debated by users in their github.

Implementation

Rules

A series of addon Widgets provide multiple features to support scenes. See this

Pros:

  • No change to the core OH are required.
  • Each scene is captured in this model in a separate rule.

Cons:

  • Not sure editing scenes is supported.
  • Also going to assume that if the rules are manually edited, it could easily break any built-in editor.
  • The number of scenes would generate a large number of rules which would need to be managed somehow (tags? new UI sections?)

Core OH Addition

If OH did follow the HA model - scenes can be added in the core model. Scenes could be applied at the group level and provide a way for a group to switch between multiple scenes. livingRoomLights.SetScene("Morning")

Pros:

  • Adding scenes to the core could support better UX for adding and editing scenes
  • The scene data would have a separate conceptual space and not clog the rule section
  • Applying scenes to group would make it easy to integrate them with rules

Cons:

  • Changes in core
  • Need for new UI for capture and editing of scenes

Other considerations

One additional consideration for implementing rules would be to integrate with existing scene systems. Almost every light system already have their own built-in scene support, it would be nice if the API could leverage them transparently: livingRoomLights.SetScene("Morning") would call scene "Morning" inside my Hue lights

ErikApption avatar Sep 19 '22 19:09 ErikApption