Triggering Automations with Google Calendar Events via offset_reached

Hello all,

I’m new to Home Assistant, and trying to get my lights to power on 1h before a particular event in my google calendar. (Google Calendar Home Assistant Documentation link)

I’ve got it working to the point that I can get the lights to power on at the time the event starts - but I’m having trouble getting the automation to trigger prior to that.

I’m able to get “offset_reached” turned to true (checked in developer tools) by including !!-60 in the event title, but triggering offset_reached doesn’t actually run my automation - all that’s happening is the boolean changing.

I assume offset_reached exists precisely for this purpose, so I’m sure there’s something I’m missing here - does anybody have any idea what that would be?

I built the automation using the GUI builder under configuration > automations - here is the YAML from it:

 id: '1609573300523'
  alias: Turn the lights off based on calendar
  description: ''
  trigger:
  - platform: state
    entity_id: calendar.cal_work
    to: 'true'
    attribute: offset_reached
    from: 'false'
  condition: []
  action:
  - domain: light
    entity_id: light.bed_light_strip
    device_id: 249513d362e3d080d6e7a377b7e0131f
    type: turn_off

Here, it does specify going from ‘true’ to ‘false’, but I’ve also tried excluding the ‘from’ statement, just in case. Same thing - the boolean changes, but the automation does not run.

Also, the actual functionality of turning off the light in the script via the ‘Execute’ button on the automations dashboard works fine as well.

Thanks in advanced for any help!!

Figured it out… I had true and false in quotation marks, so it was looking for a string instead of a boolean :man_facepalming:t3: