I have an automation set up that runs at 5:00 as soon as I get off work. Today I got off early at 3:30. When I got off I disabled the automation so it wouldn’t run at 5, but that got me thinking that I’ll have to remember to enable it again before Monday. So that got me thinking there should probably be a way to tell Home Assistant to just skip it 1 time instead of completely disabling it and having to manually enable it again later. Any suggestions would be much appreciated.
Button: action
call-service “Automation: Turn off” (mygetoffwork.automation.entity)
Automation: at monday 00.01am
call-service “Automation: Turn on” (mygetoffwork.automation.entity)
Or also start a “timer” after(at) initial “Automation: Turn off” ( so atleast it doesn’t turn on again to early )
Thanks. I’m looking at those services now
In developer tools, you can check it instantly, that it work calling the automation:turn off
Automating the enabling and disabling of other automations is generally not recommended. Having the option to manually disable automations without having them randomly turn back on can be helpful when refactoring and debugging. Instead, you should add conditional logic to your automation so that it doesn’t allow the actions to be executed when you don’t want/need them to be. There are numerous method to do that depending on how you want things to work.
Some options include:
- Have an input boolean helper that you turn on and off and is automatically reset everyday.
- Use an input button helper and templating to limit the automation to days when you haven’t pressed the button.
Personally i haven’t looked into the “helper” section yet , or ever used “input booleans / buttons” either , so instantly this sounds “complicated” to me, but might not be, if i took the time to look/search about these advises. I do however understand your first statement , that “automating start of automations” generally is not recommended , it was just my instant lazy mind which responded
However a button that calls a service to “stop an automation” , i believe is within the core-functionality, as these services exist “Automation: Turn on” “Automation: Turn off”
Edit: i actually do think that it’s quite common to have an automation which checks whether “something” is running or not, and if not “start it” , and having such “scheduled” to i.e 00.00.01 is also quite common
I.E ( if is_state automation.my_afterwork_escuses.entity “off” … call_service … (native)automation.turn_on
I’ve done something similar…an input boolean as a condition on the automation to run it, or stop it…default is ‘true’. I can set it to false and then I use the Scheduler to reset it daily at an appropriate time.
So you need a condition that the automation does not run when you are already home?
Or not at work?
Either way that is a simple person condition
No, I work from home
In that case I would agree with the boolean idea.
I would also change the automation to have two branches one being if boolean is off then do whatever should be done, then the other branch is when boolean is on, then turn it off.
That way the automation is self contained and controls itself and it will be easy to find how and why things work as they do in months when you forgot all.
These are all really good ideas. I’m going to have to do a little playing with it and trsting some of those before I’ll know exactly which way to go. I’m also wondering if i