I have a issue with Calendar based automations.
I have created the following "test" automation. where a action needs to happen based on the event in the Calendar.
In this test automation,
if "new year" triggers, it should turn OFF a light
If "april fools" triggers it should turn ON a light
alias: Calendar events
description: Calendar Event Based Automation
triggers:
- entity_id: calendar.heating_frontend
event: start
offset: "0:0:0"
id: cal1
trigger: calendar
conditions: []
actions:
- data:
message: >-
Event Summary: {{ trigger.event.summary }}, Event Name: {{
trigger.event.name }}
action: system_log.write
- choose:
- conditions:
- condition: trigger
id: cal1
- condition: or
conditions:
- condition: template
value_template: "{{ 'april fools' in (trigger.event.summary | lower) }}"
- condition: template
value_template: >-
{{ 'april fools' in (trigger.event.name | lower if
trigger.event.name is defined else '') }}
sequence:
- target:
entity_id: light.your_light_entity_id
action: light.turn_on
data: {}
- conditions:
- condition: trigger
id: cal1
- condition: or
conditions:
- condition: template
value_template: "{{ 'new year' in (trigger.event.summary | lower) }}"
- condition: template
value_template: >-
{{ 'new year' in (trigger.event.name | lower if
trigger.event.name is defined else '') }}
sequence:
- target:
entity_id: light.your_light_entity_id
action: light.turn_ff
data: {}
mode: single