Hello again!
Sorry to bother you, but I’m having some difficulties using automation.
I would like to trigger multiple actions inside a “service_template”, is that possible?
This is my YAML:
- alias: Garagem MuvRH
trigger:
- platform: state
entity_id: input_boolean.entrar_muvrh
from: 'off'
to: 'on'
- platform: state
entity_id: input_boolean.sair_muvrh
from: 'off'
to: 'on'
action:
- service_template: >
{% if is_state('input_boolean.entrar_muvrh', 'on') %}
script.garagem_muvrh_rua
- delay: 00:00:02
- service: script.garagem_muvrh_interno
- delay: 00:00:10
- service: script.garagem_muvrh_rua
- delay: 00:00:05
- service: script.garagem_muvrh_interno
- service: input_boolean.turn_off
entity_id: input_boolean.entrar_muvrh
{% elif is_state('input_boolean.sair_muvrh', 'on') %}
script.garagem_muvrh_interno
- delay: 00:00:02
- service: script.garagem_muvrh_rua
- delay: 00:00:10
- service: script.garagem_muvrh_interno
- delay: 00:00:05
- service: script.garagem_muvrh_rua
- service: input_boolean.turn_off
entity_id: input_boolean.sair_muvrh
{% endif %}
I get this error on the logs:
2017-08-25 11:06:05 ERROR (MainThread) [homeassistant.helpers.service] Template rendered invalid service: script.garagem_muvrh_interno
- delay: 00:00:02 - service: script.garagem_muvrh_rua - delay: 00:00:10 - service: script.garagem_muvrh_interno - delay: 00:00:05 - service: script.garagem_muvrh_rua - service: input_boolean.turn_off
entity_id: input_boolean.sair_muvrh
Basiccly this is an automation to trigger when I switch a specific template boolean and the automation analyses which one is triggered and perform a multiple actions (IFS).
Can someone help me?
Thanks a lot folks!