Google Calendar - Work Shift Tracking - Automation

This is the first “complicated” thing I’ve attempted in Hassio so please take it easy on me! I work a rotating shift which is tracked in Google Calendar with all day events. I’d like to check for the value of my current shift event in GC to trigger automations.

I have GC set up and working in Hassio using the following config. I can see the calendar.workshift entity on the states page and it is tracking in History but the state is just either ON or OFF. I can not bring up this calendar entity in Node Red though.

- cal_id: [email protected]    
  entities:
  - device_id: workshift
    ignore_availability: true
    name: WorkShift
    search: '#Days'
    track: true
  - device_id: workshift
    ignore_availability: true
    name: WorkShift
    search: '#Afternoons'
    track: true
  - device_id: workshift
    ignore_availability: true
    name: WorkShift
    search: '#Midnights'
    track: true

Is there a way to check this once a day and set a value somewhere? Do I have to create a script to check my calendar every time I run an automation? How would I go about doing this?

I’m totally lost here. I can usually figure things out, but I don’t even know where to start with this. Anyone have any thoughts to get me started?

Can’t help you with the node red question but if you want to do something when the calendar turns on, it’s a simple trigger in your automation

 trigger:
    - platform: state
      entity_id: calendar.clocktalk_google_1
      to: "on"

I think you might have a problem with the entities you set up, they are all called workshift…change it to workDay, workAfternoons and workNights

Hope that helps you get a little further

2 Likes

Oh shoot. I misunderstood the multiple entity instructions on the Google Calendar Event page.

I thought I’d end up with one entity with 3 states. I see the whole binary thing now. Got it set up and the correct shift is set to on.

This should definitely get me started (although the calendar entities are still not in Node Red - anyone?). Anyway, thank you muchly for your help.