Lutron Caseta Control w/ Raspberry Pi

Thanks for sharing! I’m happy to help out. I’ve had a ST hub for a while now but I’ve only used a couple ZigBee bulbs and my Harmony remote. I wasn’t impressed with Leviton or GE switches and dimmers but I fell in love with the style of the Lutron switches and knew I had to somehow make them work. I just today got started with my Smart Bridge Pro. I have 3 in wall dimmers and I also have a couple plug in dimmers with Pico remotes (another big selling point to Lutron). You won’t get any judgement from me on your code! Getting things working with the Pro Bridge probably won’t be too hard. There are some pretty robust Telnet libraries for Python that can take care of calling out to it. Refactored, the code could easily work with both. I’ll try and take a look at it this weekend.

1 Like

I was the same way. Wanted to go all z-wave but just didn’t love the GE and Leviton switches either. :confused: I really wish Lutro Caseta had a fan controller. Don’t understand why they don’t. With the pro bridge you will have some more options (ramp rate, more info from the pico remotes) from what I understand. The telnet interface uses a different command structure from the ssh that I implemented. It uses the Lutron Interface protocol which has a lot better documentation. Anyway I look forward to hearing what you think and if it works at all for you. Thanks!

2 Likes

Itching to try it! Will just run your Python script on my phone which also runs LANnouncer.

Try it out and let me know if it works. I gave some instructions in that earlier post. Once at least one person tries it and confirms it works for them I’ll do a better write up to explain the install process. I had no idea you could run Python on a phone. Can you install the dependencies you need too? That’s pretty cool. Good luck and let me know if it works or you run into any issues.

1 Like

I’m itching to test this out, I’ve packed up my Lutron Hub in readiness for a house move, I might have to dig it out :slight_smile:

If this works reliably, and I don’t doubt it will, I know I can then go for Lutron switches and Pico’s for the new house with is a big relief. THANK YOU

I’m also going to forcus on ensuring that I can auto start the Pi so any issues a simple reboot will bring back everything OK. I’ve not fully tested a Pi running over PoE (via a splitter) but I can’t see why that won’t work - a simple watchdog on the IP interface to monitor for ping response, power cycle if it stops should hopefully make this set and forget.

Great work, much appreciated.

1 Like

This sounds really promising! I tried something similar about 6 months ago with my Smart Bridge Pro. I had a few Python CGI scripts running on a Windows machine that would turn lights on/off, but I never took the time to get them to work with SmartThings. I’ll be following your progress closely!

1 Like

Everything seems to work if you are willing to give it a try. I have had it running on my raspberry pi non stop for about 2 weeks with zero issues. The devices show up in ST with correct state and are controllable from ST as well allowing for things like motion triggering lights etc. I see almost no appreciable delay either. It needs to be packaged up a bit better and I need to make some good instructions for others who may be interested in trying it out, but the functionality is there at least.

The only caveat is that I have the non pro Smart Bridge and therefor am unable to promise it will work with your setup but I think it should. If you decide to try it out let me know. Thanks a lot!

Nate

3 Likes

I’ll try to give it a shot when I get some time. I’ll let you know if I run into any hiccups.
Erik

Sounds great. Would love to get some feedback. Always hard to know if I created something that works for anyone or just myself. lol

2 Likes

I have the Pro version of the SmartBridge, does anyone know if that works without additional mods? keen to test this too.

Hi - this setup looks very interesting. I have a raspberry pi but having a hard time following the instructions mentioned in post above, given limited experience with the pi.
Any more guidance would be greatly appreciated.
Thank you

Hey @Patgarbizu. Can you be more specific with what issues you are having? I am happy to guide you through it as much as I can. Let me know where you are at.

Hey @Patgarbizu Just realized what post you replied to. Check out the following link. It has a much more detailed directions on how to get things setup. Hope that helps and if you still have questions feel free to ask.

https://community.smartthings.com/t/beta-lutron-caseta-integration-using-raspberry-pi/62748

1 Like

Will try this weekend but thanks for the quick reply.

1 Like

Dear njscwartz, tried the instructions and works very well. Thank you very much for the directions and for the great code!

3 Likes

I’ve just read that Lutron will be releasing formal ST support, press announcement from CES this week. Not sure when but early 2017 is quoted in various articles.

what I have achieved thus far is to SSH into my Lutron Smartbridge

@njschwartz How did you do this? Is it still possible? This would help me out a ton.

Thanks!

Edit: Appears to be a widespread problem related to the ssh key: https://github.com/gurumitts/pylutron-caseta/issues/14
Might just have get the SmartBridge Pro to avoid these issues.

Hey @moustachesteve What are you trying to do exactly? I have indeed got things working. Take a look at LutronPro Caseta v1.0. It can connect to either a regular or pro smartbridge and integrate it with ST. The Picos only work with the pro bridge however.

Perfect, that’s everything I was looking for and more, thanks @njschwartz!

Just wanted to point out that I did have to make a tweak to the code in lutronpro.js - on lines 99 and 104 it’s doing fs.writeFileSync and threw this error:

Expected options to be either an object or a string, but got function instead

Looks like writeFileSync doesn’t accept a callback so I just took that third parameter out altogether and it ran fine (maybe you had it using the async version before?)

Thanks again for your work on this - I had been searching around but all I saw were people talking about SSH being broken and I hadn’t seen any fixes yet.

Ohh yea thanks for the heads up there. Someone else mentioned the same thing and I haven’t had a chance to look into it. Kinda weird it works for some and not others. Not sure, but I will look into it and fix it. Glad you found what you needed though! :slight_smile: