DLNA Player and Media Render warning message

Many thanks @Ryan780 i will give it a try but it's gonna be next week now when i have time. Takes a while re selecting the speaker in all the rules lol. Working on old one for now.

1 Like

Actually... The problem is not with how the volume is being set.... It's with the data that is being passed to the function. The playByMode() function calls the setVolume() function with the "currentVolume" variable... This variable is defined by a call to device.currentState("level"), which returns a state object. The correct call should be to device.currentState("level").value to get the numerica value of the state.

I also found the the playByMode() function did not operate correctly, which is why the playTextAndRestore(), playTextAndResume(), playTrackAtVolume(), playTrackAndResume(), playTrackAndRestore(), playSoundAndTrack() and speak() functions did not function correctly. The playByMode() function builds an array of hub actions to send to the DLNA device... basically...

setVolume / setPlaymode / setTrack / play / delay / stop / setVolume / setPlaymode / setTrack / Play

This set the desired volume, sets the tts file as the track and plays the track... then delays for the length of the tts track... then stops playback... restores the original volume, sets the original track and starts it playing...

However, the "delay" hub action only works for Zigbee and Z-Wave protocols. So what happens is that the DLNA device is told to play the tts file then immediately stop the tts file, so it appears that it does not work.

I have refactored the function so that the required delay is used, and the functions now work as originally intended.

The updated version is v2.6.1

1 Like

Thank you for this, before I used SmartThings with hublink to get the trackDescription, but the new update is the best.
However I'm getting this error, can you help me fix it please?

From the log:
" org.xml.sax.SAXParseException: The element type "CurrentTrackMetaData" must be terminated by the matching end-tag "". on line 186 (parse) "

From the event:
" org.xml.sax.SAXParseException; lineNumber: 26; columnNumber: 3; The element type "CurrentTrackMetaData" must be terminated by the matching end-tag "". "

Thanks for your help and hard work.