strange one here, I have a google calendar that I use to record my work shifts. I have an automation that runs to check if I am on an Early shift and will then turn on some lights.
What I have noticed that the last few days it has been telling me I am on an early shift. I have no entries in my calendar as I am on my rest days, and my next shift is an early one and is in 2 days time. So it appears that it is reading my calendar until it finds an entry and then does the comparison.
Is this normal behaviour? Am I doing something wrong?
You removed the start_time condition which tells you when the event is starting. So removing that condition was unwise as it verified that the start of the event is occurring “today”
Sorry, I’m probably being stupid here . I understand what you mean about a condition that verifies the event is occurring today, but not sure how that is put into the automation.
This is what I have
- id: '1633198910437'
alias: Test - Calendar Event Check
description: ''
trigger:
- platform: time
at: 06:00
condition:
- condition: state
entity_id: calendar.myshifts
state: Earlies
attribute: message
action:
- service: script.broadcast_onlyme
data:
title: Test Notification
message: Testing new calendar event check - {{now().strftime('%H:%M')}}
oh ok. Yes that is working. But that method means creating a sensor for that particular event in my calendar, which isn’t a problem. However I read up that a simpler way of doing this was to use the method I changed to because then I search for anything and use it for other purposes with my calendar.
hi petro,
So as above, in the google_calendars.yaml I had to add the entries listed in order to search to. It might be that I am using the wrong terminology.
In order to search for my early shift, I use the value_template mentioned above.
That is why I was trying to use the state condition as it appears you don’t need to add any additional yaml.