WTH I can’t test the trigger of the automation?

When building an automation with many triggers I would like to simulate / test how it runs on specific trigger to see how the automation will flow through multiple “choose”.
Now I have to go to Developer tools, find the entity and change it’s value so the trigger in automation is evaluated and starts the automation. But that can trigger also other automations which I don’t want and also it’s recorded to history. And it’s time consuming because on phone in the app (which is where I love to create automations) I can’t open a new tab, but I have to navigate there and back.

It would be nice to test the trigger of automation: the value for the test would be calculated so trigger is “true” but this value would not be recorded so it doesn’r trigger other automation but I would be able to see the trace of an automation.

Thanks!

An option to execute the trigger, as exists for full automation and for each action, I think would fit well and solve this (I also go through this and every time I think how can this not exist).

1 Like

This may be slightly trickier than it sounds, because trigger types can introduce variables, and the trigger setup does not always fully constrain the values. For example a state trigger that fires when one of several entities change, requires you to specify which entity. Triggering from home assistant internal events may require specify the event body, etc.

That does not make this infeasible, but does make it more effort to implement.

And of course, it is entirely possible the body of the automation not not behave as expected if entities don’t have the expected states. I have some automations where faking triggers like that would not work as expected.

This is likely a lot harder than it sounds and quite possibly might not work at all from some trigger types. If the primary intent is just for testing automations I would suggest something I’ve found useful. Add testing helpers (I’ve used input_boolean, input_number, & counter for this) and then added an additional trigger that uses your test helper. Then set the helper to a state that will trigger. After testing I set that trigger to disabled, so it’s available for future testing, and then it’s helper can be reused for testing other automations without triggering all the automations where it may have been used.