Hello community,
I’m new here, I’ve been playing with HA for a few days now and it’s been great
I’m really finding hard to find a reason why this configuration in automations.yaml would not work (some parts are hidden and replaced by “…”):
- alias: GoodMorning
trigger:
action:
- service: script.turn_on
data_template:
entity_id: script.say_something
variables:
message: |-
...
- condition: template
value_template: |-
{% set hour = states('sensor.time').split(':')[0] | int %}
{% hour >= 4 and hour < 10 %}
- delay:
seconds: 10
- wait_template: "{{ is_state('media_player.lounge', 'idle') or is_state('media_player.lounge', 'paused') }}"
timeout: '00:01:00'
- service: media_player.volume_set
data:
entity_id: media_player.lounge
volume_level: 0.7
- service: media_player.play_media
data_template:
entity_id: media_player.lounge
media_content_id: ...
media_content_type: music
From the logs:
mag 09 00:12:33 server hass[2738]: 2019-05-09 00:12:33 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: [condition] is an invalid option for [automation]. Check: automation->action->1->condition. (See /home/homeassistant/.homeassistant/automations.yaml, line 31). Please check the docs at https://home-assistant.io/components/automation/
The weird thing is if I put some simple condition like true
in value_template
it works (but of course it’s not what I want).
I’ve been fighting with this for an hour now… am I missing something? Docs says that in theory this could be done:
Thanks