SmartThings Community

RELEASE Generic Media Renderer (DLNA Speakers). Cheap Sonos Alternative (Update V2)

dth_speakers
dth_voice
dth_alerts
(Ule) #507

HI @ATrain, what smartapp are you using?

(Ule) #508

Hi , @ATrain, are you using media renderer events?, in logs copy the url sent to speakers, and paste in a web browser to check if the audio is correct, possible your rss key is incorrect.

(Jason "The Enabler" as deemed so by @Smart) #509

Hi, I’m new to dlna and I’ve set this up. I’m using a pure jango Wi-Fi speaker. I’m not playing music, just using it for notifications and alerts.

The problem is that there is a huge delay and the first have of the message is cutoff.

For example…

“The front door is open” is heard as " is open".

Any help would be greatly appreciated.

#510

Have you tried to use the Delay before Message option? Try increasing the seconds.

(Adam) #511

@ule

I am using speaker notify with sound, but it no longer has the option for custom TTS. Looks like maybe tomorrow there will be a new release.

(Ule) #512

Hi @ATrain, try to use

(Ule) #513

Hi, the delay before message its when an audio cuts off at the end “the door is…” this means the speaker takes more time to load the audio, the delay adds more time “The door is opened” but, when the audio cuts off at beginning, the problem must to be the speaker , some speakers load the mp3 in several ways, maybe jongo have setting to allow gapless music, just check setting. maybe @BristolBaz can help us if the audio cuts off at the begining in these speakers.

(Jason "The Enabler" as deemed so by @Smart) #514

I’m using a jongo speaker and its doing this too…

(Ule) #515

Hi @bamarayne, the post was about your question, @Mclovin50, just answer you about the delay, but I think its the speaker, @BristolBaz, has shared the jongo speakers works with mediarenderer, maybe he can help us to known if the problem its with all jongo speakers, or needs some setting to fix it, you can add a prefix in your messages like “Mesage, the door its opened” when the audio cuts at the beginning " the door its opened" will be complete, if you have other speakers all the sentence will be played

(Jason "The Enabler" as deemed so by @Smart) #516

Thank you for the response. I am trying the “fill in the gap text” but haven’t had much time for testing.

I wanted the other jongo users to know it’s not just their speakers.

The delay at the beginning is kind of a bummer. It makes for a huge delay for tts, which ask I use the speakers for.

I’ll treat more this evening and post my results.

(Ule) #517

HI, I have made a TTS to ask Alexa, basically its other TTS engine, but this question is answered by Alexa,

Ex: “Tell me a joke” and in your speakers “why the chiken …”

its in beta stage , but I need help to test it

thanks

(ilker Aktuna) #518

@ule

I am using Generic Media Renderer to control my Sonos speakers through ST. Merely because with your app I can use my own language TTS.

But today I noticed that volume controls do not work with your device handler. (volume up/down, mute)
Is this a known issue ?

Thanks.

(ilker Aktuna) #519

Hi,

This is very important for me because I use your device handler for my Sonos speakers.
And TTS works very nice (thanks)

But I need the volume to work. How can I fix this ?

(Stuart Buchanan) #521

@ule confirmed your device handler does not retrieve the volume level for the sonos players correctly. you get the following error

groovy.lang.MissingMethodException: No signature of method: static java.lang.Math.round() is applicable for argument types: (null) values: [null]
Possible solutions: round(float), round(double), find(), rint(double), find(groovy.lang.Closure), random() @ line 585

the code on line 585 is the follwing

result << setVolume(currentVolume)

the issue is that the value of currentVolume is null when parsing the response for volume the Sonos’s are returning the following ClientUPnPError401

1 Like
(ilker Aktuna) #522

thanks. what can be the solution ?

(Stuart Buchanan) #523

didn’t quite get that far yet. I can successfully get the current volume value from a Sonos,

by using the following code

def getVolume()
{
	//mediaRendererAction("GetVolume", "RenderingControl", getDataValue("rccurl"), [InstanceID:0, Channel:"Master"])
    mediaRendererAction("GetVolume", "RenderingControl", "/MediaRenderer/RenderingControl/Control", [InstanceID: 0, Channel: "Master"])
}

but it breaks all other standard DNLA mediarenderer device, i’m trying to unpick and figure out why, but i just dont know enough about the underlying MediaRenderer commands :frowning:

(Ule) #524

Hi @Fuzzyligic, Sorry I have not an Sonos to check , but you can help me to find a fix, could you confirm the action when the error appears?

1.- When play a sound with audio level change?

2.- When change the audio in slide bar?

3.- Both?

Thanks

(Stuart Buchanan) #525

Hi @ule the answer is both. the slider for the volume for the sonos always reports as 0 which is because it gets a null return and changing to volume does absolutely nothing because of the same issue

i have been trying to figure out the differences between your command, the one commented out above and the one i have used also

what i am scratching my head about is this part

GetDataValue(“rccurl”)

i dont get where rccurl is defined? or is that a value name in the returned XML? not sure yet as is truncated.

p.s. i have created a pull request with some spelling corrections etc… to the events app

(Stuart Buchanan) #526

hi, further note i can see that onall my sonos’ i can see the value of rccurl is

/MediaRenderer/GroupRenderingControl/Control

and when this is used the level field returned is actually blank, currently my sonos’s aren’t in a group, and i’m pretty sure they weren’t when they were created (i’m just gonna test that now as i can see that rccurl is defined at the point of creation from the parent smartapp)

{
    "station": "SmartThings Message",
    "name": "SmartThings Message",
    "artist": "",
    "album": "SmartThings Catalog",
    "trackNumber": "1",
    "status": "stopped",
    "level": "",
    "uri": "http://tts.urbansa.com/tts.php?1458762652769=Stuart%2520Is%2520Home%253F%26Input.Type%3Dtext%252Fplain%26OutputFormat.Codec%3DMP3%26OutputFormat.SampleRate%3D22050%26Parameters.Rate%3Dmedium%26Voice.Language%3Den-GB%26Voice.Name%3DBrian%26X-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Credential%3DGDNAJOWNTAKWOZ5S7S7Q%252F20160323%252Fus-east-1%252Ftts%252Faws4_request%26X-Amz-Date%3D20160323T195052Z%26X-Amz-SignedHeaders%3Dhost%26X-Amz-Signature%3D2f6ab1f8777d930c98bc10a24bb8f52d0173510ee6d5b829ad6c8b7db27c636c&ts=1458762653070",
    "trackUri": "http://tts.urbansa.com/tts.php?1458762652769=Stuart%2520Is%2520Home%253F%26Input.Type%3Dtext%252Fplain%26OutputFormat.Codec%3DMP3%26OutputFormat.SampleRate%3D22050%26Parameters.Rate%3Dmedium%26Voice.Language%3Den-GB%26Voice.Name%3DBrian%26X-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Credential%3DGDNAJOWNTAKWOZ5S7S7Q%252F20160323%252Fus-east-1%252Ftts%252Faws4_request%26X-Amz-Date%3D20160323T195052Z%26X-Amz-SignedHeaders%3Dhost%26X-Amz-Signature%3D2f6ab1f8777d930c98bc10a24bb8f52d0173510ee6d5b829ad6c8b7db27c636c&ts=1458762653070",
    "transportUri": "http://tts.urbansa.com/tts.php?1458762652769=Stuart%2520Is%2520Home%253F%26Input.Type%3Dtext%252Fplain%26OutputFormat.Codec%3DMP3%26OutputFormat.SampleRate%3D22050%26Parameters.Rate%3Dmedium%26Voice.Language%3Den-GB%26Voice.Name%3DBrian%26X-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Credential%3DGDNAJOWNTAKWOZ5S7S7Q%252F20160323%252Fus-east-1%252Ftts%252Faws4_request%26X-Amz-Date%3D20160323T195052Z%26X-Amz-SignedHeaders%3Dhost%26X-Amz-Signature%3D2f6ab1f8777d930c98bc10a24bb8f52d0173510ee6d5b829ad6c8b7db27c636c&ts=1458762653070",
    "enqueuedUri": "",
    "metaData": "<DIDL-Lite xmlns=\"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:upnp=\"urn:schemas-upnp-org:metadata-1-0/upnp/\" xmlns:dlna=\"urn:schemas-dlna-org:metadata-1-0/\"><item id=\"1\" parentID=\"1\" restricted=\"1\"><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><upnp:album>SmartThings Catalog</upnp:album><upnp:artist>SmartThings</upnp:artist><upnp:albumArtURI>http://graph.api.smartthings.com/api/devices/icons/st.Entertainment.entertainment2-icn?displaySize=2x</upnp:albumArtURI><dc:title>SmartThings Message</dc:title><res protocolInfo=\"http-get:*:audio/mpeg:*\" >http://tts.urbansa.com/tts.php?1458762652769=Stuart%2520Is%2520Home%253F%26Input.Type%3Dtext%252Fplain%26OutputFormat.Codec%3DMP3%26OutputFormat.SampleRate%3D22050%26Parameters.Rate%3Dmedium%26Voice.Language%3Den-GB%26Voice.Name%3DBrian%26X-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Credential%3DGDNAJOWNTAKWOZ5S7S7Q%252F20160323%252Fus-east-1%252Ftts%252Faws4_request%26X-Amz-Date%3D20160323T195052Z%26X-Amz-SignedHeaders%3Dhost%26X-Amz-Signature%3D2f6ab1f8777d930c98bc10a24bb8f52d0173510ee6d5b829ad6c8b7db27c636c&amp;ts=1458762653070 </res></item> </DIDL-Lite>"
}
(Ule) #527

Hi @Fuzzyligic, could you post the logs when you change the value in the slider. Thanks