WTH Why doesn't home assistant know that a scene is active?

When you activate a scene, lights are set to specific levels - but I have no idea how to confirm that that scene is still on seconds later. The scene state just tells me the last time it was activated, but not that it’s currently active. WTH?

Scenes are stateless. They are lists of actions to be performed to get your devices into wanted states. Nothing more. HA has no way to tell if a scene is active or not.

5 Likes

Actually it has. It could compare desired state with the current state and if all of them match then scene is active.

7 Likes

Yup, we hear that a lot. Home Assistant did that back in the days. It doesn’t work.
For example, transitions on lights, rounding differences in brightness or color temperatures, slight changes in color interpretation (and many more of these). These cause them to be almost never active.

It caused more problems it resolved and the feature was therefore removed a long long time ago.

8 Likes

I think a different approach might be to utilize areas.

Put 5 scenes in an area.

On restart, all scenes are off.
when a scene in an area is activated. That scene is now running in that area. If another scene is activated in that same area, the other scene will now be off, and the new scene will be active. I.e. only one scene can be active in an area.

This could possibly just be a new entity. “area_scenes” or something. That way, it doesn’t rely on the states of the entities. Or maybe just a scene group that allows n scenes with an ‘assumed state’ when scenes are activated.

2 Likes

I think it doesn’t matter if the scene is related to area or consists random entities.

I understand what Franck said and agree that slight changes can create a lot of confusion. Still I’d like to have such functionality possible. For instance to know that someone has touched light brightness or whatever. Maybe just find a way to get list of entities and their attributes in scene and compare with current state inside template? This will be enough complicated and technical to keep regular users away :wink:

Of course it totally different story if we put brightness 0.3 to the scene but compare with the actual one that comes from device and is 0.30000000000000004 . I actually don’t have a knowledge how this is implemented.

This ‘missing feature’ is the reason for me to use HomeKit scenes instead of the built in Home Assistant scenes.

So far I didn’t have issues on the HomeKit side with determining whether a scene was on or not. Considering Frenck’s explanation; is it that Homekit ‘simplifies’ the data (eg bigger step sizes in linear ranges) and is therefore better at determining whether a scene is turned on?

5 Likes

This is actually why the few scenes I have set up are in Homekit and not Home Assistant. I’m not sure what Homekit is doing, but whatever it is it works!

1 Like

Unfortunate that it was a feature that didn’t work well. I know Lutron is keeping track of its scenes internally. I totally understand the “the scene is not on the second someone touches the brightness”, but I’ve setup keypads in my house to almost exclusively recall scenes (this was our solution when I used to work in home tech for residential systems).

as a workaround you can create an input_select with the scenes and set the that input_select to the corresponding option when activating the scene. You will at least know the last activated scene

6 Likes

Maybe a nice tip for you as well;

I’ve manually set up a MQTT device in Home Assistant with triggers that I expose to Homekit. The triggers in homekit are tied to a scene using an automation.

So if I want to trigger a scene:

  1. I call a script, e.g. script.scene_away
  2. The script triggers the MQTT device trigger by sending an MQTT message to the defined trigger topic
  3. Homekit receives the trigger, e.g.
  alias: 'Away'
  sequence:
    service: mqtt.publish
    data:
      topic: homekit_trigger/scene
      payload: away
  1. Using an automation, the scene is triggered by Homekit.
1 Like

That’s too bad. Lutron RadioRA 2/3, HomeWorks have scenes that are stateful and can be tracked by button LED. Very useful to use on keypads, Lutron or others, that have indicator lights. Hubitat has good scene tracking. While transitions can be an issue, once the devices land at their assigned levels the scene is properly noted as active. Highly suggest that this functionality is re-introduced to Home Assistant.

5 Likes

How about a scene sensor that when a scene is activated that sensor is “on” or “myscene”, when any light etc that is part of that scene is changed then the sensor goes to “off” or “None”?

Dismissing this request just because it can’t be derived from the current scene-info seems a bit too quick, seeing how much this question gets asked, there is clearly a desire to address this in the community, without having to resort to the heavy-handed solutions that people currently have to resort to in order to address it.

I would imagine that this functionality would require some extra functionality to be built into the scene definition (maybe even a whole new type of “stateful scene” or some kind of “composite state” entity) where you have to specify the states that you want to include in the “scene state check” – in a lot of cases it would solve the problems I have seen asked (and I know it would fix mine) and I think most people would be ok with having to put a bit more work into configuring their scenes to gain this functionality.

1 Like

I am also missing this feature because I am used to it from my old HA System (Indigo domotics)
I understand it migh not easyly be implementented with the current scenes UI.
I would suggest to implement an attribute in a sceene entity if it’s relevant or not.
Or maybe a scene could be defined as a virtual device whose state shows if all used devices are in the correct state or not.

1 Like

I had a similar issue: I wanted the light in my bathroom and hallway to always adapt to the lighting situation in the living room.

To solve this, I integrated a helper (switch, input_boolean) into every lighting scene in the living room and integrated the status of the switch to the conditions for the lighting in bathroom and hallway. Works very well and wasnt even that much hustle for setup.

1 Like

Same feeling here.
I’m dying for an answer to this. Here is a real world use case:

Mounted a wall table with a nice dashboard and and a couple of favorite scenes.
Kid walked in and tried to activate the dinning scene, which I had done already. Nothing happened (since the scene was already active).

As we are having dinner she made this comment: “That thing looks cool, when are you going to connect it”? Needless to say how disappointed I was…

Anyway, it is all about user experience.
User will not only expect the visual indicator that a given scene is active but also, click/tap the button to turn it off, meaning, sending an off command to every device associated with that scene which supports it.

As mentioned here, Lutron, Hubitat and HomeKit got it right (just to mention a few).

5 Likes

Until the requested feature is implemented (if ever), here’s how I currently handle it.

I use a Template Switch to turn things on/off. That’s what users interact with in the UI and not the scene(s) directly.

An Input Boolean serves to indicate the Template Switch’s current status. It’s turned on/off by the Template Switch.

In my case, I need the Template Switch to control more than just a single scene so I chose to create a separate script to turn several entities on or off. The Template Switch simply calls the script and passes the desired command (on or off) to it.

Example

Template Switch

switch:
  - platform: template
    switches:
      evening_interior:
        friendly_name: Evening Interior
        value_template: "{{ states('input_boolean.evening_interior') }}"
        turn_on:
        - service: script.evening_interior
          data:
            command: 'on'
        turn_off:
        - service: script.evening_interior
          data:
            command: 'off'

Script

The script controls various Hue and UPB scenes as well as specific lights and switches. It could also be used for Home Assistant’s scenes but you’ll need one scene for turning the entities on and another scene for turning them off.

script:
  alias: Evening Interior
  description: Evening Interior scene
  fields:
    command:
      description: 'Activate or deactivate the Evening Interior Scene'
      example: 'on or off'
  sequence:
  - choose:
    - conditions: "{{ command == 'on' }}"
      sequence:
      - service: scene.turn_on
        target:
          entity_id:
          - scene.evening_interior
          - scene.kitchen_bright
          - scene.family_relax
          - scene.hall_relax
          - scene.master_nightlight
      - service: switch.turn_on
        target:
          entity_id: switch.kitchen_worklight
      ... etc ...
    - conditions: "{{ command == 'off' }}"
      sequence:
      - service: upb.link_deactivate
        target:
          entity_id: scene.evening_interior

      - if: "{{ is_state('light.sink', 'on') }}"
        then:
          - service: light.turn_off
            target:
              entity_id: light.sink
       ... etc ...

Is this more involved than having a stateful scene? Sure, but it’s available now and provides more flexibility than what’s possible with merely a scene (i.e. such as making decisions, calling services, etc).

4 Likes

@123 Can you help me understand how this handles indicating that the scene is “off” when one of the entities in the scene change from the value set by the scene? It doesn’t appear your solution checks for that but I could be missing it.

"Downstairs Off" Scene

  • All lights and switches included in the scene and set to OFF
  • If a light or switch is turned on, the “Downstairs Off” scene is now OFF

This works as intended with HomeKit scenes but I’m trying to move everything to Home Assistant and only use HomeKit for the UI.

This topic is no longer fresh in my mind but I don’t think that was ever one of the requirements mentioned by this FR. Therefore my posted suggestion never implemented it.

Long story short, Home Assistant’s scene entity is stateless (and that’s unlikely to ever change). If you want a stateful scene that deactivates if one of its members deviates from the scene’s original configuration, you’ll have to invent it.