#Stop a schedule
1 messages · Page 1 of 1 (latest)
that's not something that exists
Just in schedule - not supported
You could do it with a button helper and a binary template sensor though - something like (excuse the pseudo code) schedule is on AND button.date != today.date will be on unless you pressed that button today
Damn that's annoying. There's no way to programmatically change the schedule ? With a python script for example ?
But in reality, this is a XY problem. A schedule only indicates a time frame. It has no link to an action other then you make via an automation. So in that automation you can include other parameters.
Okay but I'd rather not edit all the automations relying on this schedule if I can just edit the schedule. This centralizes & linearises input, which makes automations easier to think about
OK. But you can't do that. All schedules do is give you a scheduled on/off weekly signal, with optional attributes. Anything you want to do more than that will require something else.
For example I think you can do this with both the scheduler and schedule_state integrations, or you can make a sensor within home assistant with some helpers/groups that incorporates the schedule you already have as an input as well as additional logic
Basically, for that you're now just one step to late. A schedule is just a simple building block. Select a weekly pattern and get a true or false. That's what keeps things organized, blocks with a clear task.
If you want more, it's up to you to make that next layer. As that's already combining multiple aspects. You could make a input_boolean and toggle that (with an automation) based on the schedule. And make that handle the "cancel". Heck, you can even make that into a trigger based template sensor nowadays.
Or ask yourself, if you want multiple things to act the same on something, why isn't it a single automation then?
Al in all, plenty of ways to solve the issue, but splitting up the problem is up to you. In the end, the answer to problem solving is to split a problem up in smaller problems. Not to over complicate that single issue and expect there to be a magical complicated blob for your specific problem 🙂 Maybe there is, and somebody made it. But in my experience, that rarely ever tricks all the boxes. And HA give you the freedom to build it yourself.
It's not just a thing that stores an ON/OFF, since whenever you edit it it will trigger any automations thag rely on it if the edit changes the current state.
In any case I've made the feature request on github. I've checked the doc and the schedule can be explicitely stored in yaml and there is a reload function in addition to manual editing. Everything is already there, it's only missing a way of programmatically trigger the same code the UI does.
Which I find strange that HA wasn't built with all such functions accessible, but I digress.