09-04-2023 05:02 PM
HI-
I'm trying to write a script that pauses/stops playback on all of my Sonos speakers (playing independently, not grouped) at the same time when I use a voice command. I can write a script that works just fine when I only try to pause one speaker at a time, but I'm having problems when I try to pause more than one at the same time. I've used the two scripts below and neither works:
starters:
- type: assistant.event.OkGoogle
eventData: query
is: make Sonos quiet
actions:
- type: device.command.MediaStop
devices: speaker_1 - Room_1
- type: device.command.MediaStop
devices: speaker_2 - Room_2
starters:
- type: assistant.event.OkGoogle
eventData: query
is: make Sonos quiet
actions:
- type: device.command.MediaStop
devices:
- speaker_1 - Room_1
- speaker_2 - Room_2
In both cases, one of the speakers will pause and the other will not (I think the one that stops is the one that started playing most recently, but I'm not 100% sure). The only way I've been able to get it to work so far is by doing this:
starters:
- type: assistant.event.OkGoogle
eventData: query
is: make Sonos quiet
actions:
- type: device.command.MediaPause
devices: speaker_1 - Room_1
- type: device.command.MediaStop
devices: speaker_2 - Room_2
...which would be fine (I guess) if I only had two Sonos devices, but I have more than that and I can't think of another way around it.
Any advice or suggestions? I'm new to this, but I have no problem writing scripts that trigger other types of actions (e.g. turning lights on or off) and affecting multiple devices at the same time. The only issue is with Sonos devices.
Thanks!
12-05-2023 05:43 PM
Any luck with this problem? It works ok for me with the devices that support Media commands. I was surprised to notice that 3 of my 4 google home minis don't support any of the Media commands (such as MediaStop or MediaPause).
I guess things are still a bit buggy?
12-08-2023 09:34 AM
Still no luck. But just to clarify, I'm trying to control three SONOS speakers, not Google Home/Nest Minis with one command. I have no problem using similar commands to control multiple lights, but I can't make anything work for multiple Sonos speakers.