Getting Head around Google Calendar

After setting it up by

Make a add a New Calender
image

I created on Gas-heater (which come the sensor name)

I would give HA a reboot/restart
just so the new calender get added to the google_calendars.yaml file

go and create a event in that calendar you created

in the Message I put a # in message that Iet me know what HA will do something when it see it.
and i only set the for a 1 min

know the automation

is when the event get turn on and the condition is a message must have a #Gas-on
want to do some thing

- id: Google Calendar Gas on
  alias: Google Calendar gas on
  trigger:
    - platform: state
      entity_id: calendar.gas_heater
      to: 'on'
  condition:
    - condition: template
      value_template: "{{ is_state_attr('calendar.gas_heater','message','#Gas-on') }}"
  action:
    - data:
        entity_id: input_boolean.livingroom_climate
      service: input_boolean.turn_on

Dont forget to do the off side of the automation.

know I can have many events in that calendar and by changing the #??? in the condition
I can get to do differance things

now the lovelace bit
just add entities

image

now if you have the secondaryinfo-entity-row installed we give it a bit more lovelace

image

here the code

entities:
  - entity: calendar.gas_heater
    secondary_info: >-
      - Start time: [[ {entity}.attributes.start_time ]] <br> - Message: [[
      {entity}.attributes.message ]]
    type: 'custom:secondaryinfo-entity-row'
  - entity: automation.google_calendar_gas_on
title: Google Calendar
type: entities

Hope this turn the light on for someone

1 Like

Had a brain fart could I get read the #Gas-on and see the on and put that into the automation.

- id: Google Calendar Gas on off
  alias: Google Calendar gas on off
  trigger:
    - platform: state
      entity_id: calendar.gas_heater
      to: 'on'
  condition:
    - condition: template
      value_template: >-
        {% set lookfor = "#Gas" %}
        {% if state_attr('calendar.gas_heater','message').split('-')[0] == lookfor %}True{% else %}False{% endif %}
  action:
    - data:
        entity_id: input_boolean.livingroom_climate
      service_template: input_boolean.turn_{{ state_attr('calendar.gas_heater','message').split('-')[1] }}

now with one automation I turn on or off something

2 Likes

I am trying to set up Google Calendar, in HA, for the first time.

I tried to follow the instructions in Google Calendars - Home Assistant but after enabling the API (by clicking on Next), the Enable API has a check in front but nothing else happens and I don’t find where to do the following step ‘Go to credentials’.
Step by step guidance will be much appreciated !!!

I found this a bit of maystery, but I got there in the end, here’s how:

After enabling the API, click ‘google cloud’ at top LH corner - this link should include your project name, if not select your project.
Then for me it was in the Quick Access - click APIs & Services. If not there, click View all products, and APIs and Services is at the top in the Management section
Then you can click Credentials

After I’d done the consent and credentials I couldn’t add the integration into HA until I’d added my own gmail address as a test user in Oauth consent screen->Test Users. Suppose it might have been a coincidence of timing, not sure. Anyway it’s working now, just got to figure out how to use it.

Thanks so much. In fact, after several tries, I had figured it out. I am a ISY-Polisy user (Universal devices) where integrations are called nodeservers, which are much easier to integrate.However, their Google Holidays nodeserver has some bugs and I now finally start to understand how to usethe HA Google Calendar. It is powerful, but less simple than the one on ISY-Polisy.