Comments (4)
The first command tries to execute the SetAVTransportURI command on the sonos device class, which only accepts 1 parameter https://github.com/svrooij/node-sonos-ts/blob/master/src/sonos-device.ts#L410-L413
This isn't the same as the AVTransportService.SetAVTransportURI which accepts your specified parameters
You could call it by using:
{
"command": "adv-command",
"input": {
"cmd": "SetAVTransportURI",
"val": "x-rincon-mp3radio://http://ice3.somafm.com/groovesalad-64-aac"
}
}
That results in the same code as with you other command https://github.com/svrooij/sonos2mqtt/blob/master/src/sonos-command-mapping.ts#L70-L71 .
Problem is that the library does some uri encoding, apparently it doesn't do a good job for this url. (the http://...
is encoded as http%3a//...
), and I just found this is even in the code (the not doing a great job part) https://github.com/svrooij/node-sonos-ts/blob/master/src/helpers/xml-helper.ts#L81-L87
Solution (/workaround)
If you just remove the http://
part from the url the commands start working (if you send the correct payload).
Can you confirm this helps?
from sonos2mqtt.
Yes, this does help! This command appears to work:
{
"command": "setavtransporturi",
"input": "x-rincon-mp3radio://ice3.somafm.com/groovesalad-64-aac"
}
Although it seems to choke on the colon again here:
{
"command": "setavtransporturi",
"input": "x-rincon-mp3radio://ice3.somafm.com:80/groovesalad-64-aac"
}
Your input to the adv-command
works too (after removing the http://
in my stream url). I use the CurrentURIMetaData parameter to set the title of the station. I stuff this ugly chunk of xml into the CurrentURIMetaData parameter in the SetAVTransportURI command:
<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/">
<item id="R:0/0/49" parentID="R:0/0" restricted="true">
<dc:title>$title</dc:title>
<upnp:class>object.item.audioItem.audioBroadcast</upnp:class>
<desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON65031_</desc>
</item>
</DIDL-Lite>
from sonos2mqtt.
How about (the node-sonos-ts library also has some metadata generation build-in):
{
"command": "adv-command",
"input": {
"cmd": "AVTransportService.SetAVTransportURI",
"val": {
"InstanceID": 0,
"CurrentURI": "x-rincon-mp3radio://ice3.somafm.com/groovesalad-64-aac",
"CurrentURIMetaData": {
"Title": "your_title",
"UpnpClass": "object.item.audioItem.audioBroadcast",
"ItemId": "R:0/0/49",
"CdUdn": "SA_RINCON65031_"
}
}
}
from sonos2mqtt.
Yes! That worked, and it's so much less ugly too π
from sonos2mqtt.
Related Issues (20)
- No status changes HOT 3
- Problem with docker image HOT 6
- Sonos Favorites Question HOT 9
- [Feature] Notification before TTS HOT 5
- [Feature] Support for audio formats on HDMI input HOT 4
- Don't set position to `NOT_IMPLEMENTED` HOT 1
- Not all Sonos players are available in MQTT HOT 2
- Configuration in Synology Docker Container HOT 2
- Docker container is very long to stop HOT 2
- bug: SONOS2MQTT_FRIENDLYNAMES env var doesn't work HOT 3
- Randomize AddToQueue HOT 1
- Frage: Ist es mΓΆglich den amazon:effect zu nutzen? HOT 2
- Support for certificates HOT 1
- favlist Readig empty after getting Sonos Favorites HOT 1
- Add loudness state to player state HOT 1
- Sonos2Mqtt Unraid validate distrinct = true HOT 4
- sonos2mqtt stops after reboot HOT 2
- notify-function does not work properly
- How to start playing a Sonos Radio, might be specific issue with "VRT Radio 1" HOT 2
- Group volume and balance HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonos2mqtt.