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

Type ‘ifconfig’ in the terminal and look for ‘en0:’ section. There you should see a line starting with ‘inet’ followed by your local IP address.

You can find it on your router. Login to the router and look for the device in the LAN list, or Attached Devices, etc.

VLC Thing Version 2.0 is Released!

I’m pleased to announce release of the VLC Thing Version 2.0.

What’s new in this release?

  • Completely redesigned UI using new multi-attribute tile.
  • Implemented automatic polling to update status every minute.
  • Refresh button now shows connection status: Green - connected, Red - disconnected.

Please visit to my Github repository to grab the latest version.

4 Likes

Awesome. Glad to see this is being maintained.

I’m enjoying your VLC Thing device handler. Amazing job. But I’m getting a “No signature” error on line 270 — see below.

Happens when the “Speaker Mode Music” SmartApp requests a specific track be played.

A little backgournd. I tried the “Speaker Notify with Sound” app but didn’t like the sound options.

My idea was to create my own collection of sounds and store them on the Raspberry Pi and use Speaker Mode Music to play a selected track. The Speaker Mode Music app displays the list of available sounds and allows me to select one. When I attempt to play that selection I get the “No Signature” error on line 270.

Note: I would try to find a solution myself but being an old C++ programmer I find Groovy a bit hard to comprehend and the SmartThings debugging tools leave EVERYTHING to be desired. It’s kind of a punch card environment. — yes, I’m that old.

Here is the error:

ad55e778-57cd-42c5-b92b-2d6e3594ebe2 8:09:11 AM: error groovy.lang.MissingMethodException: No signature of method: static java.net.URLEncoder.encode() is applicable for argument types: (java.util.HashMap, java.lang.String) values: [[station:Stripper.mp3, filename:Stripper.mp3], …]
Possible solutions: encode(java.lang.String), encode(java.lang.String, java.lang.String), decodeJs(), encodeAsJs(), hashCode() @ line 270

It looks like the uri is not formated correctly.

I put in a couple of log.debug statements and forced the command variable to an appropriate value and this works.

My code in the playTrack routine:
// MusicPlayer.playTrack
def playTrack(uri) {
//log.debug "playTrack(${uri})"
log.debug “uri: $uri”
// def command = “command=in_play&input=” + URLEncoder.encode(uri, “UTF-8”)
def command = "command=in_play&input=file:///home/pi/Sounds/stripper.mp3"
log.debug command
return apiCommand(command, 500)
}

Debug output:
ad55e778-57cd-42c5-b92b-2d6e3594ebe2 7:39:48 AM: debug command=in_play&input=file:///home/pi/Sounds/stripper.mp3
ad55e778-57cd-42c5-b92b-2d6e3594ebe2 7:39:48 AM: debug uri: [station:Stripper.mp3, filename:Stripper.mp3]

So it looks like from the video here https://www.youtube.com/watch?v=xJvTwSTqfi0 “VLC Thing” allows you to control a PC running VLC is that basically correct? With Sonos you could play tracks from your phone to your Sonos system but I don’t think that is possible with this is that correct? I’m also wondering if this would work with multi room, like if I had a cheap “netbook” kind of PC in each room with VLC and a speaker, could you pick which room you want it to go to?

Problem resolved.

I have VLC running on a Raspberry Pi but VLC will run on just about any computer. This device handler allows SmartThings to communicate with VLC regardless of the computer VLC is running upon.

My implementation provides sounds when SmartThings events happen… such as motion at the front door or mail being placed in the mailbox.

1 Like

I am having the clipping issue, like most of you it’s at the beginning. I see one response that seems to discuss timing of when the sound stops, so that’s a different issue. I am able to fudge it with adding periods (spaces don’t work). But its not consistent. Another solution mentioned wired vs. bluetooth, I am using HDMI and will be testing plain old speakers and bluetooth in the next few days. I don’t think this is an ST issue, surely not a VLC Thing issue. The sound being captured is exactly what I send. When I play the clip from the playlist in VLC it randomly works, this means its all there and this means VLC Thing worked. At least that’s how I see it. If others having this issue will please try to replay the sound files from the playlist it will help. But don’t be discouraged if it doesn’t work, try it several times. Also try to build up a playlist with 3 or 4 messages and start from the top. If you do try it, please post the results. It’s a shared problem, if we work together we can likely get to the bottom of it.

Bill

Connected a cheap bluetooth speaker the problem goes away. Back to HDMI, problem comes back. So for those of you experiencing the first 5-10 characters being cropped when a message is played, in my case it looks like the issue is between VLC and the windows device (in this case AMD HDMI), nothing to do with ST or VLC Thing. Not pursuing it further, hopefully others will find this helpful.

Amazon is selling Refurbished Logitech Z50 Speakers for only $8.99. They are small and have 10-watts output which will fill a room. They plug into the headphone jack on the RPi so you don’t have to add an amp hat. Work wonderfully.

Great, is the range decent? I’m not getting more than 10ft out the ones I bought, but I’m not surprised. Well I also bought a crap BT USB dongle.

Not sure which Range you are referring to… Dynamic Range — base is not that strong but sufficient, or Range (distance) — we have a large ranch style house and I can hear this quite well several rooms away. I’m using the first one to give sound to events happening within Smartthings. It plays AOL’s old “you’ve got mail” when the mailbox is open, rings like a doorbell when the doorbell button is pressed, and barks like a dog when motion is detected at the front porch. I’m working on a Slide Whistle sound when the Garage Door is open. The second one (now on order) will be placed in the study in the back of the house. I may order a third for my shop way out in the backyard.

Sorry, yes I a meant distance. That’s great, I’m giving this item a try - thanks for the post! Now we’ll be verbally informed when doors are left open (most importantly refrigerator in the garage), and contacts are open when the system is armed. Love this community, there’s a solution for everything. Definitely looking into the dog bark!

Hi Gary,

Would you be so kind as to provide the changes you made to the code to resolve the issue? I’m running into the same error @ line 270 when trying to use the Mood Music SmartApp. Thanks!

7:23:58 PM: info Playing '[minor_version:0, station:Sanford and Son Intro.mp3, filename:Sanford and Son Intro.mp3, compatible_brands:isommp42, major_brand:mp42]

7:23:58 PM: error groovy.lang.MissingMethodException: No signature of method: static java.net.URLEncoder.encode() is applicable for argument types: (java.util.HashMap, java.lang.String) values: [[minor_version:0, station:Sanford and Son Intro.mp3, ...], ...]
Possible solutions: encode(java.lang.String), encode(java.lang.String, java.lang.String), decodeJs(), encodeAsJs(), hashCode() @ line 270

I don’t know if the way I’m using VLC Thing is like you are. I have my sound files residing in a folder on the RPi.
For me, the sound files reside in folder
/home/pi/sounds.

The trick is to specify the URL in a proper format.
file:///home/pi/sounds/filename.mp3

(yes, that is 3 slash symbols)

So, the modifications to “Speaker Notify with Sound” are as follows:

Add an entry to the Input “ActionType” at line 78 for each of your sound files. For my mailbox sound I added:
“You’ve Got Mail”

For each case added above, you need of add one cases in routine loadText() at the bottom of the program. Here is the “You’ve Got Mail” entry
case “Youve Got Mail”:
state.sound = [uri: “file:///home/pi/sounds/YouveGotMail.mp3”, duration: “2”]
break;
The case identifier must match the Action Type exactly and the uri must be formatted correctly as defined above.

Hope this helps. I’m always available if you need more help…
… Gary

Thanks Gary! I’m using pretty much the same setup, RPi2 with sounds stored in /home/pi/Downloads and added to the playlist in VLC. Looks like difference is the SmartApp I’m trying to use. While Mood Music lists the files in my VLC playlist, it errors when trying to play them. I understand what you’ve done though, you’ve modified Notify with Sounds to add additional sound selections. That’s a great workaround, thanks!

I do like the Mood Music interface better and am still trying to debug it to pickup the URI returned from Vlc Thing. But, I wanted to get something running NOW. So, modified the Speaker Notify with Sound app. I have so many projects on my list… even being retired, I don’t have the time to do everything.

One more thing… you may already know this but thought I pass it along.

I use a combination of VNC and Filezilla to remotely manage all my RPi’s. This allows me to operate everything headless (no monitor, keyboard, or mouse). VNC gives you a virtual desktop on my windows desktop for each RPi and Fillazilla allows me to transfer files between all the devices devices — such as adding new sounds or changing old ones.