Every-n-days not skipping weekends
See original GitHub issueDescribe the bug
My rubbish and recycling schedule is every 8 days and it skips the weekend (Only collected Monday to Friday). I have it configured as every-n-days with the period = 8 and collection days also set, however, it’s currently showing the next collection day as Saturday
Configuration
Do you configure the integration in YAML or Config Flow (GUI)? : YAML
garbage_collection:
sensors:
- name: "Rubbish"
frequency: "every-n-days"
first_date: "2021-01-07"
period: 8
collection_days:
- "mon"
- "tue"
- "wed"
- "thu"
- "fri"
verbose_state: true
date_format: "%a %-d"
verbose_format: "on {date} (in {days} days)"
holiday_in_week_move: true
holiday_move_offset: 1
move_country_holidays: CA
prov: ON
expire_after: "13:00"
- name: "Recycling"
frequency: "every-n-days"
first_date: "2021-01-07"
period: 8
collection_days:
- "mon"
- "tue"
- "wed"
- "thu"
- "fri"
verbose_state: true
date_format: "%a %-d"
verbose_format: "on {date} (in {days} days)"
holiday_in_week_move: true
holiday_move_offset: 1
move_country_holidays: CA
prov: ON
expire_after: "13:00"
Error log/debug information
There are no errors
2021-01-17 22:07:21 DEBUG (MainThread) [custom_components.garbage_collection] Setting Rubbish(every-n-days) from YAML configuration
2021-01-17 22:07:21 DEBUG (MainThread) [custom_components.garbage_collection] Setting Recycling(every-n-days) from YAML configuration
2021-01-17 22:07:22 INFO (MainThread) [custom_components.garbage_collection] Successfully removed sensor from the garbage_collection integration
2021-01-17 22:07:22 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Rubbish) Calling update
2021-01-17 22:07:22 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Recycling) Calling update
2021-01-17 22:07:22 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Rubbish) Country Holidays with parameters: country: CA, prov: True, state: None, observed: True
2021-01-17 22:07:22 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Rubbish) Found these holidays:
2020-01-01: New Year's Day
2020-04-10: Good Friday
2020-05-18: Victoria Day
2020-07-01: Canada Day
2020-09-07: Labour Day
2020-10-12: Thanksgiving
2020-11-11: Remembrance Day
2020-12-25: Christmas Day
2020-12-28: Boxing Day (Observed)
2021-01-01: New Year's Day
2021-12-31: New Year's Day (Observed)
2021-04-02: Good Friday
2021-05-24: Victoria Day
2021-07-01: Canada Day
2021-09-06: Labour Day
2021-10-11: Thanksgiving
2021-11-11: Remembrance Day
2021-12-25: Christmas Day
2021-12-24: Christmas Day (Observed)
2021-12-27: Boxing Day (Observed)
2022-01-01: New Year's Day
2022-04-15: Good Friday
2022-05-23: Victoria Day
2022-07-01: Canada Day
2022-09-05: Labour Day
2022-10-10: Thanksgiving
2022-11-11: Remembrance Day
2022-12-25: Christmas Day
2022-12-26: Christmas Day (Observed)
2022-12-27: Boxing Day (Observed)
2021-01-17 22:07:22 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Recycling) Country Holidays with parameters: country: CA, prov: True, state: None, observed: True
2021-01-17 22:07:22 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Recycling) Found these holidays:
2020-01-01: New Year's Day
2020-04-10: Good Friday
2020-05-18: Victoria Day
2020-07-01: Canada Day
2020-09-07: Labour Day
2020-10-12: Thanksgiving
2020-11-11: Remembrance Day
2020-12-25: Christmas Day
2020-12-28: Boxing Day (Observed)
2021-01-01: New Year's Day
2021-12-31: New Year's Day (Observed)
2021-04-02: Good Friday
2021-05-24: Victoria Day
2021-07-01: Canada Day
2021-09-06: Labour Day
2021-10-11: Thanksgiving
2021-11-11: Remembrance Day
2021-12-25: Christmas Day
2021-12-24: Christmas Day (Observed)
2021-12-27: Boxing Day (Observed)
2022-01-01: New Year's Day
2022-04-15: Good Friday
2022-05-23: Victoria Day
2022-07-01: Canada Day
2022-09-05: Labour Day
2022-10-10: Thanksgiving
2022-11-11: Remembrance Day
2022-12-25: Christmas Day
2022-12-26: Christmas Day (Observed)
2022-12-27: Boxing Day (Observed)
2021-01-17 22:07:23 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Rubbish) Found next date: Sat 23, that is in 6 days
2021-01-17 22:07:23 DEBUG (MainThread) [custom_components.garbage_collection.sensor] (Recycling) Found next date: Sat 23, that is in 6 days
2021-01-17 22:07:23 DEBUG (MainThread) [custom_components.garbage_collection.sensor] Creating garbage_collection calendar
Screenshots
Version
Integration version: 3.15
Home Assistant version: 2021.1.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to skip specific days? : r/todoist - Reddit
My personal "weekends" fall on Tuesdays and Wednesdays and would like some tasks to skip those days. However, typing "everyday except ...
Read more >Solved: Exclude weekends in scheduled cloud flow
I have a scheduled cloud flow that posts a message in Teams group chat once everyday (see below) but would like to exclude...
Read more >11 Smart Weekday Habits that Lead to Relaxing Weekends
11 Easy Weekday Habits That Let You Be Lazy on the Weekends · 1. Follow the 10/30 rule. · 2. Adopt a 20-minute...
Read more >When everyday is seemingly the same, what ... - Quora
Seriously, I need one day—let it be Sunday—that is not adjacent to a weekday. The two day weekend is a tease. When I...
Read more >Excel WORKDAY & NETWORKDAYS Functions - XelPlus
Excel's workday function is great when you need to calculate an end date based on a given number of working days – which...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is a correct behaviour. If there is a collection on Friday, in 8 days it will be Saturday. The collection days parameter is not a filter, it is a trigger used for weekly periods. The documentation says it can be used for anything but annual, in fact it does nothing for every n days as well, I will correct that.
Will be made possible by #287