[BETA] Lutron Caseta Integration using Raspberry Pi (Pro or Standard Bridge) [DEPRECATED--See new Release thread instead]

No clean Mac that i installed this morn. Just installed 2.7.13

64bit version only I presume.

on Mac the 64/32 bits is the same installer. Gonna try Homebrew to install paramiko

See @sabray1’s post from december. He may be able to assist with mac installations as well.

Yeah will check it out. Just installed Homebrew and using it to install python so we will see

Hey sorry for the delay. So what I need you to do is add a line in the python script: I am not sure if you have a pro or non pro hub but here is what lines 145-155 should look like:

 try:
        body = json.dumps(json.JSONDecoder().decode(response)) 
        if (body.find("PRO") != -1):
            print "Pro Bridge Found"
            proBridgeSetup()
            print body
            return body
        elif (body.find("BDG") != -1):
            print "Standard Bridge Found"
            print body
            return body
    except ValueError: 
        print "Not valid JSON~This error may be normal the first time so don't stress!"

Basically you need to add those “print body” lines in there. This will print all the switch config data out during setup. Save the script and run it. Then go into the smartapp under automations and just wait about 20s and you should see a big block of output in the console. Just copy and paste that to me so I can figure out what the device type is for those non dimmers. Then I can get support added in. Thanks!

Also, this thread may be getting locked in order to move everyone over to the newest one found here [Deprecated] Lutron Caseta Connect V1.5

Keep in mind that we may need to change the existing DH or create a new one for this different Pico.

I’ll start looking into dynamically changing attributes of the existing DH based on what the service manager Finds during discovery.
numberOfButtons, tile layout, etc.

Hey sorry I guess I wasn’t clear enough…I need the output in the pi/server console not the ST IDE. Unfortunately ST truncates large outputs so it’s not reliable for what I need. So when you run the script and then run the smartapp on your phone you’ll see a whole bunch of output in the console. That’s what I need. Let me know if that makes sense.

1 Like

That makes a lot more sense :slight_smile:

Here’s the correct output:

{
“Body”: {
“Devices”: [
{
“Name”: “Smart Bridge”,
“Parent”: { “href”: “/project” },
“href”: “/device/1”,
“SerialNumber”: “xxxxxxxx”,
“RepeaterProperties”: { “IsRepeater”: true },
“ModelNumber”: “L-BDG2-WH”,
“DeviceType”: “SmartBridge”
},
{
“Name”: “Office Light”,
“Parent”: { “href”: “/project” },
“href”: “/device/2”,
“SerialNumber”: “xxxxxxxx”,
“ModelNumber”: “PD-6WCL-XX”,
“DeviceType”: “WallDimmer”,
“LocalZones”: [ { “href”: “/zone/1” } ]
},
{
“Name”: “Bedroom Light”,
“Parent”: { “href”: “/project” },
“href”: “/device/3”,
“SerialNumber”: “xxxxxxxx”,
“ModelNumber”: “PD-8ANS-XX”,
“DeviceType”: “WallSwitch”,
“LocalZones”: [ { “href”: “/zone/2” } ]
},
{
“Name”: “Office Pico”,
“Parent”: { “href”: “/project” },
“href”: “/device/4”,
“SerialNumber”: “xxxxxxxx”,
“ButtonGroups”: [ { “href”: “/buttongroup/2” } ],
“ModelNumber”: “PJ2-3BRL-GXX-X01”,
“DeviceType”: “Pico3ButtonRaiseLower”
},
{
“Name”: “Pico Bedroom”,
“Parent”: { “href”: “/project” },
“href”: “/device/5”,
“SerialNumber”: xxxxxxxx,
“ButtonGroups”: [ { “href”: “/buttongroup/3” } ],
“ModelNumber”: “PJ2-3BRL-GXX-X01”,
“DeviceType”: “Pico3ButtonRaiseLower”
}
]
},
“Header”: {
“Url”: “/device”,
“MessageBodyType”: “MultipleDeviceDefinition”,
“StatusCode”: “200 OK”
},
“CommuniqueType”: “ReadResponse”
}

Perfect thank you. So I added very basic support for your switch and you should be able to go into the smartapp an it should find/add it now. There is on caveat however…it is going to, for now at least, use the dimmer device type. I will work on creating a new device type and getting the code to chose the appropriate one, but in the meantime this should work. Please let me know if it doesn’t or you get weird results. I don’t have this switch to test so I am kind of guessing as to how it is implemented by Lutron. Let me know!

Ohh…To try it out simply update the Service Manager smartapp in the IDE from the git repo that should be it!

Yep that worked… but I see what you mean about the dimmer functionality on a non-dimmer switch.

Let me know if you want to try things out as you don’t have that device… I will gladly test it out for you.

Thanks!

Awesome glad it is working. Just out of curiosity. what happens if you use the level slider. Does it turn it on if you set it to any number or only all the way to 100?

Getting a new device handler is relatively trivial, I have already started the process, but it will require a bit of refactoring of the service manager which I am will need to think about first. I will let you know when it is ready.

Anything higher than 0% opens the light and resets the % to be 100.

1 Like

First post here…

Just wanted to thank njschwartz for this. This is a lot of work and I am seriously grateful!!

I’ve had SM for about a week now so I am still getting over the learning curve! I would say it look me almost 4 hours to get this working. I am running the python script on my Windows7 server and using a smartbridge pro.

I got was held up on a few things. Since this is all so new to me, I didn’t know if something was messed up or I was doing it wrong (or both haha)
Cygwin: I was getting download errors while downloading the modules. I was persistent and found a mirror that worked. After that, I didn’t know how to get the LutronPi.py file from github… I ended up copying the raw data, paste it to sublime, and save-as. Same with rsa_key. Once I had these files, I didn’t know what directory to put them under.

Then, what the hell is Twisted and paramiko??? lol On a hunch, I re-ran the cygwin setup and search for them… success. loaded.

Then onto editing the IPs. They are at the bottom for anyone looking.

When I tried to run the lutronPi.py, it was hanging up on line 25 (something like ipaddress). On a whim, I deleted line 25 and it is now running and I was seeing updates when I changed the lights.

There are FIVE Device Type Handlers. I was picking two (I have 14 dimmers and 18 picos) and the smartapp was failing at the last “Done”. I loaded all five and SUCCESS!

I am exhausted but the effort is worth the reward! Now, onto my new adventure!.. Lights!
:grinning:

Thank you very much for your feedback and appreciation. It is always great to hear about how the experience is and how well it is/is not working for different people. Everyone’s setup is different which is a challenge for sure. This is a somewhat complex project because there are so many parts as you mentioned. Getting the python stuff setup is by far the trickiest part and you probably took the toughest one getting it working on windows with Cygwin. I am constantly looking at and trying to find an option that will make setup easier or ideally get rid of the server requirement entirely, but as of yet I don’t have that.

Part of your pain, it sounds like, is that things have changed a fair amount from the beta version I discussed in this thread and the V1 release I put out about a week ago. You have all the latest code but the directions in this thread didn’t exactly match I am sure. Take a look at the other thread linked below where the latest conversation and advice can be found. Also, please let me know if you find any errors or issues of any kind as well as if there are features missing that might be useful to you. Thanks again!

1 Like

I am still waiting for a replacement Smart Bridge (they cannot explain why my old Smart Bridge Pro just stopped communicating with the local network). Just got the email from Lutron announcing their SmartThings support has begun. Would love to see some feedback on how responsive that cloud to cloud system is vs. this direct solution.

Mega bummer regarding the bridge. Really strange. I didn’t get that email. What did it say? I don’t see a Lutron smartapp anywhere so not sure if it’s available yet. I’ll try it out when it is.

I just tried it out and it is indeed fast. I think from first impressions anyway equivalent to my solution. We’ll have to see others thoughts on it are.

The upside is there’s nothing stopping you from using the official integration for the basic functionality and then only adding Pico’s and scenes using my stuff. That way even if your server goes most things will still work… Time will tell

1 Like

Wow…I’m really surprised at how responsive this integration is. Love having options.

2 Likes

Nate, everything is now working great with my new (working) Smart Bridge. Thanks for all your effort on this! It probably would have taken me a lot longer to figure out that my Smart Bridge was defective.