This is surely common knowledge for some of you but I thought I’d share a story, as this just made me cringe

I never understood the point in the option to “run actions in parallel” I thought if I had a list of actions to complete, HA makes it through them almost instantly, and with the varying latency of each action they wouldn’t complete at the same time anyways.

Then I tested my smoke alarm notification that I have had running for over a year.

It went-

If: list of smoke alarms detects smoke Then: Turn on the lamp next to my bed, then Send a notification to my phone.

I had made an error when setting up the lamp entity. (I made it full brightness on both scales, can only use one) this stopped the automation before the notification went out to my phone.

If it’s important that the automation makes it to the end, run in parallel!

Talk about a false sense of security

      • unknowing8343@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        6 months ago

        Let’s say you have 2 scripts that do some stuff:

        • script A: turns a light pink for 20 seconds and then through a smart speaker you can hear 30 seconds of La Macarena.
        • script B: send 25 notifications to your phone, spaced by 30 seconds, in which each notification is a different letter of an encrypted message.

        If you want those things to happen independently you must parallelize them.

        So think about an automation that at a certain point you want to launch multiple scripts. I’d always parallelize, even if initially these scripts were “instantaneous”, because you might change these and add more complexities in the future.