I have a Lutron RadioRa2 system and set it up for a wall mounted Pico to control the room’s Sonos speaker. You can cycle through your favorite station by pressing the center button on the Pico and would love to figure out a way to play the station name. Ideally, you would press the button, hear the station name and then the station would play. I tried using device attributes for the Sonos speaker and variables to mask the station name but haven’t had good luck. Any ideas?
Does your Sonos device actually display the station name (or whatever text you want to speak) as the values for one of the attributes under "Current States" on the device page? If so, it would be possible to create a rule to speak this text before performing another action. If not, the first step would be to figure out how--or if--you can get information into Hubitat to speak in the first place.
Looking at mine, I see the trackData
attribute with JSON values like: {"audioSource":"Unknown","station":null, ...
}, which I'm not sure you could easily get from a rule but might be possible with the "token" string operation. A custom app would probably be easier since you could just deal with the JSON directly. But I suppose either method depends on this data being accurate in the first place, and I'm usually just streaming Spotify or AirPlay onto my Sonos devices so never pay attention to what these values actually are, even though "station" sounds promsing...
Thanks for the response. Station does not show up as a value, but it is included station name
- level : 1
- mute : unmuted
- status : playing
- trackData : {"audioSource":"Unknown","station":"36 - Alt Nation","name":null,"artist":"The 1975-Love It If We Made It","album":null,"trackNumber":"1","status":"stopped","level":"1","mute":"unmuted","uri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","trackUri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","transportUri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","enqueuedUri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","metaData":"36 - Alt Nationobject.item.audioItem.audioBroadcastSA_RINCON9479_mikerpalmer12","trackMetaData":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5The 1975-Love It If We Made It,fd5740ec-7f11-0ecf-f676-46f9dc056d2c/getaa?s=1&u=x-sonosapi-hls%3aApi%253atune%253aliveAudio%253aaltnation%253afd5740ec-7f11-0ecf-f676-46f9dc056d2c%3fsid%3d37%26flags%3d288%26sn%3d5x-sonosapi-hls:Api:tune:liveAudio:altnation:fd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5object.item.audioItem.musicTrack"}
- trackDescription : 36 - Alt Nation's Clairo-Sofia playing BR P|TYPE=SNG|TITLE Sofia|ARTIST Clairo|ALBUM Immunity
- volume : 1
and in the state variables
- restoreTrack : 0
- restoreLevel : 0
- restoreURI : 0
- uri : x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5
- trackData : {"audioSource":"Unknown","station":"36 - Alt Nation","name":null,"artist":"The 1975-Love It If We Made It","album":null,"trackNumber":"1","status":"stopped","level":"10","mute":"unmuted","uri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","trackUri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","transportUri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","enqueuedUri":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5","metaData":"36 - Alt Nationobject.item.audioItem.audioBroadcastSA_RINCON9479_mikerpalmer12","trackMetaData":"x-sonosapi-hls:Api%3atune%3aliveAudio%3aaltnation%3afd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5The 1975-Love It If We Made It,fd5740ec-7f11-0ecf-f676-46f9dc056d2c/getaa?s=1&u=x-sonosapi-hls%3aApi%253atune%253aliveAudio%253aaltnation%253afd5740ec-7f11-0ecf-f676-46f9dc056d2c%3fsid%3d37%26flags%3d288%26sn%3d5x-sonosapi-hls:Api:tune:liveAudio:altnation:fd5740ec-7f11-0ecf-f676-46f9dc056d2c?sid=37&flags=288&sn=5object.item.audioItem.musicTrack"}
Guess I need to figure out how to extract it.
Sorry to dig up an old post, but did you ever make any progress on this?
No. I played around with it for a couple of days and gave up. Probably needs someone to write an app and I don't have those talents.