Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonos] Thing type for Sonos Move #9950

Closed
stjx79 opened this issue Jan 24, 2021 · 17 comments · Fixed by #9962
Closed

[sonos] Thing type for Sonos Move #9950

stjx79 opened this issue Jan 24, 2021 · 17 comments · Fixed by #9962
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@stjx79
Copy link

stjx79 commented Jan 24, 2021

It would be great if Sonos Move support could be added.
It is currently recognized as sonos:zoneplayer.

<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.1.1 - Sonos Move</friendlyName>
		<manufacturer>Sonos, Inc.</manufacturer>
		<manufacturerURL>http://www.sonos.com</manufacturerURL>
		<modelNumber>S17</modelNumber>
		<modelDescription>Sonos Move</modelDescription>
		<modelName>Sonos Move</modelName>
		<modelURL>http://www.sonos.com/products/zoneplayers/S17</modelURL>
		<softwareVersion>61.1-83220</softwareVersion>
		<swGen>2</swGen>
		<hardwareVersion>1.25.1.8-2.10</hardwareVersion>
		<serialNum>00-00-00-00-00-00:2</serialNum>
		<MACAddress>00:00:00:00:00:00</MACAddress>
		<UDN>uuid:RINCON_<...ID...></UDN>
		<iconList>
			<icon>
				<id>0</id>
				<mimetype>image/png</mimetype>
				<width>48</width>
				<height>48</height>
				<depth>24</depth>
				<url>/img/icon-S17.png</url>
			</icon>
		</iconList>
		<minCompatibleVersion>60.0-00000</minCompatibleVersion>
		<legacyCompatibleVersion>58.0-00000</legacyCompatibleVersion>
		<apiVersion>1.22.1</apiVersion>
		<minApiVersion>1.1.0</minApiVersion>
		<displayVersion>12.2.2</displayVersion>
		<extraVersion/>
		<nsVersion>22</nsVersion>
		<roomName>Sonos Move</roomName>
		<displayName>Move</displayName>
		<zoneType>19</zoneType>
		<feature1>0x00000000</feature1>
		<feature2>0x07c38312</feature2>
		<feature3>0x00010c8a</feature3>
		<seriesid>A100</seriesid>
		<variant>10</variant>
		<internalSpeakerSize>5</internalSpeakerSize>
		<bassExtension>75.000</bassExtension>
		<satGainOffset>6.000</satGainOffset>
		<memory>1024</memory>
		<flash>1024</flash>
		<ampOnTime>20</ampOnTime>
		<retailMode>0</retailMode>
		<SSLPort>1443</SSLPort>
		<securehhSSLPort>1843</securehhSSLPort>
		<serviceList>
			<service>
				<serviceType>urn:schemas-upnp-org:service:AlarmClock:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:AlarmClock</serviceId>
				<controlURL>/AlarmClock/Control</controlURL>
				<eventSubURL>/AlarmClock/Event</eventSubURL>
				<SCPDURL>/xml/AlarmClock1.xml</SCPDURL>
			</service>
			<service>
				<serviceType>urn:schemas-upnp-org:service:MusicServices:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:MusicServices</serviceId>
				<controlURL>/MusicServices/Control</controlURL>
				<eventSubURL>/MusicServices/Event</eventSubURL>
				<SCPDURL>/xml/MusicServices1.xml</SCPDURL>
			</service>
			<service>
				<serviceType>urn:schemas-upnp-org:service:DeviceProperties:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:DeviceProperties</serviceId>
				<controlURL>/DeviceProperties/Control</controlURL>
				<eventSubURL>/DeviceProperties/Event</eventSubURL>
				<SCPDURL>/xml/DeviceProperties1.xml</SCPDURL>
			</service>
			<service>
				<serviceType>urn:schemas-upnp-org:service:SystemProperties:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:SystemProperties</serviceId>
				<controlURL>/SystemProperties/Control</controlURL>
				<eventSubURL>/SystemProperties/Event</eventSubURL>
				<SCPDURL>/xml/SystemProperties1.xml</SCPDURL>
			</service>
			<service>
				<serviceType>urn:schemas-upnp-org:service:ZoneGroupTopology:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:ZoneGroupTopology</serviceId>
				<controlURL>/ZoneGroupTopology/Control</controlURL>
				<eventSubURL>/ZoneGroupTopology/Event</eventSubURL>
				<SCPDURL>/xml/ZoneGroupTopology1.xml</SCPDURL>
			</service>
			<service>
				<serviceType>urn:schemas-upnp-org:service:GroupManagement:1</serviceType>
				<serviceId>urn:upnp-org:serviceId:GroupManagement</serviceId>
				<controlURL>/GroupManagement/Control</controlURL>
				<eventSubURL>/GroupManagement/Event</eventSubURL>
				<SCPDURL>/xml/GroupManagement1.xml</SCPDURL>
			</service>
			<service>
				<serviceType>urn:schemas-tencent-com:service:QPlay:1</serviceType>
				<serviceId>urn:tencent-com:serviceId:QPlay</serviceId>
				<controlURL>/QPlay/Control</controlURL>
				<eventSubURL>/QPlay/Event</eventSubURL>
				<SCPDURL>/xml/QPlay1.xml</SCPDURL>
			</service>
		</serviceList>
		<deviceList>
			<device>
				<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>
				<friendlyName>192.168.1.1 - Sonos Move Media Server</friendlyName>
				<manufacturer>Sonos, Inc.</manufacturer>
				<manufacturerURL>http://www.sonos.com</manufacturerURL>
				<modelNumber>S17</modelNumber>
				<modelDescription>Sonos Move Media Server</modelDescription>
				<modelName>Sonos Move</modelName>
				<modelURL>http://www.sonos.com/products/zoneplayers/S17</modelURL>
				<UDN>uuid:RINCON_<...ID...>_MS</UDN>
				<serviceList>
					<service>
						<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>
						<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>
						<controlURL>/MediaServer/ContentDirectory/Control</controlURL>
						<eventSubURL>/MediaServer/ContentDirectory/Event</eventSubURL>
						<SCPDURL>/xml/ContentDirectory1.xml</SCPDURL>
					</service>
					<service>
						<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
						<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
						<controlURL>/MediaServer/ConnectionManager/Control</controlURL>
						<eventSubURL>/MediaServer/ConnectionManager/Event</eventSubURL>
						<SCPDURL>/xml/ConnectionManager1.xml</SCPDURL>
					</service>
				</serviceList>
			</device>
			<device>
				<deviceType>urn:schemas-upnp-org:device:MediaRenderer:1</deviceType>
				<friendlyName>Sonos Move - Sonos Move Media Renderer</friendlyName>
				<manufacturer>Sonos, Inc.</manufacturer>
				<manufacturerURL>http://www.sonos.com</manufacturerURL>
				<modelNumber>S17</modelNumber>
				<modelDescription>Sonos Move Media Renderer</modelDescription>
				<modelName>Sonos Move</modelName>
				<modelURL>http://www.sonos.com/products/zoneplayers/S17</modelURL>
				<UDN>uuid:RINCON_<...ID...>_MR</UDN>
				<serviceList>
					<service>
						<serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType>
						<serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId>
						<controlURL>/MediaRenderer/RenderingControl/Control</controlURL>
						<eventSubURL>/MediaRenderer/RenderingControl/Event</eventSubURL>
						<SCPDURL>/xml/RenderingControl1.xml</SCPDURL>
					</service>
					<service>
						<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
						<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
						<controlURL>/MediaRenderer/ConnectionManager/Control</controlURL>
						<eventSubURL>/MediaRenderer/ConnectionManager/Event</eventSubURL>
						<SCPDURL>/xml/ConnectionManager1.xml</SCPDURL>
					</service>
					<service>
						<serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType>
						<serviceId>urn:upnp-org:serviceId:AVTransport</serviceId>
						<controlURL>/MediaRenderer/AVTransport/Control</controlURL>
						<eventSubURL>/MediaRenderer/AVTransport/Event</eventSubURL>
						<SCPDURL>/xml/AVTransport1.xml</SCPDURL>
					</service>
					<service>
						<serviceType>urn:schemas-sonos-com:service:Queue:1</serviceType>
						<serviceId>urn:sonos-com:serviceId:Queue</serviceId>
						<controlURL>/MediaRenderer/Queue/Control</controlURL>
						<eventSubURL>/MediaRenderer/Queue/Event</eventSubURL>
						<SCPDURL>/xml/Queue1.xml</SCPDURL>
					</service>
					<service>
						<serviceType>
							urn:schemas-upnp-org:service:GroupRenderingControl:1
						</serviceType>
						<serviceId>urn:upnp-org:serviceId:GroupRenderingControl</serviceId>
						<controlURL>/MediaRenderer/GroupRenderingControl/Control</controlURL>
						<eventSubURL>/MediaRenderer/GroupRenderingControl/Event</eventSubURL>
						<SCPDURL>/xml/GroupRenderingControl1.xml</SCPDURL>
					</service>
					<service>
						<serviceType>urn:schemas-upnp-org:service:VirtualLineIn:1</serviceType>
						<serviceId>urn:upnp-org:serviceId:VirtualLineIn</serviceId>
						<controlURL>/MediaRenderer/VirtualLineIn/Control</controlURL>
						<eventSubURL>/MediaRenderer/VirtualLineIn/Event</eventSubURL>
						<SCPDURL>/xml/VirtualLineIn1.xml</SCPDURL>
					</service>
				</serviceList>
				<X_Rhapsody-Extension xmlns="http://www.real.com/rhapsody/xmlns/upnp-1-0">
					<deviceID>
						urn:rhapsody-real-com:device-id-1-0:sonos_1:RINCON_<...ID...>
					</deviceID>
					<deviceCapabilities>
						<interactionPattern type="real-rhapsody-upnp-1-0"/>
					</deviceCapabilities>
				</X_Rhapsody-Extension>
				<qq:X_QPlay_SoftwareCapability xmlns:qq="http://www.tencent.com">QPlay:2</qq:X_QPlay_SoftwareCapability>
				<iconList>
					<icon>
						<mimetype>image/png</mimetype>
						<width>48</width>
						<height>48</height>
						<depth>24</depth>
						<url>/img/icon-S17.png</url>
					</icon>
				</iconList>
			</device>
		</deviceList>
	</device>
</root>
@stjx79 stjx79 added the enhancement An enhancement or new feature for an existing add-on label Jan 24, 2021
@lolodomo
Copy link
Contributor

I can do it.
Can you confirm that it is a model with no audio input?
Do you see a setting like night mode in the Sonos app ? Speech enhancement? Loudness? Bass/treble?

@stjx79
Copy link
Author

stjx79 commented Jan 25, 2021

The Sonos Move has no audio input, no night mode and no speech enhancement.
Loudness, bass and treble setting are available.
Trueplay can also be set. But here it is called "Auto Trueplay Tuning".

@lolodomo
Copy link
Contributor

I will add it but you will get nothing more than what you already have with the ZonePlayer thing type.

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Jan 25, 2021
@stjx79
Copy link
Author

stjx79 commented Jan 26, 2021

Thank you very much!
Maybe the battery level could be added in the future.
However, I don't know if and where this can be found in the API.

@lolodomo
Copy link
Contributor

lolodomo commented Jan 26, 2021

If you have DeviceSpy installed on your PC, you could try to find what UPnP service provides the information. I suppose it could be DeviceProperties.

@lolodomo
Copy link
Contributor

In fact, even without DeviceDpy but just by enabling the binding TRACE logs, you could find this information. Look at logs starting with: Received pair ...
And in particular the ones for variable "LastChange".

cpmeister pushed a commit that referenced this issue Jan 27, 2021
* [sonos] Add support for Sonos Move

Fix #9950 

* README: updated list of supported Sonos models

Signed-off-by: Laurent Garnier <[email protected]>
@stjx79
Copy link
Author

stjx79 commented Jan 27, 2021

I've only found the battery information on the speaker support page so far:
Via http://192.168.1.50:1400/support/review you can select the Sonos Move and then "Battery Status":
Sonos Move Battery Status
Let's see if I can find something else. Otherwise I have to read the information from this page.

@lolodomo
Copy link
Contributor

As I already suggested, look in binding TRACE logs, maybe you will find something.

@stjx79
Copy link
Author

stjx79 commented Jan 30, 2021

I have now looked at the trace and found the following:
2021-01-30 11:42:06.567 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'MoreInfo':'BattChg:CHARGING,RawBattPct:99,BattPct:100,BattTmp:24' (service 'DeviceProperties') for thing 'sonos:zoneplayer:Move'
2021-01-30 12:53:45.410 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'MoreInfo':'BattChg:NOT_CHARGING,RawBattPct:92,BattPct:94,BattTmp:24' (service 'DeviceProperties') for thing 'sonos:zoneplayer:Move'
From BattChg I get the values NOT_CHARGING or CHARGING.
RawBattPct is the battery percentage, which is also used in the Sonos app.
Behind BattTmp I assume the battery temperature in celsius.
I get the "MoreInfo" parameter from all of my Sonos devices. However, it was only filled for the Sonos Move.

I also noticed another interesting parameter:
2021-01-30 12:46:53.137 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'MicEnabled':'1' (service 'DeviceProperties') for thing 'sonos:zoneplayer:Move'
2021-01-30 12:46:55.115 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'MicEnabled':'0' (service 'DeviceProperties') for thing 'sonos:zoneplayer:Move'
Where MicEnabled = '1' means the microphone is switched on. I tested this parameter with Sonos One, Sonos Beam, Sonos Arc and Sonos Move. As far as I could see, it is also available on other devices, but always returns a 0 because these devices do not have a microphone.

@lolodomo
Copy link
Contributor

lolodomo commented Jan 30, 2021

I will add these info as new channels.

It would be interesting to know if there us an UPnP action to enable/disable the microphone.
Can you tell me which are the models with a microphone?

@stjx79
Copy link
Author

stjx79 commented Jan 30, 2021

This action is likely not available due to privacy concerns.
So that you can't activate the microphone from "external"...

As far as I know, only the One, Beam, Arc and Move use the microphones.

@lolodomo
Copy link
Contributor

Ok, thank you.

@lolodomo
Copy link
Contributor

I assumed in my PRs that these info are returned by the UPnP action GetZoneInfo.
It could be the action GetZoneAttributes but I believe this is less probable.
We will see when you will test.

@lolodomo
Copy link
Contributor

And please note that these new informations will be updated only once per minute. I don't think this is a problem for these information. For an unexplained reason, subscription to the service "device properties" leads to no value received.

@lolodomo
Copy link
Contributor

Everything is merged, let me know if it works well.

@lolodomo
Copy link
Contributor

lolodomo commented Feb 1, 2021

New channels are included in snapshot 2176.
Édit: it is not included in 3.1 M1 (which was built few hours before the merges).

@stjx79
Copy link
Author

stjx79 commented Feb 2, 2021

I've tested it and the microphone channel works as expected.
But I made a mistake with the battery level.
It's the other battery level (BattPct) which is used in the Sonos app.

themillhousegroup pushed a commit to themillhousegroup/openhab2-addons that referenced this issue May 10, 2021
* [sonos] Add support for Sonos Move

Fix openhab#9950 

* README: updated list of supported Sonos models

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: John Marshall <[email protected]>
thinkingstone pushed a commit to thinkingstone/openhab-addons that referenced this issue Nov 7, 2021
* [sonos] Add support for Sonos Move

Fix openhab#9950 

* README: updated list of supported Sonos models

Signed-off-by: Laurent Garnier <[email protected]>
marcfischerboschio pushed a commit to bosch-io/openhab-addons that referenced this issue May 5, 2022
* [sonos] Add support for Sonos Move

Fix openhab#9950 

* README: updated list of supported Sonos models

Signed-off-by: Laurent Garnier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants