Greetings colleagues, I have some kind of automation, with several triggers, when the first trigger is executed, three services are called, but if the opening of the gate is the first trigger, then only one(first) of the three services is executed, help me find the error
but if I set the switch instead of the first trigger, everything works fine, all three services are called properly, and if I set the gate opening trigger again, then only the first service out of three works
- id: '12345678'
alias: 'automation1'
description: ''
trigger:
- platform: state
entity_id: cover.vorota
to: 'opening'
id: open
- platform: state
entity_id: binary_sensor.gerkon_close
to: 'on'
id: alarm
for:
hours: 0
minutes: "{{ states('input_number.time_gate_alarm') | int }}"
seconds: 0
- platform: state
entity_id: binary_sensor.gerkon_close
to: 'on'
id: radio_remote
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: open
sequence:
- service: media_player.play_media
entity_id: media_player.yandex_station_lp0000000000001158540000ab255d6c
data:
media_content_id: |
{% if trigger.to_state.context.user_id == 'mother' %}
mom opened the gate
{% elif trigger.to_state.context.user_id == 'father' %}
dad opened the gate
{% elif trigger.to_state.context.user_id == 'brother' %}
brother opened the gate
{% endif %}
media_content_type: dialog
# condition, if I opened the gate - do not send a notification
- condition: template
value_template: ' {{ trigger.to_state.context.user_id != "i'm" }} '
- service: notify.my_mobile
data:
message: |
{% if trigger.to_state.context.user_id == 'mother' %}
mom opened the gate
{% elif trigger.to_state.context.user_id == 'father' %}
dad opened the gate
{% elif trigger.to_state.context.user_id == 'brother' %}
brother opened the gate
{% endif %}
data:
sticky: "true"
- service: other service
data:
message: "TTS"
title: |
{% if trigger.to_state.context.user_id == 'mother' %}
mom opened the gate
{% elif trigger.to_state.context.user_id == 'father' %}
dad opened the gate
{% elif trigger.to_state.context.user_id == 'brother' %}
brother opened the gate
{% endif %}
- conditions:
- condition: trigger
id: alarm
sequence:
- service: other service
- service: other service
- conditions:
- condition: trigger
id: radio_remote
sequence:
- service: other service
- service: other service
default: []
mode: restart