Schedule (Nest) temperature by Google Calendar

I was used to control my heating via “scheduler” in Nest app. HA has no such interface, but it integrates smoothly with Google Calendar, which is far more better. Now I can have daily tasks and home automation triggers in one app.

1.) You will need Google Calendar Event configured. I recommend to create new calendar just for home assistant.

# Used for Google Calendar
google:
  client_id: !secret google_id
  client_secret: !secret google_secret

2.) Then in google_calendars.yaml select some keyword which will trigger automation. You will use this keyword (#heat) in title of events.

- cal_id: <your_calendar_id>@group.calendar.google.com
  entities:
  - device_id: thermostat
    name: Thermostat
    track: true
    search: "#heat"

3.) Create automation (automation.yaml) and events in calendar. Event title starts with desired temperature (e.g. 21.5) followed by space and trigger word. Keep in mind that new events will be propagated to HA after about 15min.

- action:
  - data_template:
      temperature: '{{ states.calendar.thermostat.attributes.message | replace(" #heat","") | float}}'
      entity_id: climate.living_room
    service: climate.set_temperature
  alias: Temperature by calendar
  condition: []
  id: temperature_by_calendar
  trigger:
  - entity_id: calendar.thermostat
    from: 'off'
    platform: state
    to: 'on'

5 Likes

Thanks. I was thinking about this too but in the end decided that it would be too much maintenance and defaulted to the schedule on the Nest app, but use the following 2 “features”:

  1. Use my google calendar to schedule holidays (and therefore set the nest to off or leaf)
  2. Use device tracker to override the leaf based on presence at home

Thanks for sharing though

Thats pretty cool, any way to have which schedules are ON on HASS?

There is entity called calendar.thermostat (see step 3) with state ON / OFF.