Ok i think i found the error…
if set up this automation via the visual editor, the step “scene.turn_on” doenst find the scene that we create with action “scene.create”
and thats why my automation dont work and i cant either save cause this error message appear:
Message malformed: not a valid value for dictionary value @ data[‘action’][1][‘repeat’][‘sequence’][2][‘target’][‘entity_id’]
thats what the yaml look like if selected over the visual editor:
service: scene.turn_on
metadata: {}
target:
entity_id: flash_light_couch_rechts
if the visual editor would do it right, then there must be a “scene.” befor the entity name… right ?
i change from visual to yaml editor and change the above to this:
service: scene.turn_on
metadata: {}
target:
entity_id: scene.flash_light_couch_rechts
i can save, only the “metadata” stays, but i think thats not a problem…
if i remove it, the visual editor change the choices:
with string “metadate {}”
without (deleted in yaml mode and change back to visual):
Thats more then confusing…
So, i tested then the automation. It works, i´ve fine tuned just a little bit. Cause if the Light is already red, i dont see the flash. there must a “go off” command.
another question is, should i create a delete scene command. cause i think it will bring errors when everytime the automation create the same scene with the same name… or does it matter ?
Already included but dont know if this is necessary.
here is now my finished code… any tipps or suggestions ?
(the data{} comes everytime i open the automation, so i leave it there…)
alias: Person erkannt
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.kamera_person
from: "off"
to: "on"
action:
- service: scene.create
data:
snapshot_entities:
- light.couch_rechts
scene_id: flash_light_couch_rechts
- service: light.turn_off
target:
entity_id: light.couch_rechts
data: {}
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- repeat:
count: 5
sequence:
- service: light.turn_on
target:
entity_id: light.couch_rechts
data:
color_name: red
- delay:
seconds: 1
- service: light.turn_off
target:
entity_id: light.couch_rechts
data: {}
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: scene.turn_on
target:
entity_id: scene.flash_light_couch_rechts
data: {}
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: scene.delete
target:
entity_id: scene.flash_light_couch_rechts
data: {}
mode: single
thank you all for helping me…