Page 1 of 1

How to check if speaker isn't actively playing music

PostPosted: Mon Oct 09, 2017 8:55 am
by zini
I am trying to create a trigger that will periodically check and see if my zones are actively playing music, and if not, will restart them playing a favorite station.

Sorry if this has been covered somewhere, but I haven't been able to find this anywhere. What variable do I use to accomplish this? Assuming it's under the "device state changed" options.

Thank you in advance!

Re: How to check if speaker isn't actively playing music

PostPosted: Mon Oct 09, 2017 8:59 am
by roussell
I do something similar in a few situations; I forget the exact trigger, but I check the state of the device and if the state "is not playing", I do some action. I can look a little later and see exactly what it is if you can't find it.

Terry

Re: How to check if speaker isn't actively playing music

PostPosted: Mon Oct 09, 2017 9:08 am
by roussell
Actually, I did trigger off of any change. Here is an example that turns off a sub amp on the patio if the Sonos outside isn't playing. I did it this way to avoid the trigger firing when the Sonos is transitioning between songs/stations/playlists.
Screen Shot 2017-10-09 at 10.02.13 AM.png
Screen Shot 2017-10-09 at 10.02.13 AM.png (61.06 KiB) Viewed 1575 times

Screen Shot 2017-10-09 at 10.05.32 AM.png
Screen Shot 2017-10-09 at 10.05.32 AM.png (120.99 KiB) Viewed 1575 times

Screen Shot 2017-10-09 at 10.02.50 AM.png
Screen Shot 2017-10-09 at 10.02.50 AM.png (79.91 KiB) Viewed 1575 times



Terry

Re: How to check if speaker isn't actively playing music

PostPosted: Tue Oct 10, 2017 9:16 am
by zini
Terry,

Awesome! Thanks for the quick response. I used the same setup you use and it seems to be working great. This is a great method to keep music always on, even if something like an internet stream times out.

Re: How to check if speaker isn't actively playing music

PostPosted: Thu Oct 12, 2017 10:04 am
by zini
Terry,

Is there a published list somewhere of the speaker states for the plugin? When I run the STOPPED and PAUSED states as conditions in a schedule it doesn't seem to work. If I manually execute the schedule, it works perfectly. So it seems like it's something with the plugin not properly understanding the state of the speaker.

Any thoughts?

Re: How to check if speaker isn't actively playing music

PostPosted: Thu Oct 12, 2017 10:16 am
by autolog
Have you checked the custom states listed beneath the device in the main Indigo UI?

Select a device in the main UI and then make the display in the lower pane larger or scroll it. I don't use the Sonos plugin (I haven't got any Sonos devices :wink: ) but plugins list their custom states in the lower pane.

This may help if you haven't discovered these already. :)

Re: How to check if speaker isn't actively playing music

PostPosted: Fri Oct 13, 2017 9:51 am
by zini
Ahhh... got it. Makes sense. This helps a lot! By looking at these, I was able to figure out that changing the condition to "contains" instead of "equals" has solved my issue.

Thanks for the help!