@daniel.winks
You have made excellent progress on this app & drivers. It is exciting to see these extended controls and TTS for Sonos natively in HE without disturbing the playlist queue.
I have returned the Sonos Roam I recently purchased after some period of evaluation. I was disappointed in the Roam's lack of ability to consistently stay in a Sonos group after some period of idle time. Also adding Alexa/Google to the Roam for voice services seemed to make it perform slowly and TTL group announcements were not in sync with my other Alex devices causing an echo. The sound quality, size, and water resistance of the Roam are nice, but my Sonos Move, a much improved model IMHO (which $$$ costs more), has a much better all around sound output and longer battery life for my use/tastes.
I am disappointed in Sonos 's native 'Hey Sonos' voice control which is missing a critical integration for the Spotify music service. I am hoping that the next version of 'Hey Sonos' voice control and Roam model's performance are improved so I can add it to my existing 15 Sonos S2 devices. For the Roam, as a stand alone, small footprint, lower cost mobile speaker, it is just fine, just not for my intended use as of it today.
As far as 'Battery' and 'PowerSource' capabilities, these HE capabilities are certainly not critical but a 'nice to have' IMHO. I also wish that HE would allow dynamic driver capabilities down the road, so the need for separate static device drivers could be eliminated based on each models features. I don't see this happening as the HE development community has been asking for this for years.
I have extra/unused capabilities in several of my custom HE drivers for a variety of network attached weather stations and spa devices that do not get values, hence do not show up in the device page, unless I post a sendEvent. So, again, no need to get complicated and have separate Sonos device drivers depending on the model of the Sonos device if you decide to add.
Here is the XML output that is returned for both a Sonos model at 10.0.0.32 that has a battery, ie Move or Roam and a non battery Sonos device at 10.0.0.39. The XML for a non battery Sonos is missing these same XML 'Data' tags, hence no battery/powersource attributes and no need to post sendEvents.
http://10.0.0.32:1400/status/batterystatus
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="/xml/review.xsl"?><ZPSupportInfo><LocalBatteryStatus>
<Data name="Health">GREEN</Data>
<Data name="Level">100</Data>
<Data name="Temperature">NORMAL</Data>
<Data name="PowerSource">SONOS_CHARGING_RING</Data>
</LocalBatteryStatus><!-- SDT: 0 ms --></ZPSupportInfo>
and here is the same XML returned for a Sonos Play5 (no battery):
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="/xml/review.xsl"?><ZPSupportInfo></ZPSupportInfo>
One could basically parse the returned XML text and iterate over each Zoneplayer's XML output from this example URI:
http://10.0.0.32:1400/support/review
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/xml/review.xsl"?><ZPNetworkInfo type = 'User'><ZPSupportInfo><LocalBatteryStatus>
<Data name="Health">GREEN</Data>
<Data name="Level">100</Data>
<Data name="Temperature">NORMAL</Data>
<Data name="PowerSource">SONOS_CHARGING_RING</Data>
</LocalBatteryStatus><!-- SDT: 0 ms --><EnetPorts></EnetPorts><!-- SDT: 0 ms --><ZPInfo><ZoneName>Move</ZoneName><ZoneIcon></ZoneIcon><Configuration>1</Configuration><LocalUID>RINCON_48A6B8E2981E01400</LocalUID><SerialNumber>48-A6-B8-E2-98-1E:E</SerialNumber><SoftwareVersion>76.2-47270</SoftwareVersion><BuildType>release</BuildType><SWGen>2</SWGen><SoftwareDate>2023-11-27 10:33:55.547386</SoftwareDate><SoftwareScm>336e80a952</SoftwareScm><HHSwgenState>allow:2</HHSwgenState><MinCompatibleVersion>75.0-00000</MinCompatibleVersion><LegacyCompatibleVersion>75.0-00000</LegacyCompatibleVersion><HardwareVersion>1.25.1.8-1.2</HardwareVersion><DspVersion>0.25.3</DspVersion><SeriesID>A100</SeriesID><MfgLocation>0</MfgLocation><DateCode>0</DateCode><HwFlags>0x30</HwFlags><HwFeatures>0x0</HwFeatures><Variant>2</Variant><GeneralFlags>0x0</GeneralFlags><IPAddress>10.0.0.32</IPAddress><MACAddress>48:A6:B8:E2:98:1E</MACAddress><Copyright>© 2003-2023, Sonos, Inc. All rights reserved.</Copyright><ExtraInfo></ExtraInfo><HTAudioInCode>0</HTAudioInCode><IdxTrk></IdxTrk><MDP2Ver>5</MDP2Ver><MDP3Ver>2</MDP3Ver><RelBuild>1</RelBuild><AllowlistBuild>0x0</AllowlistBuild><ProdUnit>1</ProdUnit><FuseCfg>OK</FuseCfg><RevokeFuse>0x1</RevokeFuse><AuthFlags>0x0</AuthFlags><SwFeatures>0x0</SwFeatures><HouseholdControlID>Sonos_PzcOS2msIrUwSEiKo4XYdGwSlB.GGyDU-1b9cNNxrAdmVvF</HouseholdControlID><LocationId>lc_ee88e7f4215241cda347eb79aff78391</LocationId></ZPInfo><!-- SDT: 4 ms --><File name='/VERSION'>76.2-47270
</File><!-- SDT: 0 ms --><File name='/proc/ath_rincon/status'>Debug info for INFRA mode at 18851596