I have the following script which was working ok until I try to change the order of the
#- service: automation.trigger
#entity_id:
#- automation.set_alarm_at_night
and move it at the end of the code.
like this
go_to_bed:
alias: Goodnight
icon: mdi:bed-empty
sequence:
#- service: automation.trigger
#entity_id:
#- automation.set_alarm_at_night
- service: light.turn_on
data:
entity_id: light.bedside_lamp
- service: homeassistant.turn_off
data:
entity_id:
- media_player.lg_tv_webos_2
- climate.living_room_ac
- service: script.close_cover
data:
entity_id: cover.50758014840d8e91f4fd # main window
- delay: '00:00:40'
- service: script.close_cover
data:
entity_id: cover.50758014840d8e91f036 # erker
- delay: '00:00:15'
- service: script.close_cover
data:
entity_id: cover.50758014840d8e91eaa2 #bedroom
- delay: '00:00:15'
- service: script.close_cover
data:
entity_id: cover.50758014840d8e918632 #kid
- delay: '00:00:10'
- service: homeassistant.turn_off
data:
entity_id:
- light.77626641ecfabc96e072
- light.77626641ecfabc976395
- switch.kitchen_main_kitchen
- switch.kitchen_main_kitchen_spot
- switch.balcony_main_channel
- switch.balcony_balcony_1
- switch.balcony_balcony_2
- switch.bedroom_balcony
- switch.kid_balcony
- delay: '00:00:04'
- service: homeassistant.turn_off
data:
entity_id:
- switch.book
- switch.book_main_book_2
- delay: '00:00:04'
- service: homeassistant.turn_off
data:
entity_id:
- switch.sonoff_1000a05283
- switch.sonoff_10009bd11e
- switch.sonoff_10001bb5c7
- delay: '00:00:15'
- service: automation.trigger
entity_id:
- automation.set_alarm_at_night
Yesterday evening it won’t arm the alarm as it should be.
Anyone can tell me why?
Moreover, I would like to add the script the following code in order to know what is “on”
I give it some tries but never manage to get any notifications.
Apparently I am doing something wrong, but I can not find out what.
Ideally, I want to add it at the end of the script
# - service: notify.pushbullet_notification
# data:
# title: 'What is on'
# message:
# value_template: >
# {{ states['cover'] | selectattr('state','eq', 'open') | map(attribute='name') | list | join(', ') }}
# {{ states['cover'] | selectattr('state','eq', 'unknown') | map(attribute='name') | list | join(', ') }}
# {{ states['switch'] | selectattr('state','eq', 'on') | map(attribute='name') | list | join(', ') }}
# {{ states['light'] | selectattr('state','eq', 'on') | map(attribute='name') | list | join(', ') }}