Automation to add an event to a Google calendar based on a weather alert
xlcnd opened this issue · comments
- alias: Add an event to a Google calendar based on a weather alert
trigger:
- platform: state
entity_id: binary_sensor.meteoalarmeu
attribute: message_id
action:
- service: google.add_event
data:
calendar_id: YOURCALENDARID@group.calendar.google.com
summary: >
METEOALARM-{{ state_attr('binary_sensor.meteoalarmeu', 'awareness_type') }}-{{ state_attr('binary_sensor.meteoalarmeu', 'awareness_level') }}-{{ state_attr('binary_sensor.meteoalarmeu', 'alert_id') }}
description: >
{{ state_attr('binary_sensor.meteoalarmeu', 'message') }}
start_date_time: >
{{ state_attr('binary_sensor.meteoalarmeu', 'from') }}:00
end_date_time: >
{{ state_attr('binary_sensor.meteoalarmeu', 'until') }}:00
Please, don't forget to replace YOURCALENDARID
!