I have an alarm setup that, upon being triggered, starts blinking some lights, producing noise and sending a notification. After updating this became sequential rather than parallel. The code looks as follows:
What used to happen in the past is that the noise making started, and while noise was being produced, the lights started flashing, etc. The various scripts were executed in parallel. This several months ago, when I implemented the thing.
Now, after several HA updates after which I didn’t retest the alarm system (so I don’t know which one exactly broke it), it turns out to first produce the noise and wait for that to completely finish. Then it goes and blinks the lights, waits for that to finish. Then it goes and notifies. Obviously this is not what it should do, but I’m at a loss as to what change has caused this behaviour. I’ve tried marking scripts as “mode: parallel” on the off chance that that’s somehow related (from HA 0.113 release), but that doesn’t achieve anything.
How do I get the automation to merely start each script, but not wait for it to finish before proceeding, the way it used to be before?
Hi, does the script calling another scripts via script.turn_on service need to wait for all the scripts called before terminating itself, or it may simply exit not caring about what the called scripts do and how they finished? (fire and forget mode)
Well, let me re-phrase my question. I understand the difference in the calling modes, just wonder if there is any risk for memory leaks or rule to close what was opened linke with “begin-async” / “end-async” or “using” clause known from C# or similar.
Best
Emil
I use Alarmo for my alarm system. I have 2 scripts that are executed if the alarm is triggered
Play a siren WAV file on 4 Sonos repeating in a loop until the alarm is disarmed
Flash all lights (about 30 individual lights) in the apartment in red until the alarm is disarmed.
It generally works and the lights flash and the sound plays in parallel but what I notice is that the sound “stutters” or is somehow choppy. Also the lights don’t flash right away but take quite some time to start flashing.
Also when I disarm it takes maybe 15 seconds until the sound stops and lights go out again.
It all seems very laggy as if HA is completely overwhelmed. I run HA on a Home Assistant Yellow with a Raspi 4 board.
I have given up doing this via Sonos. Never got it to work properly. Instead I am now using Alexa Media Player to play via my Alexas instead. But I have not gotten around to test it thoroughly for the alarm sounds. Overall playing any sounds or notifications on Alexa works much better than via Sonos