VLC Thing. A Poor Man's Sonos. Version 2.0 Released 12/22/2016

Yeah. The platform is kinda shaky right now due to transition to hub V2 and mobile app 2.0. A lot of things are broken or in flux. I’m gonna hunker down for a few weeks until the dust settles. :wink:

5 Likes

@geko
I’m using VLCThing 1.2.2. It’s mostly working for speech but often doesn’t return speech and instead throws an error at the point where it calls def sound = textToSpeech(text, true) in myTextToSpeech(). This really looks like an inconsistent platform issue with calling SmartThings textToSpeech() function. What’s odd, is some phrases work and some do not and eventually phrases that didn’t work will suddenly work but may not later again.

I added some additional logging in the Device Type to verify this is the exact point where the issue is occuring:

private def myTextToSpeech(text) {
    LOG("Executing: textToSpeech(${text},true)")
    def sound = textToSpeech(text, true)
    LOG("Executing: sound.uri")
    sound.uri = sound.uri.replace('https:', 'http:')
    LOG("returning sound")
    return sound

}

Here is my log result:

11:34:45 AM: error java.lang.reflect.UndeclaredThrowableException @ line 571
11:34:44 AM: trace Executing: textToSpeech(Warning, Warning: Laundry Outside Door is now closed,true)
11:34:44 AM: trace playTextAndResume(Warning, Warning: Laundry Outside Door is now closed, 95)

Line 571 in my code (with the extra logging) is def sound = textToSpeech(text, true) which is line 570 in your code.
So you see it bombs and halts execution when calling textToSpeech(text, true) and never progresses further to sound.uri = sound.uri.replace('https:', 'http:') or return sound.


For what it’s worth, below is a log of when this same phrase worked during a later attempt:

11:59:48 AM: trace Skipping event generation for sound file http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3
11:59:48 AM: trace Track info: [filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3])
11:59:48 AM: trace parseHttpResponse([position:0, information:[category:[meta:[filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3]], chapters:[], titles:[]], stats:[averagedemuxbitrate:0, playedabuffers:0, demuxreadpackets:0, lostabuffers:0, displayedpictures:0, averageinputbitrate:0, decodedaudio:0, demuxdiscontinuity:0, lostpictures:0, sentpackets:0, inputbitrate:0, decodedvideo:0, demuxreadbytes:0, sentbytes:0, sendbitrate:0, readpackets:0, demuxbitrate:0, readbytes:0, demuxcorrupted:0], videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:playing, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, loop:false, audiodelay:0, volume:256, length:0, audiofilters:[filter_0:]])
11:59:47 AM: trace Skipping event generation for sound file http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3
11:59:47 AM: trace Track info: [filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3])
11:59:47 AM: trace parseHttpResponse([position:0, information:[category:[meta:[filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3]], chapters:[], titles:[]], stats:[averagedemuxbitrate:0, playedabuffers:0, demuxreadpackets:0, lostabuffers:0, displayedpictures:0, averageinputbitrate:0, decodedaudio:0, demuxdiscontinuity:0, lostpictures:0, sentpackets:0, inputbitrate:0, decodedvideo:0, demuxreadbytes:0, sentbytes:0, sendbitrate:0, readpackets:0, demuxbitrate:0, readbytes:0, demuxcorrupted:0], videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:playing, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, loop:false, audiodelay:0, volume:256, length:0, audiofilters:[filter_0:]])
11:59:47 AM: trace Skipping event generation for sound file http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3
11:59:47 AM: trace Track info: [filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3])
11:59:47 AM: trace parseHttpResponse([position:0, information:[category:[meta:[filename:http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3]], chapters:[], titles:[]], stats:[averagedemuxbitrate:0, playedabuffers:0, demuxreadpackets:0, lostabuffers:0, displayedpictures:0, averageinputbitrate:0, decodedaudio:0, demuxdiscontinuity:0, lostpictures:0, sentpackets:0, inputbitrate:0, decodedvideo:0, demuxreadbytes:0, sentbytes:0, sendbitrate:0, readpackets:0, demuxbitrate:0, readbytes:0, demuxcorrupted:0], videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:playing, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, loop:false, audiodelay:0, volume:486, length:0, audiofilters:[filter_0:]])
11:59:47 AM: trace vlcGet(/requests/status.json?command=volume&val=256)
11:59:47 AM: trace vlcCommand(command=volume&val=256)
11:59:47 AM: trace setLevel(50)
11:59:47 AM: trace vlcGet(/requests/status.json?command=volume&val=256)
11:59:47 AM: trace vlcCommand(command=volume&val=256)
11:59:47 AM: trace setLevel(50)
11:59:47 AM: trace vlcGet(/requests/status.json)
11:59:47 AM: trace delayHubAction(500)
11:59:47 AM: trace vlcGet(/requests/status.json?command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace vlcCommand(command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace playTrack(http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace returning sound
11:59:47 AM: trace Executing: sound.uri
11:59:46 AM: trace Executing: textToSpeech(Warning, Warning: Laundry Outside Door is now open,true)
11:59:46 AM: trace playText(Warning, Warning: Laundry Outside Door is now open)
11:59:47 AM: trace parseHttpResponse([position:0, videoeffects:[brightness:1, contrast:1, gamma:1, saturation:1, hue:0], random:false, state:stopped, repeat:false, subtitledelay:0, equalizer:[], apiversion:3, version:2.0.3 Twoflower, fullscreen:0, time:0, rate:1, length:0, volume:486, audiodelay:0, loop:false])
11:59:47 AM: trace vlcGet(/requests/status.json)
11:59:47 AM: trace delayHubAction(500)
11:59:47 AM: trace vlcGet(/requests/status.json?command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace vlcCommand(command=in_play&input=http%3A%2F%2Fs3.amazonaws.com%2Fsmartapp-media%2Ftts%2F5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace playTrack(http://s3.amazonaws.com/smartapp-media/tts/5e25ed0c566c28a7c4de06b6e96d048a8f96b2a5.mp3)
11:59:47 AM: trace returning sound
11:59:47 AM: trace Executing: sound.uri
11:59:46 AM: trace Executing: textToSpeech(Warning, Warning: Laundry Outside Door is now open,true)
11:59:46 AM: trace playText(Warning, Warning: Laundry Outside Door is now open)
11:59:46 AM: trace vlcGet(/requests/status.json?command=volume&val=486)
11:59:46 AM: trace vlcCommand(command=volume&val=486)
11:59:46 AM: trace setLevel(95)
11:59:46 AM: trace vlcGet(/requests/status.json?command=volume&val=486)
11:59:46 AM: trace vlcCommand(command=volume&val=486)
11:59:46 AM: trace setLevel(95)

Yeah, it used to work flawlessly, but SmartThings TTS has been broken for quite a while. Someone mentioned that if the phase is already present in the S3 cache, then it might works. Otherwise it barfs. Unfortunately, considering the perpetually sorry state of the platform, I can’t waste my time troubleshooting it.

2 Likes

Understood. The state of the platform is killing my soul in my will and desire to update/troubleshoot/support my own SmartApps too.

1 Like

Interesting… I have no issues with new phrases.

Yeah that’s a real bummer because – at least on the surface – it appears that it would be an easy fix. And considering the impact – or at least the benefits to all the people that use Sonos for custom phrases – it’s low hanging fruit. Fix that issue and at least you can give people a 100% working solution for one part of the platform.

The fact that A LOT of things just “kinda work but sometimes not really” – like random events, mobile presence, the Sonos TTS bit – just makes things look worse than they are.

1 Like

@geko I now got this error using VLC Thing on Raspberry Pi:
6985fd2a-03f5-4bb9-b865-c794eb25af4b 10:35:20 AM: error groovy.json.JsonException: Lexing failed on line: 1, column: 1, while reading ‘<’, no possible valid JSON value or punctuation could be recognized. @ line 185

I use it with BigTalker smartapp. Do you know what is this error?

Ignore this. I found out the issue. The wired network to Raspberry Pi had problem.

Are there any current known issues for getting this running? Any extra steps not included in the original directions? I tried to follow the directions closely, but nothing happens when I hit “Test” in ST app on Android. I’m not even sure what info to give to receive help? I’m a novice, so you may need to ELI5.

Did you make sure inside VLC your port is 8080, and you reflect that in the ST app as well?

That may be the issue. I found a place to change the LUA Telnet port in VLC settings. Is that it?

Yes, there and also in the app when you are setting it up

Nothing happens for me either when I press “TEST”. What could I be doing wrong? Here are my settings:

Smartthings IDE
Device ID: C0A80108:1F90

Windows 7 PC
Computer’s IP: 192.168.1.8
VLC HTTP server port: 8080
VLC - Lua port: 4212
VLC - Lua password: test123

Smartthings Mobile App
VLC IP address: 192.168.1.8
VLC TCP port: 8080
VLC password: test123

Help please!!

They seem to have fixed the TTS recently. Can you give it another go when you have some time?

Edit: Just tried ti again today. TTS functions seem to be working better. I’m still having trouble getting VLC Thing to work with the Mood Music Smartapp. I can’t get any songs I add to the VLC playlist or library to show up in Mood Music.

2 Likes

It works for my C.H.I.P integration project.

@veni, I fixed a problem by first trying to access the computer running VLC from another as mentioned earlier in this thread. In my case, I entered 10.0.0.187:8080 in my web browser. A dialog comes up asking for a user id and password. Skip the user id and enter your password: test123. If it works, you’ll get a player controls in the browser. If you can’t get access, you may have firewall issues. I haven’t done Windows in years so I can’t help you with that.

I tried installing VLC Thing last night and also had trouble getting the SmartThings app to see the installation. On a whim, I tried browsing to what I thought was the correct address and port via a web browser and found that another piece of software on my computer (iSpy webcam software) was already running on VLC’s default port (8080). Turns out you can modify VLC’s port with a command-line argument, and once I changed the port it worked perfectly!

@gcortes, thank you for the tip, some other random app was using the default port. Now it works perfectly.

OK I have installed this, the test file works, but when I go to the Sono app, I do not see where I can select the track that I want to play. Any suggestions?

I’m a bit confused. I have the Android version of the VLC Media Player app installed on my Galaxy S4. It works fine. I’ve also installed the VLC Thing ST device (per the author’s instructions), but some of the installation configuration requirements don’t seem to match up with the Android Media Player app. For instance, it requires a TCP Port and a password for the VLC app, but the Android version of the app provides no way to set either. I see that other versions of the app use port 8080 by default, so I’m attempting to specify that in the device config, but it seems like you ought to be able to change that in the Media Player app in the event of a conflict.

In addition to that there’s no place in the Media Player app for me to establish a password, so I have no idea what to enter in the ST device field for that. I left it blank for now.

So, doing all that I attempt to use the “Test” button on the device panel and it does nothing. What am I missing?