Homey Community Forum

If "Sonos paused" flow

Hi,

You can currently trigger a flow on Sonos album, artist, volume, track change; I’d love to be able to trigger on play state change play -> pause or pause -> play. I suspect you are currently subscribing to things like playerVolume to provide the current triggers; you’d just have to add a subscription to playback status to provide the trigger I am looking for. I would have happily added/enhanced this myself if the Sonos App was open source, but that does not appear to be the case.

Thanks,
Martijn

1 Like

Actually, forget about it, did my own app in which I can also resume playing on a particular speaker after it has left a group in a reliable way and this not somehow restarts the speakers in the old group as tends to happen with the current Sonos flows.

Do u care to share?

1 Like

Well, it’s probably not very useful for others; I really just implemented this for my own exact situation with hardcoded device and room names, etc.

So it’s not on github yet? :wink:

Sure there is: https://github.com/escabe/org.escabe.mysonos I just don’t think it is very useful for many others.

The basic thing I wanted to have is: if alarm sounds, group bedroom, bathroom and living room speakers together and play a radio station on that group. Then if I stop my bedroom speaker, I want the living room speaker to continue playing.

This was not possible before: there was no “bedroom stopped playing” to trigger on; my App implements that. Also there is no good reliable way to first remove a speaker from a group and then have that speaker play something…with the current Homey Sonos App, this typically results in the old group playing instead of that speaker I had just ungrouped…unless I add some delay of at least 10 seconds, but I don’t want that 10 second gap in audio. My App implements a new action which ungroups the livingroom speaker and once that has been completed, specifically tells that same speaker to resume playing again.

As you can see though if you look at the sources, I hardcoded the way in which I indentify the living room and bedroom speakers.

1 Like

I’m no programmer but is it a lot of work to change the “hardcoded” way into a way the community can enjoy your version?

Well, for the community to be able to properly enjoy this, I’d need to add proper device discovery, implementing a Driver, etc. Which I assume basically already exists in the current Sonos support as offered by the official App…I don’t really feel like replicating all that work, I’d be easier/better if the official App was enhanced to support this.

Aa a non developer that sounds understandable. :grimacing:

Screenshot_20190709-102208