Is it possible to get (or set) the status of a scene ? I want to use it in an automation.
I don’t think you can get the status of a scene, as it is always shown as “scening”, but you can turn a scene on from an automation using the “scene.turn_on” command.
Extra info: I turn a scene on in an automation, after that I do a check every 5 minutes if a the lights in the scene are actually on. I only want to perform that check when the scene is active. For now I have based the trigger on the status of the group the light is in, when this group is on it will check all the other lights.
Background: some Hue lights are sometimes out of reach.
My automation:
alias: Check of alle buitenlampen aan gaan
trigger:
- platform: time
minutes: '/5'
condition:
condition: and
conditions:
- condition: state
entity_id: 'group.buiten'
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: 'light.veranda'
state: 'off'
- condition: state
entity_id: 'light.garage_achter'
state: 'off'
- condition: state
entity_id: 'light.garage_zijkant'
state: 'off'
- condition: state
entity_id: 'light.garage_voorkant'
state: 'off'
- condition: state
entity_id: 'light.tuinpad_voor'
state: 'off'
- condition: state
entity_id: 'light.lantaarn_tuinpad'
state: 'off'
- condition: state
entity_id: 'light.voordeur'
state: 'off'
- condition: state
entity_id: 'light.lantaarn_oprit'
state: 'off'
- condition: state
entity_id: 'light.lantaarn_oprit_voor'
state: 'off'
- condition: state
entity_id: 'light.zwaveme_zme_0643305433_wall_flushmountable_dimmer_level_4_0'
state: 'off'
action:
service: scene.turn_on
entity_id: scene.buiten_avond_vroeg
for the “on” check I use the group.
for the “off” check I have based the automation on the light closest to the bridge, the most reliable light:
alias: Check of alle buitenlampen uit gaan
trigger:
- platform: time
minutes: '/5'
condition:
condition: and
conditions:
- condition: state
entity_id: 'light.voordeur'
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: 'light.veranda'
state: 'on'
- condition: state
entity_id: 'light.garage_achter'
state: 'on'
- condition: state
entity_id: 'light.garage_zijkant'
state: 'on'
- condition: state
entity_id: 'light.garage_voorkant'
state: 'on'
- condition: state
entity_id: 'light.tuinpad_voor'
state: 'on'
- condition: state
entity_id: 'light.lantaarn_tuinpad'
state: 'on'
- condition: state
entity_id: 'light.voordeur'
state: 'on'
- condition: state
entity_id: 'light.lantaarn_oprit'
state: 'on'
- condition: state
entity_id: 'light.lantaarn_oprit_voor'
state: 'on'
- condition: state
entity_id: 'light.zwaveme_zme_0643305433_wall_flushmountable_dimmer_level_4_0'
state: 'on'
action:
service: light.turn_off
entity_id: group.buiten