jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Easy way to get friendlyName or modelDescription? #880

Open ms777 opened 6 months ago

ms777 commented 6 months ago

... just installed it on my Synology NAS and everything works like a charm!

Is there an easy way to get the friendlyName or modelDescription for the players? I have multiple players in a room, and in the state I only see the somewhat cryptic uuid ?

In the http://192.168.178.61:1400/xml/device_description.xml I see them ...

<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:ZonePlayer:1</deviceType>
<friendlyName>192.168.178.61 - Sonos One</friendlyName>
<manufacturer>Sonos, Inc.</manufacturer>
<manufacturerURL>http://www.sonos.com</manufacturerURL>
<modelNumber>S13</modelNumber>
<modelDescription>Sonos One</modelDescription>
<modelName>Sonos One</modelName>
<modelURL>http://www.sonos.com/products/zoneplayers/S13</modelURL>
...
jishi commented 5 months ago

I don't think I use the device_description.xml content to parse info about the players, most of this is part of the event that tells you which players are in the system.

Could you elaborate on why you have use for the modelName? I fail to see any real need for it, more than for informative purposes.

ms777 commented 5 months ago

Right now the only human readable identificator for a Sonos device is the roomName. However, I have multiple Sonos devices in my (fortunately quite large) living room. friendlyName or modelDescription would help to identify the different devices in the same room. I have made a workaround with a lookup on the uuid, which is not very elegant, but works.