I’m trying to call a script ( script.send_notification_to_alexa ) from an automation with no success. The same script runs successfully from developer tools.
- id: '1622552193007'
alias: Close blinds at sunset
description: Close left and right blinds from living room at sunset if I am at home
trigger:
- platform: sun
event: sunset
offset: 00:30:00
condition:
- condition: state
entity_id: person.nicolas
state: home
action:
- service: script.send_notification_to_alexa
data:
what_to_announce: Attention à la fermeture des store
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
- service: cover.close_cover
target:
entity_id:
- cover.sonesse_40_io_2
- cover.sonesse_40_io_3
mode: single
And finally the way I successfully call the script from developer tools:
service: script.send_notification_to_alexa
data:
what_to_announce: Attention à la fermeture des store
Triggered by the sunset with offset at 30 June 2021, 22:26:30
Test state condition
Call service script.send_notification_to_alexa
Send notification from Alexa (script.send_notification_to_alexa) started
Send notification from Alexa (script.send_notification_to_alexa) turned on
Send notification from Alexa (script.send_notification_to_alexa) turned off
Delay for {“hours”:0,“minutes”:1,“seconds”:0,“milliseconds”:0}
1 minute later
Call service cover.close_cover on entities cover.sonesse_40_io_2, cover.sonesse_40_io_3
Sonesse 40 io (cover.sonesse_40_io_3) is closing
Sonesse 40 io (cover.sonesse_40_io_2) is closing
Cover (group.cover) changed to Closed
Finished at 30 June 2021, 22:27:30 (runtime: 60.30 seconds)