-
Hi, Is there a way to test if players are online before grouping ? Or is there a way to avoid errors if one player is missing (offline) when using household.create.group and just group the available (online) players. I tried using household.test.player before creating the group but it seems not to be the ideal way. Thanks for your help |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Hi. Best is to keep the SONOS player always on - that's why SONOS players do not have a build in on/off switch. :-) (except the Roam) If you switch on or/off a SONOS player via power supply it takes several minutes until the new status is updated. Option 0: Don't swich off - easiest to implement and 100% reliable Option 1: You wait 15 minutes (or maybe also 10 minutes or even shorter). After that period the standard commands such as household.test.player or household.get.groups should provide the correct data (no garantee - it is in the hand of your network and SONOS). Option 2: Install the sister package sonos-events and listen to the group event. Store the data in a flow or global variable. Does that answer help?
|
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for your answer and for this amazing work. I will try tonight the solution 2 you gave me. I have problems with Sonos Move that goes offline when they are not playing and not charging. And sometimes a player is not responding or has been unplugged by someone in the house. I have seen that the sister package sonos-events will not be actively developed in the future. Does it mean that if something break in the future, it will not be fixed ? What do yout think about household.test.player accepting more than one player . IN string like "Player1,Player2,Player3" and Out True/False. Thanks again |
Beta Was this translation helpful? Give feedback.
-
That means, that I most likely won't add new features and leave it as it is. My intention is to maintain it for some time and fix bugs and update dependencies. I am 65 and already retired - so dont know how long I will have the passion, skills, health to maintain it.
Node-RED can handle that. Just take household.get.groups. The result is an array of groups where the groups are an array of players. If you dont like JSONATA you can write a Javascript function. test.player is a "work around" - the result depends very much on the number of players in the network and the network performance. |
Beta Was this translation helpful? Give feedback.
-
Ok here what I have done with your help. Using household.get.groups and JSONATA to flatten an array containing only "playerName". I added a little function to check if players are in the array. Maybe it could be done only with JSONATA.
|
Beta Was this translation helpful? Give feedback.
-
Great - usually a combination of JSONATA and then a function is the fastest way to find a solution. JSONATA is very powerful but sometime difficult to understand. If the payload contains the flattenend group output, then |
Beta Was this translation helpful? Give feedback.
Hi.
Best is to keep the SONOS player always on - that's why SONOS players do not have a build in on/off switch. :-) (except the Roam)
If you switch on or/off a SONOS player via power supply it takes several minutes until the new status is updated.
Option 0: Don't swich off - easiest to implement and 100% reliable
Option 1: You wait 15 minutes (or maybe also 10 minutes or even shorter). After that period the standard commands such as household.test.player or household.get.groups should provide the correct data (no garantee - it is in the hand of your network and SONOS).
Option 2: Install the sister package sonos-events and listen to the group event. Store the data in a flow or global varia…