-
-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recollect Waste integration calendar entity not functioning? #92652
Comments
Hey there @bachya, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) recollect_waste documentation |
ReCollect Waste only gives us pickup dates, not times. Therefore, the integration creates all-day events that start at midnight on the pickup date and end at midnight the next day. So, I don't think the integration is doing anything strange. @allenporter is the calendar guru, so I'll tag him in—do you notice ReCollect doing something it shouldn't? |
Just sharing some early thoughts as I read the code, but may look closer.... Potential track to explore 1: The challenge with calendar entities is that they have two separate responsibilities making it hard to use update coordinators:
The problem with a simple data coordinator entity is that it combines these two concepts of fetching the agenda and updating state for the next event into one operation. As a result you have to:
If this is the issue here, perhaps we can take learnings from what you have to change and update the developer docs since i think this would be common for any cloud based calendar. I'd love to somehow separate the concept of "Calendar Entity" from "Event Entity" to resolve this, but boy would that be a big breaking change. Potential track to explore 2: I notice in async_get_events that it is not looking at the start / end date range. This probably usually works ok given the start date is >= today from the update coordinator. However, the trigger may assume that the calendar is actually doing filtering based on the start/end date ranges. In #89918 I was attempting to fix bugs with triggers where it might drop events in certain cases. Now I believe it should never drop an event, but may trigger later if an event is returned outside the window requested. This could also just interact with track 1 and not need any special handling. One thing I did in rainbird calendar since its generating synthetic events on the fly form a schedule is just report back 2 weeks of events so there is something to see in the calendar UI. You could consider a change like that and then adding filtering in the "next event" case and the "get events in a range" case. |
That's what I expected but that's not the behaviour I'm seeing. In my case the calendar entity didn't go into an "on" state until approximately May 4 6:30PM, the day of the collection, not 12AM. It then toggled off at May 5 6:30PM. So it's definitely staying on for 24 hours...but it's coming on around eighteen and half hours after it's supposed to? |
It would probably work if you started home assistant around midnight given what I said above about the refresh cycles. |
That makes great sense, @allenporter—I never stopped to consider that ReCollect's single coordinator would only update the calendar entity's state every so often (as you point out, every 1 day) and cause drift. I'll chew on having the calendar entity poll more regularly. |
@bachya Caldav, Google Calendar, etc all do this fwiw. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
The problem
My understanding of the behaviour of this integration is that the calendar entity (calendar.recollect_waste) should toggle on the day of scheduled pickup.
For instance, my scheduled collection was Thursday, May 4, 2023 (sensor.recollect_waste_current_pickup). But the calendar.recollect_waste entity didn't toggle on until 6:30PM the day of the collection which way past the typical morning/afternoon pickup time.
I have an automation that triggers on toggle of the calendar.recollect_waste event plus an offset of a few hours. But that automation never triggers because the calendar.recollect_waste entity doesn't trigger when expected.
Am I misunderstanding the behaviour of the calendar.recollect_waste entity or is there something broken with it?
What version of Home Assistant Core has the issue?
core-2023.4.6
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
Recollect Waste
Link to integration documentation on our website
https://www.home-assistant.io/integrations/recollect_waste/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: