Scripts and automations issue on 2021.6

Hi
After updating to 2021.6 I have started getting this message:

In logs I have found this:

What changes did I miss? Should I show my full scripts.yaml?

Yes. You have a number of invalid script configurations.

'000':
  alias: Alarm by Alice
  sequence:
  - service: input_boolean.turn_on
    entity_id: input_boolean.was_it_alice
  - service: scene.create
    data:
      scene_id: before
      snapshot_entities:
        - switch.wall_switch_left_158d00022363c5
        - switch.wall_switch_right_158d00022363c5
        - switch.wall_switch_158d000236aa6a
        - switch.wall_switch_left_158d000245c5ca
        - switch.wall_switch_right_158d000245c5ca
        # - switch.wall_switch_158d0002ec4a59
  - service: camera.snapshot
    data:
      entity_id: camera.generic_camera
      filename: '/config/www/tmp/alarm_at_home.jpg'
  - entity_id: group.all_real_lights
    service: switch.turn_on
  - service: light.turn_on
    data:
      entity_id: light.pre_hall_light
      effect: 'Police'
  - delay: 00:00:02
  - service: xiaomi_aqara.play_ringtone
    data:
      gw_mac: 7c:49:eb:b1:df:cb
      ringtone_id: '0'
      ringtone_vol: '100'
  - service: notify.mobile_app_argo # notify.notify
    data_template:
      message: "Дома включена тревога! Сейчас дома {{ states.person | selectattr('state','eq','home') | map(attribute='attributes.friendly_name') | list | join(' и ') }}"
      title: 'Внимание!'
      data:
        attachment:
          url: "https://****************:0000/local/tmp/alarm_at_home.jpg"
          content-type: jpg
        push:
          sound:
            name: default
            critical: 1
            volume: 1.0



'000_1':
  alias: Alarm off by Alice
  sequence:
  - condition: state
    entity_id: input_boolean.was_it_alice
    state: 'on'
  - service: scene.turn_on
    data:
      entity_id: scene.before
  - data:
      gw_mac: 7c:49:eb:b1:df:cb
    service: xiaomi_aqara.stop_ringtone
  - data:
      entity_id: light.pre_hall_light
    service: light.turn_off
  - delay: 00:00:01
  - service: notify.mobile_app_argo
    data:
      message: 'Тревога отключена'
  - service: input_boolean.turn_off
    entity_id: input_boolean.was_it_alice



'001':
  alias: Change theme
  sequence:
    - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.theme_is_light
            state: 'off'
        sequence:
          - service: frontend.set_theme
            data:
              name: "light"
          - service: input_boolean.turn_on
            entity_id: input_boolean.theme_is_light
      default:
        - service: frontend.set_theme
          data:
            name: "slate_moded"
        - service: input_boolean.turn_off
          entity_id: input_boolean.theme_is_light



'002':
  alias: Alarm on by leaving home
  sequence:
  - wait_template: "{{ is_state('binary_sensor.secure', 'off') }}"
    timeout: '00:40:00'
  - condition: state
    entity_id: binary_sensor.secure
    state: 'off'
  - entity_id: alarm_control_panel.ha_alarm
    service: alarm_control_panel.alarm_arm_away
    data:
      code: '2846'
  - condition: state
    entity_id: group.all_real_lights
    state: 'on'
  - service: switch.turn_off
    entity_id: group.all_real_lights
  - service: notify.mobile_app_argo
    data_template:
      message: "Кажется, свет в {{ states|selectattr('entity_id', 'in', state_attr('group.all_real_lights', 'entity_id'))
|selectattr('state', 'equalto', 'on')|map(attribute='name')|join(', ')}} остался включенным, а вы все покинули дом. Выключаю свет."



'003':
  alias: Alarm off by comming home_2
  sequence:
  - wait_template: "{{ is_state('binary_sensor.secure', 'on') }}"
  - entity_id: alarm_control_panel.ha_alarm
    service: alarm_control_panel.alarm_disarm
    data:
      code: '2846'
  - entity_id: input_boolean.imitation
    service: input_boolean.turn_off
  - service: script.006



'004':
  alias: Alarm off by comming home
  sequence:
  - entity_id: alarm_control_panel.ha_alarm
    service: alarm_control_panel.alarm_disarm
    data:
      code: '2846'
  - entity_id: input_boolean.imitation
    service: input_boolean.turn_off



######## Автоматизация ##########

'005':
  alias: Hello_1
  sequence:
  - wait_template: "{{ is_state('binary_sensor.door_window_sensor_158d0001dcb0e3', 'on') }}"
  - condition: template
    value_template: "{{ states('binary_sensor.motion_sensor_158d0003667bcb') != 'on' }}"
  - condition: template
    value_template: "{{ states('binary_sensor.motion_sensor_158d00031b4772') != 'on' }}"

  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.9
  - delay: 00:00:02
  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data_template: # в одинарных кавычках можно вставить связующее звено между именами
      media_content_id: >
        Добро пожаловать домой, {{ states.person | selectattr('state','eq','home') | map(attribute='attributes.friendly_name') | list | join(' ') }}
      media_content_type: text
  - delay: 00:00:04
  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.5

  - wait_template: "{{ is_state('binary_sensor.motion_sensor_158d0002b5d946', 'on') }}"
    timeout: 00:02:00
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d000224aa83
    state: 'off'
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d0002b5d946
    state: 'on'
  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      media_content_id: Сначала помыть руки!
      media_content_type: text


'006':
  alias: Hello_2
  mode: restart
  sequence:
  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.9
  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data_template: # в одинарных кавычках можно вставить связующее звено между именами
      media_content_id: >
        Добро пожаловать домой, {{ states.person | selectattr('state','eq','home') | map(attribute='attributes.friendly_name') | list | join(' ') }}
      media_content_type: text
  - delay: 00:00:04
  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.5



'007':
  alias: Bath wait for humidity then off
  sequence:
  - delay: 00:00:01
  - condition: state
    entity_id: binary_sensor.door_window_sensor_158d0001e5d691
    state: 'on'
  - delay: 0:2:0
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d000224aa83
    state: 'off'
  - wait_template: "{{ states('sensor.humidity_158d0002279c7d')|float < 65 }}"
    timeout: '00:30:00'
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d000224aa83
    state: 'off'
  - condition: state
    entity_id: switch.wall_switch_right_158d000245c5ca
    state: 'on'
  - service: switch.turn_off
    entity_id: switch.wall_switch_right_158d000245c5ca



'008_1':
  alias: Up one
  sequence:
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d0002b5d946
    state: 'off'
  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.6
  - service: media_player.play_media
    entity_id:  media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      media_content_id: <speaker audio="alice-sounds-nature-forest-2.opus"> Пора вставать.
      media_content_type: text
  - delay: 00:00:12
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d0002b5d946
    state: 'off'

  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      media_content_id: Включи плейлист дня
      media_content_type: command

  - wait_template: "{{ is_state('binary_sensor.motion_sensor_158d0002b5d946', 'on') }}"
    timeout: '1:0:0'
  - service: media_player.media_pause # или сделать turn_off?
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3



'008_2':
  alias: Up two
  sequence:
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d00031b4772
    state: 'off'
    for:
      minutes: 3
  - condition: state
    entity_id: binary_sensor.door_window_sensor_158d0002ca121c
    state: 'off'
    for:
      minutes: 6

  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.8
  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      media_content_id: Включи радио максимум
      media_content_type: command

  - wait_template: "{{ is_state('binary_sensor.motion_sensor_158d00031b4772', 'on') }}"
    timeout: '1:0:0'
  - service: media_player.media_pause
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3



# '008_3':
#   alias: Up three
#   sequence:
#   - service: media_player.play_media
#     entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
#     data:
#       media_content_id: Включи радио максимум
#       media_content_type: command

#   - wait_template: "{{ is_state('binary_sensor.motion_sensor_158d00031b4772', 'on') }}"
#     timeout: '5:0:0'
#   - service: media_player.media_pause
#     entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3



'009':
  alias: Say good morning
  sequence:
  - service: timer.cancel
    entity_id: timer.leave
  - service: input_boolean.turn_off
    entity_id: input_boolean.timer_is_over

  - service: timer.start
    data_template:
      entity_id: timer.leave
      duration:
        minutes: "{{ (state_attr('input_datetime.leave_timer', 'timestamp') -
    state_attr('input_datetime.alarm_morning', 'timestamp')) // 60 }}"

  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.5

# Объявление #
  - service: media_player.play_media
    entity_id:  media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      media_content_id: <speaker audio="alice-sounds-nature-forest-2.opus">
      media_content_type: text

  - delay: 00:00:02
  - wait_template: "{{ is_state_attr('media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3', 'alice_state', 'IDLE') }}" # Дожидаемся когда Алиса закончит задание
    timeout: 00:01:00

  - service: switch.turn_on
    entity_id: switch.wall_switch_right_158d00022363c5

  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data_template:
      media_content_id: "Сейчас {{states('sensor.time')}}, пора вставать. До работы ехать {{states('sensor.waze_travel_time')}} минут. За окном {{states.weather.dom.attributes.temperature | int}} градусов"
      media_content_type: text

  - delay: 00:00:05
  - service: switch.turn_on
    entity_id: switch.wall_switch_left_158d00022363c5

  - delay: 00:00:05
  - service: switch.turn_on
    entity_id: switch.wall_switch_left_158d00022363c5
#############

# Первый тест
  - delay: 00:00:30
  - service: script.turn_on
    entity_id: script.008_1

# Втрой тест
  - delay: 00:06:00
  - service: script.turn_on
    entity_id: script.008_2

  - wait_template: "{{ is_state('input_boolean.timer_is_over', 'on') }}"

# Третий тест
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d0003667bcb
    state: 'off'
    for:
      minutes: 7
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d00031b4772
    state: 'off'
    for:
      minutes: 7
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d000224aa83
    state: 'off'
    for:
      minutes: 7
  - condition: state
    entity_id: binary_sensor.motion_sensor_158d0002b5d946
    state: 'off'
    for:
      minutes: 7

  - service: media_player.volume_set
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      volume_level: 0.9
  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data:
      media_content_id: Включи радио максимум
      media_content_type: command

  - wait_template: "{{ is_state('binary_sensor.motion_sensor_158d00031b4772', 'on') }}"
    timeout: '00:10:00'
  - service: media_player.media_pause
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3



'010':
  alias: Say good morning at weekend
  sequence:
  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data_template:
      media_content_id: "Доброе утро. Сейчас {{states('sensor.time')}}. В Москве {{states('sensor.outdoor_temperature')|int}} градусов. Сегодня у вас выходной"
      media_content_type: text



'011':
  alias: Jolka lights
  sequence:
  - service: media_player.play_media
    data:
      entity_id: media_player.kabin
      media_content_id: https://****************:0000/local/sounds/new_year.mp3
      media_content_type: music

  - service: media_player.volume_mute
    data:
      is_volume_muted: true
    entity_id: media_player.televizor
  - delay: 0:0:6

  - service: scene.create
    data:
      scene_id: before
      snapshot_entities:
        - switch.wall_switch_left_158d00022363c5
        - switch.wall_switch_right_158d00022363c5
        - switch.wall_switch_158d000236aa6a
        - switch.wall_switch_left_158d000245c5ca
        - switch.wall_switch_right_158d000245c5ca
        - switch.wall_switch_158d0002ec4a59
  - service: switch.turn_off
    entity_id: group.all_real_lights
  - service: switch.turn_off
    entity_id: switch.wall_switch_158d0002ec4a59
  - delay: 0:0:1
  - service: switch.turn_on
    entity_id: switch.xiaomi_miio_switch # Это утюг, заменить на розетку под йолкой
  - data:
      entity_id: light.pre_hall_light
      effect: 'Slowdown'
    service: light.turn_on

  - delay: 0:0:31
  - service: media_player.media_stop
    entity_id: media_player.kabin

  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data_template:
      media_content_id: "С новым годом, {% set alias = {'Арго':'Арго́', 'Армен':'Армен', 'Гаяне':'Гайанэ́'} %}
      {% set people_home = states.person | selectattr('state','eq','home') | map(attribute='attributes.friendly_name') | list %}
      {% set ns = namespace(occupants = '') %}
      {% for i in people_home %}
        {% set ns.occupants = ns.occupants ~ '  ' ~ alias.get(i,i) if loop.index > 1 else alias.get(i,i) %}
      {% endfor %}
      {{ ns.occupants }}"
      media_content_type: text

  - delay: 0:0:3
  - service: media_player.volume_mute
    data:
      is_volume_muted: false
    entity_id: media_player.televizor
  - service: scene.turn_on
    data:
      entity_id: scene.before
  - service: light.turn_off
    entity_id: light.pre_hall_light



'012':
  alias: Wait and close cover for Argo
  mode: restart
  sequence:
  - wait_template: "{{ is_state('binary_sensor.motion_sensor_158d0002b5d946', 'on') }}"
  - service: cover.close_cover
    entity_id: cover.curtain_158d0002c54874



'013':
  alias: Online show demo
  sequence:
  - service: switch.turn_on
    entity_id: group.my_aquara_switches
  - delay: 00:00:01
  - entity_id: cover.curtain_158d0002c54874
    service: cover.open_cover
  - delay: 00:00:01

  - service: media_player.play_media
    entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
    data_template:
      media_content_id: "Доброго вечера. Сейчас {{states('sensor.time')}}. А это значит, что до конца эфира осталось примерно {{31 - states('sensor.time')[3:5]|int}} минут"
      media_content_type: text

  - delay: 00:00:05
  - wait_template: "{{ is_state('media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3', 'idle') }}"
  - service: switch.turn_off
    entity_id: group.my_aquara_switches
  - entity_id: cover.curtain_158d0002c54874
    service: cover.close_cover



'014':
  alias: TV on mute
  sequence:
  - service: media_player.volume_mute
    data:
      is_volume_muted: true
    entity_id: media_player.televizor
  - wait_template: "{{ is_state('binary_sensor.door_window_sensor_158d0001dcb0e3', 'on') }}"
    timeout: '00:10:00'
  - service: media_player.volume_mute
    entity_id: media_player.televizor
    data:
      is_volume_muted: false




'015':
  alias: Stepper step
  sequence:
  - service: input_number.set_value
    data:
      entity_id: input_number.stepper_control
      value: "{{states('input_number.stepper_control') | int + 100}}"



'016':
  alias: Think about Olesya
  sequence:
  - service: notify.mobile_app_iphone_olesia
    data:
      message: ":)"
      data:
        push:
          sound:
            name: Someone_is_thinking.wav


'017':
  alias: Critical notification from UI
  sequence:
  - choose:
      # IF morning
      - conditions:
          - condition: state
            entity_id: input_select.critical_messages
            state: "Арго"
        sequence:
          - service: notify.mobile_app_argo
            data:
              message: "{{states('input_text.critical_text')}}"
              title: 'До вас не дозвониться!'
              data:
                push:
                  sound:
                    name: default
                    critical: 1
                    volume: 1.0
      # ELIF day
      - conditions:
          - condition: state
            entity_id: input_select.critical_messages
            state: "Армену"
        sequence:
          - service: notify.mobile_app_iphonearm
            data:
              message: "{{states('input_text.critical_text')}}"
              title: 'До вас не дозвониться!'
              data:
                push:
                  sound:
                    name: default
                    critical: 1
                    volume: 1.0
      - conditions:
          - condition: state
            entity_id: input_select.critical_messages
            state: "Гаяне"
        sequence:
          - service: notify.mobile_app_iphonegay
            data:
              message: "{{states('input_text.critical_text')}}"
              title: 'До вас не дозвониться!'
              data:
                push:
                  sound:
                    name: default
                    critical: 1
                    volume: 1.0
      - conditions:
          - condition: state
            entity_id: input_select.critical_messages
            state: "Олесе"
        sequence:
          - service: notify.mobile_app_iphone_olesia
            data:
              message: "{{states('input_text.critical_text')}}"
              title: 'До вас не дозвониться!'
              data:
                push:
                  sound:
                    name: default
                    critical: 1
                    volume: 1.0


'018':
  alias: Armen leaved achan
  sequence:
  - delay: 00:03:00

  - condition: template
    value_template: "{{ is_state_attr('proximity.pre_home_armen', 'dir_of_travel', 'towards') or is_state_attr('proximity.pre_home_gayane', 'dir_of_travel', 'towards') }}"
  - service: notify.mobile_app_argo
    data:
      message: "Готовься помочь с вещами из Ашана"

  - wait_template: "{{ is_state('person.armen', 'home') or is_state('person.gayane', 'home')}}"
  - service: notify.mobile_app_argo
    data:
      message: "Пора помочь с пакетами из Ашана"



'019':
  alias: Feed motor
  sequence:
  - service: esphome.livingroom_feeding
  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 85
  # - delay:
  #     milliseconds: 1000
  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 113
  # - delay:
  #     milliseconds: 800

  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 85
  # - delay:
  #     milliseconds: 800
  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 113
  # - delay:
  #     milliseconds: 800

  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 85
  # - delay:
  #     milliseconds: 800
  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 113
  # - delay:
  #     milliseconds: 800

  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 85
  # - delay:
  #     milliseconds: 800
  # - service: esphome.livingroom_control_stepper
  #   data:
  #     target: 113




# '019':
#   alias: Звонок на станцию
#   mode: single
#   sequence:
#   - service: media_player.volume_set
#     data:
#       volume_level: 0
#     entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
#   - delay: '00:00:05'
#   - service: media_player.play_media
#     data:
#       media_content_id: Сними трубку
#       media_content_type: command
#     entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3
#   - delay: '00:00:01'
#   - service: media_player.volume_set
#     data:
#       volume_level: 0.5
#     entity_id: media_player.media_player.yandex_station_ff98f029c2f0f6f18388ddb3





Does this media player still exist in developer tools states?

Hm, it is unavailable in dev tools because I used old custom component and that version is not longer compatible with Home Assistant
How did you find that issue so fast?

If you look at the error messages it says there are missing entity ids in your scripts at sequence positions:

[0] (the first service call of a script)
[1] (the second service call of a script)

[11] (the twelfth service call of a script)

Fortunately you only have one script with 12 or more service calls. So I looked at the entity id of the 12th service call of that script.

1 Like

Got it, thanks a lot!

1 Like