How can I read the status of my sonos every minute in a dzvents script, and make the values visible in a switch.?
I read the data from the sonos with 'http://192.168.1.21:5005/state' and get the following data:
Code: Select all
{"volume":15,"mute":false,"equalizer":{"bass":0,"treble":4,"loudness":true,"speechEnhancement":false,"nightMode":false},"currentTrack":{"artist":"Radio 10","title":"Rod Stewart - Da Ya Think I'm Sexy","albumArtUri":"/getaa?s=1&u=x-sonosapi-stream%3atunein%253a7073%3fsid%3d303%26flags%3d8224%26sn%3d1","duration":0,"uri":"x-sonosapi-stream:tunein%3a7073?sid=303&flags=8224&sn=1","trackUri":"x-sonosapi-stream:tunein%3a7073?sid=303&flags=8224&sn=1","type":"radio","stationName":"Radio 10","absoluteAlbumArtUri":"http://192.168.1.156:1400/getaa?s=1&u=x-sonosapi-stream%3atunein%253a7073%3fsid%3d303%26flags%3d8224%26sn%3d1"},"nextTrack":{"artist":"","title":"","album":"","albumArtUri":"","duration":0,"uri":""},"trackNo":1,"elapsedTime":259,"elapsedTimeFormatted":"00:04:19","playbackState":"PLAYING","playMode":{"repeat":"none","shuffle":false,"crossfade":false},"sub":{"gain":-4,"crossover":0,"polarity":0,"enabled":true}}