Google Calendar Automation Help

Not sure if anyone can help, but I am super happy with my Calendar integration into my current Home Assistant, but I just think it would be really handy to replace google’s notifications (which dont always work) with my own push notifications. So … is it possible to set an automation that watches one of my calendars all the time, looking for example for a entry of Put Wheelie Bins Out, then send me a notification using my iphone notifications (that are currently working great for other automations).

Please advise/point me in the right direction.

You can start from here:

Yes

The simplest thing to do is to set up a search calendar, so that it tracks the thing you’re interested in. Then you can use the state and message of the calendar entity in the trigger.

For the notification, that’s just templating.

So if i set a new automation that looks like this;
trigger:
platform: state
entity_id: calendar.family
to: ‘on’

and add a condition of …

“{{is_state_attr(‘calendar.family’, ‘message’, ‘put wheelie bins out’) }}”

Then do my trigger should that work ? as i tried this (via the automation gui) and it didnt trigger when i added an item with a title of put wheelie bins out in the title.

Please read the sticky post and correctly format your post.

  alias: Test Calendar Alert
  trigger:
  - entity_id: calendar.family
    platform: state
    to: 'on'
  condition:
  - condition: template
    value_template: '"{{is_state_attr(''calendar.family'', ''message'', ''testing'')
      }}"'
  action:
  - data:
      message: event
    service: notify.ios_steves_iphone

That looks rather broken. I don’t know what you used to create it, but the random mix of quotes is going to cause you pain

value_template: "{{is_state_attr('calendar.family', 'message', 'testing') }}"

That will check for the entire message to be testing, just keep that in mind. You may want

value_template: "{{ 'testing' in state_attr('calendar.family', 'message') }}"
  alias: Test Calendar Alert
  trigger:
  - entity_id: calendar.family
    platform: state
    to: 'on'
  condition:
  - condition: template
    value_template: "{{ 'testing' in state_attr('calendar.family', 'message') }}"
  action:
  - data:
      message: event
    service: notify.ios_steves_iphone

Still not doing anything …

Test the template in the Templates menu, under Developer Tools

Check the state of the calendar.family entity in the States menu under Developer Tools

Check that the automation is turned on (also in the States menu)

Check that the automation’s action works by selecting the icon next to it in the States menu and pushing TRIGGER

tested in templates menu (just dropped `value_template: “{{ ‘testing’ in state_attr(‘calendar.family’, ‘message’) }}”) into it and it came up false ? is this searching the calendar title for testing - does the time of the event matter ?

Yes it will, but does the entity attribute message currently have testing in it?

my mistake, it came up true on the template test and the entity calendar.family has testing in it. So how often or what makes this state update ?

I have created a new calendar event in google, it shows on my snazzy atomic calendar but the calendar.family state still shows an old calendar entry ? so what triggers this to change ? I also got the notification part to push message to me. It seems to me that the trigger is not working ? what starts the trigger ? is it when the event starts ? state on ?

Its fully working now - and thank you so much for helping me to understand this.

Hey,
I am trying to get something similar working but cant seem to get it right:

alias: Blue Bin Day
description: ''
trigger:
  - platform: state
    entity_id: calendar.XXXXX
    to: 'on'
    attribute: message
condition:
  - condition: template
    value_template: '{{is_state_attr('calendar.XXXXX', 'message', 'test') }}'
action:
  - scene: scene.blue_bin
mode: single

I set a calander entry as test but nothing happens.
checked the template in developer tab, templates and it comes up false.

Am i missing something?

Well, if it doesn’t work, then that’s because the attribute isn’t exactly test

thanks for the reply. i have copied and pasted direct from the event name in google calendar. its as exact as it can be.