Deactivate all automations at once on second instance

Hi everyone,

this morning I got the crazy idea to just set up a second home assistant installation (ova on synology vmm) to do some prechecks before updating to a new home assistant version (e.g. verify UI is still looking good on the wall tablets).
So far so good, I managed to restore my latest nightly backup, update to 2022.11.1 and verify the new style indeed breaks my UI.
But thats another topic and i have already fixed it in the theme. My question to all you other guys:
How do you verify new versions? Just install and restore in case its horrible broken?

And back to the topic itself: I want to disable all automations on my update-test instance to prevent double executions. Doing it by hand is not an options, since there are a lot of them.
My idea so far: Use templating when calling the automation.turn_off service.
Current (not working) version:

service: automation.turn_off
data: {}
target:
  entity_id: {{ states.automation | selectattr('entity_id', 'defined') | selectattr('state')|map(attribute='entity_id')|list | join('`n - ') }}

Any ideas?

Thanks in advance

service: automation.turn_off
target:
  entity_id: "{{ states.automation | map(attribute='entity_id') | list }}"
1 Like

Thank you, it is working :slight_smile:
Wasn’t so far off then

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.

I have a docker install which makes it relatively simple.
With each upgrade, I copy the config folder to my ‘upgrade’ folder, reset some stuff to have it run on a different port, copy the db (mariadb) and then start with the new version. Downside is that usb and rfxtrx donot work as connected to the main install but that is minimal (for me). Then I look at errors, compare some key dashboard things (only some are important), I try to connect to some devices and let it run a while…checking logs.

On your main question: until now I did not check any automations and had no issues with running double…but you have a point that this may indeed collide.
\ @Taras : thanks!

@123 I forgot, solution checkmark should now be there - thank you.
@vingerha seems to be a similar approach - I think i will just clone my hassos vm the next time and disable all automations on start before upgrading. This should be a little faster than restoring from backup.