I just got introduced to the scene functions and have been moving over to them. I have 5 Govee HS800 WiFi bulbs and wish to use them as indicators of various issues throughout the house. For example, I have a scene to activate if the bathroom sink leak detector turns on to turn these to yellow and dim to 100%.
I saw the scene create function and the scene delete function and it says it deletes dynamically created scenes. However; when I enter the yaml code to do it, it does not like the delete part of it. If I could get this working, there are a lot of cool things I could be doing with this.
service: scene.create ← Here is where I create the temporary scene.
metadata: {}
data:
snapshot_entities:
- light.alarm_indicator_lights <–This is a light group I made of those HS300 lights.
scene_id: bathroom_sink_leak_detected_temp <–Here is the name of the temporary scene
service: scene.turn_on
metadata: {}
target:
entity_id: scene.alarm_bathroom_sink_leak <–This is the indicator scene, not the temp scene, to turn those lights to yellow.
wait_for_trigger:
platform: state
entity_id:
binary_sensor.bathroom_sink_leak_detection_sensor_state_any
to: “off”
for:
hours: 0
minutes: 5
seconds: 0
service: scene.turn_on
metadata: {}
target:
entity_id: bathroom_sink_leak_detected_temp <–This is to turn back on that temporary scene.
service: scene.delete
metadata: {}
data:
entity_id: bathroom_sink_leak_detected_temp <–This is to delete that temporary scene and this is where it gets mad at me.
mode: single
Thank you. The forum prompts me to change it from my paste. I will choose that option (been burned with forums screwing up formatting).
This is the error:
Message Malformed: not a valid value for dictionary value @ data[‘action’][5][‘target’][‘entity_id’]
I think it stems from the fact that “bathroom_sink_leak_detected_temp” doesn’t yet exist because it was not created. Do I temporarily create it as a null scene, finish the automation, then delete it?
Here is the code with me answering yes to the reformatting question when I post it: