Trying to read the current track or artist from Sonos. I have a Raspberry Pi setup with the Sonos HTTP API from GitHub.
I have this working to read the playbackState which i then use to update a switch in Loxone which i can then use to start or stop the sonos system.
Id like to read in the artist or current track as well.
The virtual Input has the URL set to http://*.*.*.*/custom_state
This returns the following
{"currentTrack":{"artist":"Radio X UK","title":"Ian Brown - F.E.A.R","albumArtUri":"/getaa?s=1&u=x-sonosapi-stream%3as254741%3fsid%3d254%26flags%3d8224%26sn%3 d0","duration":0,"uri":"x-sonosapi-stream:s254741?sid=254&flags=8224&sn=0","type":"ra dio","stationName":"Radio X UK","absoluteAlbumArtUri":"http://192.168.1.214:1400/getaa?s=1&u=x-sonosapi-stream%3as254741%3fsid%3d254%26flags%3d8224%26sn%3 d0"},"nextTrack":{"artist":"","title":"","album" :" ","albumArtUri":"","duration":0,"uri":""},"vol ume" :36,"mute":false,"trackNo":1,"elapsedTime":5,"elap sedTimeFormatted":"00:00:05","playbackState":2,"pl ayMode":{"repeat":"none","shuffle":false,"crossfad e":false}}
I then have a http input command set to playbackState":\v which returns a number (2 means it playing) I want to get the current artist or track. I've tried numerous things but not working and only ever returns a 0. Is the fact their is two artist values an issue? Anyone got ideas on how to get this. also the display unit is set to <v> is this an issue as i want to return text Any help would be fantastic even if only to put me on the right track