Run rule actions at the same time

  • OS: Docker on Synology
  • Issue of the topic: I want to trigger multiple actions at the same time. I have several Sonos devices and I would like all of them to play a sound if a door is opened. Basically that works, but the sound are play one after another. All at the same time would be much more impressive :-). Sorry, that might be a basic question, but I wasn’t able to make it, so far.
    *This is the Code of the rule
    triggers:
    • id: “1”
      configuration:
      itemName: Haustur_ontact
      state: OPEN
      type: core.ItemStateUpdateTrigger
    • id: “2”
      configuration:
      itemName: TuersensorEsszimmerRechts
      state: OPEN
      type: core.ItemStateUpdateTrigger
      conditions:
    • inputs: {}
      id: “4”
      configuration:
      itemName: Security_Switch
      state: ON
      operator: =
      type: core.ItemStateCondition
      actions:
    • inputs: {}
      id: “5”
      configuration:
      volume: 20
      sink: sonos:PLAYBAR:RINCON_000E58B02F2901400
      sound: alam01.mp3
      type: media.PlayAction
    • inputs: {}
      id: “3”
      configuration:
      volume: 20
      sink: sonos:Move:RINCON_542A1B77479A01400
      sound: alam01.mp3
      type: media.PlayAction
    • id: “6”
      configuration:
      sound: barking.mp3
      sink: sonos:OneSL:RINCON_F0F6C12468D201400
      volume: 15
      type: media.PlayAction
    • id: “7”
      configuration:
      sound: barking.mp3
      sink: sonos:OneSL:RINCON_F0F6C124660801400
      volume: 15
      type: media.PlayAction

Any hint is really appreciated

This sounds like you need a multiroom setup.
Searching for multiroom and sonos returns this thread not sure if that helps:

Can’t be done from the same rule. You can get close by having a separate rule for each action you want to have happen at the same time but there will be little differences in time because nothing ever truly happens at the exact same time on a computer and OH is not built with the stuff needed to simulate that.

As Wolfgang_S points out, getting multiroom audio type support is usually left to the technology itself (sonos, chromecast, etc) and not by OH. OH is simply not equipped to handle that.

Thanks, bot of you! Good to know that it is not possible with the same rule. Actually, mir first attempt was to get this Mutliroom rule setup done, you reffered to. But I wasn’t able to write the script for the action that it just plays the sound, But I will give it another try!

You could try (I did not try this myself yet, though doing it with Alexa) to define a group and put all the sound items into that group.
Try to set the value of the group.
I am Curious about what happens.

Tried that, but the play command on the group doesn’t work it seems.