I would presume that every instruction is run in sequence. But it is not the case. For example if i have an instruction to set volume to x value, but wihout the wait instruction the speaker plays the music before the volume is set.
I can work with wait instruction but at the end that is not reliable.
Can't you just specify what volume you want to use in that part of the rule? You could also edit your MP3 (alarm_tone) to include a voice message. That would make for a much less complicated rule.
I've managed to make it work with a global "rule running" variable that i set to false in another rule.
And no, it does not work if i set the volume and play the mp3. The file is played before the volume is properly set.
Also in the rule i capture the initial volume and restore it at the end.
Regarding rule machine, maybe it is a good ideea to change it to that mode.
That was the first thing i've tried. The obvious choice,
It just would not run as expected,
If i use speak on with volume at 70 only the text is played at that volume. The mp3 alarm file is played at initial volume even thought the instruction is ran later.
Setting an attribute with a Wait for Event on that attribute immediately after often fails due to timing issues. You can prevent that by adding a short delay (2 seconds?) to the Set Volume action so the wait has time to set up before the event is generated.
Also consider using Wait for Expression instead of Wait for Event, in case an event is not generated (e.g. the volume is already set to 70).
For the setVolume actions, good idea, however, you seem to have removed the timeout for the wait, was that intentional?
Again I recommend adding a delay on the setVolume command. Donāt add a new action, just set this parameter on the existing setVolume action.
For the status = stopped wait, the wait for event was probably better. There is no risk of a timing issue and you actually want a new event to complete the wait.
I've seen some situations where RM (or certain commands) can "queue up" some things. Until there's a lull in activity on the hub, those things can be deferred past where you'd expect. This can be an issue when you are setting things for other rules (e.g., PB, variables, etc.) if the hub is busy. When you run into that, something like a 1 second wait can give the hub a chance to get the other things done (it puts the running rule back at the "end of the line" it seems). The Hubitat folks can opine in more detail, this is just what I've found from time to time.