Skip to content
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

Simulate weekend days on public holidays #78

Open
wigster opened this issue Feb 9, 2023 · 2 comments
Open

Simulate weekend days on public holidays #78

wigster opened this issue Feb 9, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@wigster
Copy link

wigster commented Feb 9, 2023

This is a bit of an edge case, but...

Frequently we're away from home for an extended period when there is a public holiday during the vacation. It's a bit strange when e.g. on Xmas day which happens to be a Wednesday the lights follow a standard Wednesday schedule instead of a weekend one.

For this sort of thing I am using the binary sensors from the workday platform, where you can have a sensor saying that in your jurisdiction you have a holiday today or there will be one tomorrow.

It would be great if the presence simulator had an option to simulate particular days of the week depending on the status of whether today is a holiday or tomorrow is a holiday -- usually some combination of last week's Friday/Saturday/Sunday.

@wigster wigster changed the title Simulate weekend days on holidays Simulate weekend days on public holidays Feb 9, 2023
@slashback100 slashback100 added the enhancement New feature or request label Feb 9, 2023
@slashback100
Copy link
Owner

What I propose would be to add a parameter in the presence_simulation.start that would be the date (yyyy-mm-dd) to repeat, that way you can choose a weekday or a week-end day depending on what you want. Would that suit your need?

@wigster
Copy link
Author

wigster commented Mar 5, 2024

In principle this is fine for a one-off, but I think this could difficult to automate for a general set up. The fiducial case for me is a week's vacation with a public holiday say on Wednesday. Currently I flip the vacation mode on and presence_simulation runs with a delta of 7 days, taking care of weekdays/weekends correctly.

In the proposed solution, I would also have an automation which would check if today is a public holiday (I have a binary_sensor for that), I guess stop the running presence simulation and start a new one for the next 24 hours with the date parameter. The only way of automating that would I guess be a template which would pick the date of e,g, the previous Sunday, since a hard-coded date would not work in general.

Could you possibly do that calculation inside your integration, i.e. have a day of the week parameter, which would rerun the history of the last instance of some particular weekday? This would make automating easier for the end user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants