Hello…I have 4 sonos players that I am trying to use visiblity on whether they are playing or not. Quite honestly, I’m lost. I don’t know how to tell if a player is online or not. I have older Sonos devices that don’t have all the channels that some others have posted here.
It seems that I need to set up a rule, and you are the master at that. When the player is off, it’s UNDEF, so I assume I could use this…but I don’t know how.
Can I use NGRE to check the state as UNDEF, then send a command to a dummy item?
You probably don’t need a Rule. You need to find some Channel whose state indicates that the device is playing. I don’t use Sonos so I’ve no idea what that would be, but for Chromecast I use the Media Title Channel. Link that to an Item and in the sitemap for the row you only want to show when it’s playing append visibility=[MediaTitle!=UNDEF]. When it’s not playing, the Chromecast binding sets that Item to UNDEF. When it is playing it sets that Channel to the title of the piece being played.
I don’t think that it will work with an item that is linked to your “current album”-channel. Even if your Sonos stops, the name of the last album will be held in the items state.
Maybe a better solution could be an item like one of those:
I will look at your advice tomorrow when I’m back in front of it…but, its currently working using the dummy item linked to the artist channel. Watching the logs, when the sonos unit is off, its undefined.