I’m trying to pre-condition my wifes car automatically if the Google Calendar has an event that says she has work. It should run 20 minutes before the shift starts.
I’ve tried creating this automation just to get anything to trigger of the work event “JBM Vagt” is in the calendar:
- id: '1645084866659'
alias: Test Calendar
description: ''
trigger:
- platform: state
entity_id: xx_gmail_com
attribute: message
to: JBM Vagt
condition:
- condition: state
entity_id: person.josefine
state: home
- condition: state
entity_id: device_tracker.escape_pod_1_location_tracker
state: home
action:
- device_id: ff5578aca08bdc5d61c5a89dc850aac8
domain: mobile_app
type: notify
message: Josefine skal på arbejde.
mode: single
This does not trigger even tho the event is present.
It looks to me that the all day event is going to cause your one calendar entity to be on all day and with the same message attribute.
You can set up as many calendar sensors as you want and this may be more beneficial.
For me I have regular recurring events so have set individual sensors for each of those.
But in any case the calendar can only have a state of on or off so this would be your trigger, but you can add the condition of the individual message, but maybe I guess not if you have an all day event with a different message
Take a look at Jeff Stone’s recent video… the key to making the Google calendar integration work with all day events is adding tags to messages and setting up a calendar sensor for each tag.