INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: MCWS Zones Command CurrentZoneIndex Inconsistency (?)  (Read 504 times)

Hugo_Elbuho

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 99
  • nothing more to say...
MCWS Zones Command CurrentZoneIndex Inconsistency (?)
« on: January 24, 2023, 06:59:10 am »

Hi,

I'm an old user of JR MC since its early versions.  Just decided to upgrade to MC30 and i'm running it on a Raspberry Pi.

I returned to use the MCWS interface after a long time of not touching some Python libraries i developed a couple of years ago to control it remotely.  Now i'm playing with them again to control MC server from iOS Siri Shorcuts, just for the thrill of it.

One of the key functions i needed is to be able to read (and later set) current active zone information through http://{server IP}/MCWS/v1/Playback/Zones?Token={token} but noticed at this time when reading zones it seems to be showing information inconsistently.  Bear with me...  namely, you'll see from the response i get below, that CurrentZoneIndex (value=2) which shows as associated with CurrentZoneID of 10077, does not align with the actual zone values of ZoneID1=10077 whose index should be 1


Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Response Status="OK">
<Item Name="NumberZones">3</Item>
<Item Name="CurrentZoneID">10077</Item>
<Item Name="CurrentZoneIndex">2</Item>
<Item Name="ZoneName0">sapimc@estudio</Item>
<Item Name="ZoneID0">0</Item>
<Item Name="ZoneGUID0">{2D410546-6F6A-0540-BD31-EBDB1DB8EC6C}</Item>
<Item Name="ZoneDLNA0">0</Item>
<Item Name="ZoneName1">MoodeSDE</Item>
<Item Name="ZoneID1">10077</Item>
<Item Name="ZoneGUID1">{f9510aa7-da9f-0b87-3498-b827eb52743a}</Item>
<Item Name="ZoneDLNA1">1</Item>
<Item Name="ZoneName2">MoodeSala</Item>
<Item Name="ZoneID2">10078</Item>
<Item Name="ZoneGUID2">{aef58f68-869f-2b96-3846-000f6005b7c0}</Item>
<Item Name="ZoneDLNA2">1</Item>
</Response>

Thanks for those of you using MCWS, for letting me know if you're observing the same.   Zones are listed and indexed starting from 0 while CurrentZoneIndex actually seems to be adding 1 to it at the time.   I just came from version 28 where i didn't have this situation.  I could get around this through changing some of the code but looks as if something is not correct here.

Appreciate your feedback.

Hugo
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 41968
  • Shoes gone again!
Re: MCWS Zones Command CurrentZoneIndex Inconsistency (?)
« Reply #1 on: January 24, 2023, 08:38:58 am »

It's because you have hidden zones.  So just use the zone ID which will always identify a zone.
Logged
Matt Ashland, JRiver Media Center

Hugo_Elbuho

  • Regular Member
  • Junior Woodchuck
  • **
  • Posts: 99
  • nothing more to say...
Re: MCWS Zones Command CurrentZoneIndex Inconsistency (?)
« Reply #2 on: January 24, 2023, 10:09:24 am »

Thanks for the clarification Matt.   I will definitely start using Zone IDs instead.
Logged
Pages: [1]   Go Up