I have a sunscreen with 2 automations one for open and one for close with a cover stop command after a time delay. In the condition it checks if the screen is already open (or closed).
Then I have a glance card, with 2 buttons, that trigger these automation. When I push the close sunscreen button when the screen is already closed it still runs the action of the automatio and starts the screens motor.
Would be great if the automation always checked the condition (or make it an option, just run the action or run the complete automation, including condition check).
A script is a sequence of actions: do this and that.
An automation is a script but with triggers and conditions: do this and that only when something happens.
When you use automation.trigger to execute an automation, it skips the automation’s trigger and conditions and just runs the action. So, in effect, you’re using it like a traditional script.
If you regularly need to skip an automation’s trigger and action then it probably should exist as a script, not an automation (I believe that was Tinkerer’s point).
are you saying this skip_condition is something for regular HA backend automations? Ive always seen that as a dev tool, used when we trigger automation in the service page, to either skip or not skip the condition block?
Surely this is not an automation option we can set in the automation itself? Although Rutger shows that in his topic title (manually) the way he describes his quest might point to regular automations in action…
btw, since it is only available in the dev service page, it might be better if that could be selected with a toggle, (and not as an optional automation parameter) to prevent any misunderstanding about the service in the first place.
So yeah WTH, please give us a skip_condition toggle!
Yes it is a regular automation in action. I only wanted to check the condition, but he didn’t at first.
Not only in the dev page.
The service call from the glance card:
tap_action:
action: call-service
service: automation.trigger
service_data:
entity_id: automation.covers_open_sunscreen
skip_condition: false <-- Without this line it just run the action, but now whit this line it checks the condition :)
Apparently you can also build a script with a condition check, but I don’t see the adventage of that right now
That’s very important indeed. Imagine an automation that sets a framework of actions which depending on several conditions need to be executed or not. If a condition would evaluate to false, the automation would stop there.
Not so using scripts (in an automation). Simply move the condition over to the script and the automation will continue to call its other services, while the script handles the condition.
I use the “execute” link with an automation often to check if I didn’t make any mistakes with the automation. So wouldn’t it be nice to have another link there “execute with conditions”?
hmm, that would be a tricky one. toggling conditions in the backend during realtime operation?
Cant imagine the dev’s to agree on that, what would be the use case for that, given the fact this can now be done in the dev service page.
Maybe just separate “Trigger automation” that just simulates its triggering with evaluation all conditions. Also would be cool to somehow show what conditions matched and what not. And then add “Run actions” that doesn’t check conditions and just runs all actions.
Edit: For complex action lists, it is better to write all actions under a script: and then just call this script from automation. And this script can be added also to UI and executed from there. Still would be helpful to see condition evaluation for debugging purposes (in log?)
Personally, I don’t think people should even be offered the convenience of triggering an automation from the more-info card. If there’s a burning need to manually trigger an automation (and there shouldn’t be), use Developer Tools > Services > automation.trigger (where skip_condition already exists) … and where admin-level account privileges are required.
If there’s a constant need to manually trigger automations, it probably should exist as a script.
It’s not a constant need. It’s a need when developing, for me at least. Just to check if your newly added automation works as it should. And if I have problems with creating an automation it could be I want to trigger it about a honderd times in an hour.