Scheduling not being following from 01/01/2021
See original GitHub issueDescribe the bug
The collection pattern is every two weeks, beginning 14/12/2020 and running until 29/11/2021, with three exceptions during the year for bank holidays.
It should be 14/12/20, 28/12/20, 11/01/21, 25/01/21 and so on, every two weeks (apart from the bank holidays). No matter what changes I’ve tried it just keeps switching from 04/01/21 and I can’t work out what I’m doing wrong. I’ve rebooted multiple times, just in case that might help but no difference. Another user has the same issue, following the roll over to the new calendar year.
Configuration
Do you configure the integration in YAML or Config Flow (GUI)? : Config Flow
"entry_id": "eb511fc36fc9fa7b4e0fb65ac96d3fb6",
"version": 1,
"domain": "garbage_collection",
"title": "Green bin",
"data": {
"unique_id": "ca63892e-8f07-49d4-87e8-b108b1cff79c",
"frequency": "odd-weeks",
"icon_normal": "mdi:trash-can",
"icon_today": "mdi:delete-restore",
"icon_tomorrow": "mdi:delete-circle",
"verbose_format": "on {date}, in {days} days",
"date_format": "%d-%b-%Y",
"expire_after": "13:30",
"collection_days": [
"mon"
],
"first_month": "dec",
"last_month": "nov",
"holiday_move_offset": 0,
"observed": false,
"include_dates": [
"2021-04-03",
"2021-05-01",
"2021-05-29",
""
],
"exclude_dates": [
"2021-04-05",
"2021-05-03",
"2021-05-31",
""
],
"holiday_in_week_move": false
},
"options": {},
"system_options": {
"disable_new_entities": false
},
"source": "user",
"connection_class": "local_poll",
"unique_id": null
}
Error log/debug information
2020-12-14 10:22:49 INFO (MainThread) [homeassistant.setup] Setting up garbage_collection
2020-12-14 10:22:49 INFO (MainThread) [homeassistant.setup] Setup of domain garbage_collection took 0.0 seconds
2020-12-14 10:22:49 DEBUG (MainThread) [custom_components.garbage_collection] Setting Green bin (odd-weeks) from ConfigFlow
2020-12-14 10:22:49 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.garbage_collection
2020-12-14 10:22:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Calling update
2020-12-14 10:22:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2020-12-14)
2020-12-14 10:22:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Found next date: 14-Dec-2020, that is in 0 days
2020-12-14 10:22:49 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.garbage_collection entity: sensor.green_bin
2020-12-14 10:22:49 DEBUG (MainThread) [custom_components.garbage_collection.sensor] Creating garbage_collection calendar
2020-12-14 10:22:49 INFO (MainThread) [homeassistant.components.calendar] Setting up calendar.garbage_collection
2020-12-14 10:22:54 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2020-11-30)
2020-12-14 10:22:54 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2020-12-14)
2020-12-14 10:22:54 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2020-12-28)
2020-12-14 10:22:54 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2021-01-04)
2020-12-14 10:22:54 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2021-01-18)
2020-12-14 10:22:59 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2020-11-30)
2020-12-14 10:22:59 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2020-12-14)
2020-12-14 10:22:59 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2020-12-28)
2020-12-14 10:22:59 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2021-01-04)
2020-12-14 10:22:59 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Green bin) Next date candidate (2021-01-18)
Screenshots
Version
Integration version: 3.10
Home Assistant version: 2020.12.0
Hopefully I’ve done this properly and not missed anything, if you need any more information or for me to test things please let me know.
Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Ok, you are right. Every n weels works the same way as odd weeks, I forgot. Please use EVERY-N-DAYS. There you can set-up a starting date. And for 2 weeks select period 14 (14 days).
Thanks for the help, all sorted now. I’ll stick with
every-n-days
from now on, as that seemed to fit all scenarios.