Hi all, This automation turns a smart bulb on and sets the color to red as a visual indicator that someone left the gate to our backyard open. Once the gate is closed, I want to return the bulb to its original state.
I thought I understood that the service “scene.create” when called with a snapshot entity would save the current state of ALL of the entity’s attributes as a scene, including the bulb’s color. The scene is successfully created, and then later applied with a “scene.turn_on” call. But when the automation completes, the bulb is still red. What am I missing here?
alias: Gate left open monitor
description: ""
trigger:
- type: opened
platform: device
device_id: 5a4a79ff69b6fddb5de5d15bde4af201
entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_opening_2
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 30
condition: []
action:
- service: notify.alexa_media_everywhere
data:
message: Warning! Warning! Gate left open! Gate left open!
data:
type: announce
target: alexa_media.everywhere
enabled: true
- service: notify.mobile_app_victor_s_s23
data:
message: Gate left open
- service: scene.create
data:
scene_id: save_living_room_lamp_state
snapshot_entities: light.living_room_lamp_light
- service: light.turn_on
data:
rgb_color:
- 255
- 0
- 0
target:
device_id: e5af10bcc9f044c900dd79205a5d3a11
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.lumi_lumi_sensor_magnet_aq2_opening_2
to: "off"
for:
hours: 0
minutes: 0
seconds: 5
- type: not_opened
platform: device
device_id: 5a4a79ff69b6fddb5de5d15bde4af201
entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_opening_2
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 30
continue_on_timeout: true
- service: notify.mobile_app_victor_s_s23
data:
message: Gate has been closed
- service: scene.turn_on
data: {}
target:
entity_id: scene.save_living_room_lamp_state
- service: notify.alexa_media_everywhere
data:
message: The Gate has ben closed.
data:
type: announce
target: alexa_media.everywhere
enabled: true
mode: single