I configured Google Calendar per the instructions, and the events being reported are inconsistent. I’m even just starting at the most basic configuration as outlined in the instructions
- cal_id: [email protected]
entities:
- device_id: nxxxxxgmailcom
name: Google Calendar
track: true
offset: "!!"
- device_id: test_everything
name: Give me everything
track: true
Currently my next event is showing up, but following that event (my calendar has numerous events all day, not overlapping and all in the same calendar (my google account doesn’t have multiple calendars outside of the built in holiday and contacts calendar), nothing shows up. Later in the day, the calendar may show a random event for the next day, but it doesn’t necessarily show up right away.
In short, it appears to show events at random, and refreshes at some random interval.
Calendar is a sensor. It’ll only reflect an on/off state and the info associated with the next item on the calendar. It’s not a method to browse your calendar, but to react when something happens.
When you create a device_id, typically you’ll want to specify a search to make it more meaningful. Otherwise, it’ll just be “on” when an event is happening, “on” otherwise and the attributes will reflect the current (if “on”) or next (if “off”) event’s info.
For instance, this sensor is on whenever the event name is “SCHOOL HOLIDAY” and presents as calendar.school_holiday.
- cal_id: xxxx
entities:
- device_id: school_holiday
name: School Holiday
search: SCHOOL HOLIDAY
track: true
If you want multiple sensors for a single calendar, this will work:
I understand that it’s a sensor, it’s just not returning the correct on/off state and associated info for the next time. Per the original post, it’s random.
For example, say my calendar has the following items every day:
Meeting 9:00AM-10:00AM
Kid’s Art Class 2:00PM-3:00PM
Yesterday before 9AM, the state was OFF, but when I click on the calendar sensor, it did state the next event was at 9AM called meeting. Then at 9AM, the sensor toggled ON . Great, that worked.
Now at 10:01AM, it toggled to OFF, which again, was correct. But when clicking on the calendar sensor, I would have expected the same behavior, seeing the next event and start time of Kids Art Class at 2pm, but it being off. Instead, there was nothing reported. Not even the following day’s 9AM meeting.
At some random time during the day, the 9AM meeting for the next day did show up as the next pending event, and it did toggle. Once again, afternoon event never toggled ON or showed up.
It appears to randomly recognize events in the calendar and toggle on only when said event “decides to be recognized”
Try checking the attributes of your sensors in the states dev tool and see if they’re better represented there. I’ve been using the calendar sensors for several things for a couple months and haven’t had any issues. I wonder if it’s that they don’t represent correctly in the UI. But typically, they’re used to power automations.
Was this issue ever identified? I’m having the same problem where the calendar sensor only shows the first even successfully, but other events following mysteriously aren’t there. The funny thing is when I use the lovelace card, it shows all the events without a problem.