LutronPro Caseta v1.0
As many of you know, Lutron recently updated their app to support the new RA2Select hub they are putting out. When they did that they removed the SSH access that this and nearly every other 3rd party integration used to use to control the bridge breaking them. While this access isn’t 100% required for those with the Pro bridge, it was still very useful and made things simpler. Thanks to the work of @mathieuh who reverse engineered the new TLS connection, I have been able to update my app to continue to work for both Pro and non Pro Bridges. It does require a new step to get a code for generating the certs which I haven’t been able to automate yet.
Please note that this integration uses the newer Node server and not the Python version I originally created.
Currently my app will not work correctly on Windows due to an issue with auto generating the required certs using OpenSSL. If you are a windows user I hope to have a guide to do it manually very soon and I will post it here.
On windows just DL and install https://nodejs.org/en/download/
On a raspberry pi:
If you have an older Pi (B/B+ etc.) this guide should work: http://weworkweplay.com/play/raspberry-pi-nodejs/
If you have a newer Pi(2./3 etc.) try this one (the nodejs instructions are down towards the bottom): http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/12
Assuming you have node installed correctly simply type npm install lutronpro’ at the command line/terminal. This will install the server as well as all it’s dependencies automatically.
Paste the following url into your web browser and press enter. You should then login using your lutron credentials. You should then see something similar to the picture below. Copy the code. https://device-login.lutron.com/oauth/authorize?client_id=e001a4471eb6152b7b3f35e549905fd8589dfcf57eb680b6fb37f20878c28e5a&redirect_uri=https%3A%2F%2Fdevice-login.lutron.com%2Flutron_app_oauth_redirect&response_type=code
Go to my git repository: https://github.com/njschwartz/lutronpro and grab the runNodeServer.js file. You can either DL it or just copy the couple of lines of code into a file and name it runServer.js (or any name you want as long as it ends with .js). Make sure you change the two IP address to the correct ones for your network and enter your Lutron Login Info to allow the app to authorize for the new TLS server.
Where you see ‘var OAUTHCODE=’ replace it with the code you got in step 2.Place the file wherever you want and then at the command line (in the same directory you saved it) type ‘node runNodeServer.js’
If all goes according to plan the program will automatically generate the correct SSL certificates and use them to connect to your bridge. It will detect if you have a Pro bridge and attempt to connect to the Telnet server as well. You will see a lot of random text fly by as it sets itself up (I will be cleaning a lot of that up in the future but for now don’t worry about it).
In the ST IDE under ‘My SmartApps’ add the new repository ‘njschwartz lutronpro master’ From there install/publish the new service manager SmartApp.
Under ‘My Device Handlers’ using the same repo add the device handlers.
Configure the Smartapp on your phone or tablet
Finally open the ST App > Marketplace > My Apps and find the Lutron Caseta Service Manager. Select it and then wait until it finds your server.
Select it and choose Next and wait until it finds all of your switches and Pico’s.
Select them and choose Next. Now wait for your scenes to appear and select the ones you want.
Hit Done and Done again. That’s it! At this point all your Caseta devices should be available in ST and available to control directly or via other Smartapps, CoRE, etc.
Pico Setup: The Pico’s will appear as a device in the ST list, however alone they cannot do anything. You need to assign the buttons to a function. You can use a smartapp like ButtonController or CoRE/webCoRE to get them to do pretty much anything you could want.
Pico Button Mapping:
Additionally, you can adjust some of the settings in the runNodeServer.js file to alter how the Pico’s respond. The buttons respond as both a pressed event and a held event. You can adjust how long you have to hold a button to trigger the held event. You can also adjust how a held button responds as well. It can either send a single event or multiple events until the button is released (this might be useful if using it to adjust the volume for example). More directions can be found in the comments of the runNodeServer.js file.
That is about it. I have tested this on a raspberry pi, ubunbtu, and a windows machine (directions for windows pending) and it all seems to work. That being said, I am certain bugs will be found and I will respond to them as quickly as possible so please let me know if you find any. Thanks for trying it out!