Thanks to @njschwartz, @BHO, @stephack, @Paul_Sheldon, @dalec and @bravenel, SmartThings users now have the ability to program inexpensive Lutron Caséta Pico remotes in a way that hasn’t been available to consumers since the introduction of the now, ill-fated Staples Connect hub.
If you have the patience to follow these step by step directions, you can setup a low cost bridge between SmartThings and a Lutron Caséta Pro SmartBridge that will let you program up to 50 Lutron Caséta Pico remotes to easily control just about anything you want, for just $15-$20 per remote. Unlike the official Lutron/SmartThings integration, this setup does not require a Lutron wall switch, dimmer or plug-in module to function. This cloud-based solution is fast and relatively stable as long as the internet, and your Node.js server are connected to the network and running.
All 5 of the Lutron PJ2-3BRL Pico remote buttons are accessible, with up to two automations per button. Compared that with a Flic button (not to pick on their cool little button) at $35 a button, they have only three automations per button, which have to be memorized since it’s not feasible to label all three click, double-click and hold actions on a single button. Flic buttons also require a dedicated smartphone, tablet or a $100 Flic hub to use them. There are higher cost Z-Wave choices, low cost/quality Zigbee choices and the now, hard to find Lutron Connected Bulb Remote, which was a four button Zigbee remote, similar to a 4 button Pico, but it could be paired directly with a bulb, used in conjunction with a Hue Bridge (in an unsupported, but very reliable way), or turned into a very slow 4 button shortcut launcher for a Wink hub, with only one automation per button possible. With so many limited and/or expensive options, this somewhat challenging to configure solution is well worth the effort, and very stable once configured.
Disclaimer
This Node.js application will require you to enter your Lutron Caséta login credentials and it will store them unencrypted in plain text in the configuration file. This allows a potential attacker to take remote control of your lighting or devices attached to Caséta Clear Connect devices. With this in mind, follow these basic security recommendations. The author of these step by step instructions, the authors of the code used to make anything described here possible, SmartThings Inc., Samsung Electronics Co., Ltd. and Lutron Electronics Co., Inc. are not responsible for any damage or harm to persons or property that result from use.
With most hubs and bridges, you will either receive updates automatically, or you will be informed that an update is available and ready for you to install. This is not the case with your Node.js server. Make sure you keep the OS and Node.js up to date with the latest security releases.
-
Keep your router firmware up-to-date and disable common attack surfaces like remote web access and UPnP.
-
Don’t connect anything to the Lutron account you use for this application that might be dangerous, if unauthorized remote access was acquired by an attacker or bot.
Prerequisites
You’re going to need to have a few things in place before you can do this.
-
You need a Node.js server in-between the Lutron Caséta Pro SmartBridge and SmartThings. That sounds difficult, but it’s actually not. The intention here is to make this a complete step by step guide, but there are many different ways to install Node.js, so we won’t be listing the steps for each here. You can run the Lutron Caséta v1.0 server on a Raspberry PI, on Ubuntu Linux, or if you have an old Mac laptop that can run at least MacOS 10.11 El Capitan, then you can run it there too. An old laptop is a nice option, since it already has a screen, keyboard and track pad, plus a convenient browser to download the necessary files and access the SmartThings IDE.
-
You are going to need a Lutron Caséta SmartBridge Pro. The non-Pro version does not allow Pico remotes to control non-Lutron devices in SmartThings.
To install Node.js on a Rasberry PI, NATE SCHWARTZ suggests the following two guides:
“If you have an older Pi (B/B+ etc.) this guide should work
If you have a newer Pi(2./3 etc.) try this one (the node.js instructions are down
towards the bottom)”
I chose to use an old Mac laptop I was given, but whether you use a Linux PC, a Raspberry PI or a Mac, it’s not going to matter, as long as Node.js installs properly. Node.js on a Mac is relatively easy, but you will also need to first install Xcode before you install the Node.js package. Here is a link to both found at the beginning of the article. The article goes on to explain how to install Homebridge. Just stop before you get to that part, but do revisit it later. If you’re an iOS user, you can have access to devices on your SmartThings hub (and Wink, and Insteon) via HomeKit by running Homebridge and plug-ins for each. I just open a second terminal window and run both Lutron Caséta v1.0 and Homebridge at once. In the addendum at the end, I’ll also explain how to keep the Mac awake with the lid closed so Node.js will continue to run, without the need to have a monitor attached.
Note
If you’re using an old MacBook like I did for this project, I would recommend one that can at least run MacOS 10.11 El Capitan, so that you will get some longevity with Apple security updates. However, if the Mac you’re using can’t go beyond MacOS 10.11, then you’re going to need to download Xcode 8.2.1, since you must have Mac OS 10.12 Sierra or higher to run later versions of Xcode.
That’s it! Other than the files needed and some configuration, the only other thing you need is a Lutron Caséta Pico remote.
Part 1 - Lutron Caséta SmartBridge Pro Setup
-
Install the Lutron Caséta SmartBridge Pro.
-
Install the app on your smartphone or tablet and then register your account with Lutron.
-
Launch the app and tap the “gear” icon in the top left of the app.
-
Tap Advanced > Integration and set “Telnet Support” to ON
-
Go back to the first screen of “Settings” and tap + Add Device.
-
Follow the instructions to add your Pico remote and give it a name for the room or purpose you will be using it. If you don’t, they will all show up as “Pico”, and configuring multiple remotes will be confusing.
-
If you have Lutron devices and you want to utilize their scenes, you can add them here and they’ll be available to you in SmartThings, otherwise you can tap Done.
Part 2 - Installing the Lutron Caséta v1.0 server
-
If you’re installing on a Mac for the server, you’ll want to first download Atom text editor, otherwise your configuration files will be messed up by Apple Text Edit replacing quotes, with “Smart Quotes”.
-
Open a terminal window and navigate to the directory where you want to install Lutron Caséta v1.0
-
Type npm install lutronpro (This will install the server and all it’s dependencies automatically).
-
Highlight and copy the text from NATE SCHWARTZ’s GitHub repository here.
-
Create a new file in Atom text editor and paste the text
-
Change the two IP addresses in lines 5 and 6 to the correct values for your network.
a. Open the Lutron Caséta app and tap the “gear” icon in the top left of the app, then tap Advanced > Integration > Network Settings and type the IP address of the SmartBridge into line 5 of the text file you’re creating.
b. To find the IP address of SmartThings, go the SmartThings IDE.
Make sure you’re on the correct “data shard” for your account and location, otherwise you’ll have problems seeing your published SmartApps when we get to that part. To be automatically directed to the correct URL, go to https://account.smartthings.com, login and then bookmark the URL it directs you to. Use only that URL for any changes to your SmartThings IDE.
c. Once you’re logged into the SmartThings IDE, click My Locations at the top left, then click the name of your location, then scroll down to “Hubs” and click the name of your hub. Copy or enter the IP address for SmartThings found on that page, into line 6 of the text file.
d. Enter your Lutron username and password on lines 9 and 10 to allow your Node.js server to connect to the Lutron TLS server. -
Save the text file as runServer.js in the same directory as you installed your Lutron Caséta v1.0 server.
-
Type node runServer.js and press enter. The correct SSL certificates will be automatically generated and used to connect to your Lutron SmartBridge.
Note
To ensure your Node.js server, SmartThings hub, and Lutron SmartBridge will always be found at the same IP address, ensure you assign each of their MAC addresses to the current IP address by using DHCP reservation settings in your router. The exact procedure varies by router manufacturer. Check your router manual for more information on how to accomplish this for your specific router make and model.
Part 3 - Installing the Lutron Caséta v1.0 SmartApps and Device Handlers
Method A (Requires you have opened a free GitHub account)
Using the first method will allow you to stay current with the latest developer updates by linking their GitHub repositories, directly with your SmartThing IDE.
-
Sign-in to the SmartThings IDE at the URL you determined is correct from Part 2 - step 6b above.
-
Choose My SmartApps at that top, then click the Enable GitHub Integration button on the top right.
-
Click the Settings button and in the “GitHub Repository Integration” window, enter njschwartz in the “Owner” box, lutronrpo in the “Name” box, and leave the “Branch” box as master
-
Click the blue Save button at the bottom right of the window.
-
Click the Update from Repo button and select lutronpro (master)
-
Under the New (only in GitHub) field, check the box next to "smartapps/njschwartz/lutron-pro-service-manager.src/lutron-pro-service-manager.groovy”
-
Check the “Publish” check box at bottom right, and then click the blue Execute Update button.
-
Next, choose My Device Handlers at that top of your SmartThings IDE, and click the Settings button
-
In the “GitHub Repository Integration” window, enter njschwartz in the “Owner” box, lutronrpo in the “Name” box, and leave the “Branch” box as master
-
Click the blue Save button at the bottom right of the window.
-
Click the Update from Repo button and select lutronpro (master)
-
Under the New (only in GitHub) field, check the box next to each of the device handlers,
-
Check the “Publish” check box at bottom right, and then click the blue Execute Update button.
Method B (Does not require you to have a GitHub account, but updates are much more difficult to track and execute)
-
Sign-in to the SmartThings IDE at the URL you determined is correct from Part 2 - step 6b above.
-
Choose My SmartApps at that top, then click the green + New SmartApps button on the top right.
-
Select the From Code tab and paste the code copied from here.
-
Click the blue Create button at the bottom left.
-
Click Publish and select For Me from the drop-down that appears.
-
Now choose My Device Handlers at that top, then click the green + Create New Device Hander button on the top right.
-
Go here and, one at a time, starting with “lutron-pico-on-off.src, click to reveal each .groovy file, then click on the .groovy file to reveal the device handler code to be highlighted and copied.
-
Select the From Code tab in the SmartThings IDE and paste the code copied from the .groovey file.
-
Click the blue Create button at the bottom left.
-
Click Publish and select For Me from the drop-down that appears.
-
Repeat steps 6-11 for each of the 6 separate Device Handlers that need to be created.
Part 4 - Configure the Lutron Caséta v1.0 SmartApps
- Ensure the Node.js server is running. If you are seeing the cursor at a prompt in the terminal, then it is not running. Start it by again typing, node runServer.js and press enter.
Tip
Pressing the up arrow on your keyboard will automatically fill the previous things you typed in the current terminal session.
-
Open the SmartThings App on your phone or tablet and tap Marketplace > SmartApps, then scroll to the bottom and tap My Apps.
-
Tap the Lutron Pro Service Manager app and wait until it finds your server.
Note
Even though it says “Select Raspberry PI”, it’s fine if you’re not using a Raspberry PI for the server. That’s just the way the app was built. It’s simply looking for a Node.js server on your network. However, please ensure they are on the same network or the server will not be found (Thanks @JMitch for catching that gap in the instructions).
-
Once found, tap on the server and then select the bubble to the right of your server IP address that appears, and then tap Done.
-
Tap Next at the top right and then wait for it to find your Lutron Clear Connect devices. If you’re only adding a Pico, then just tap it and select the check box to the right of your device name shown. If you have multiple devices to add, you’re going to want to differentiate them by giving each a unique name using the Lutron Caséta app before adding them to the Lutron Pro Service Manager.
-
Tap Next at the top right again and wait for your Lutron Caséta “Scenes” to appear, if you have created any in the first place. These are not SmartThings scenes, they are Lutron scenes created in the Lutron Caséta app.
-
Tap on the found scenes (if any exist) and then select the checkbox for each to import them into SmartThings. If you don’t have any scenes, then just tap Done at the top right and you should see “Lutron Pro Service Manager is now installed and automating” appear in a green banner at the top your SmartThings app.
Part 5 - Configure Pico buttons with Advanced Button Controller
Pico buttons you have added to the Caséta SmartBridge will now appear as a device in the SmartThings “Things” list, but they cannot do anything until you assign functions to the buttons. To do this, we will install a SmartApp named Advanced Button Controller or ABC for short. With ABC, you will be able to program up to two automations for each of the buttons on your Pico remote, and they can be configured to control just about any device that you can control from SmartThings. In the addendum, I’ll explain how to use Stringify [coming soon] to also allow the Pico remotes to control devices that are not available in SmartThings, such as Insteon or Wink devices, or anything that Stringify can control. Since Stringify can also activate IFTTT recipes, there are quite a lot of devices that can be controlled, in addition to other actions that do not involve a physical device.
-
In the SmartThings IDE, choose My SmartApps at that top, then click the green + New SmartApp button on the top right.
-
Select the From Code tab and paste the code copied from here.
-
Click the blue Create button at the bottom left.
-
Click Publish and select For Me from the drop-down that appears.
The next part of Advanced Button Controller is called a child app and it must not be published. You will create it the same as before, but you will stop after clicking the blue Create button.
- In the SmartThings IDE, click the green + New SmartApps button on the top right
- Select the From Code tab and paste the code copied from here
- Click the blue Create button at the bottom left and stop.
DO NOT PUBLISH THE CHILD APP!
- Open the SmartThings app on your phone or tablet and tap Marketplace > SmartApps and then scroll to the bottom and tap My Apps
- Tap the ABC Manager SmartApp and then tap New Button Device Mapping
-
Tap Button Device, and then tap the bubble to the right of your Pico remote, then tap Done.
-
Start by tapping Button 1. The image of the Pico at the top of the “Configure Button 1” screen will show which button on the Pico is “Button 1”, highlighted in red.
-
Continue setting whatever functions you want to assign to additional buttons.
All five buttons are available to be programed, and each can have two functions per button – One for tap and one for hold. You can also convert a standard Pico into an Audio Pico, giving it full speaker control including: Play/Pause, Next Track, Mute, and Volume Up/Down.
Part 6 - Set press and hold time
You may find that functions specified in ABC Manager as “When Held” events, are activating too quickly, making it difficult to activate a “When Pushed” event if you hold the button for too long. To add a greater separation between when a button is pushed, versus when it is held, you simply modify the “shortPressTime” variable in the runServer.js file you created in Part 2 - Installing the Lutron Caséta v1.0 server.
The default value is 300ms. Lager values will require a longer button hold time to activate the “When Held” events you specified in ABC Manager.
Security Advisory
With most hubs and bridges, you will either receive update automatically, or you will be informed that an update is available and ready for you to install. This is not the case with your Node.js server. Make sure you keep the OS and Node.js up to date with the latest security releases.
Troubleshooting
If you can see by observing the terminal window that your Node.js server is still responding when pressing the buttons on your Pico remote, but you can no longer control devices in SmartThings, you will need to remove the Lutron Pro Service Manager, but to do this you must first un-assign the Pico(s) linked to it.
- If you have more than one Pico remote assigned in the Lutron Pro Service Manager, deselect all except for one and tap Save.
- Remove the single Pico still assigned to the Lutron Pro Service Manager and PI/Caséta from “Things”, then remove the Lutron Pro Service Manager from Automation > SmartApps
- Repeat the steps above found under Part 4 - Configure the Lutron Caséta v1.0 SmartApp.
- Under Automation > SmartApps > ABC Manager, tap Button Device, and then tap the bubble to the right of your Pico remote, then tap Done
Note
All of your “Pico Mapping” will remain the same as before, so once you reassign your Pico to ABC Manager, the mapping will again apply to it.
Addendum:
Keeping a Mac laptop awake when the lid is closed
While an old Mac laptop is a convenient choice for a Node.js server, it’s not convenient to have to keep the lid open all the time when there isn’t an external monitor attached. MacOS has no built-in means to accomplish this task, so you’ll need an app called InsomniaX. You can find the installer here.
As this app is no longer under development, your mileage may vary. I do recommend you at least install the patch for a security vulnerability that was discovered. More details and instructions are found here.
Known Issues
- InsomniaX has a convenient setting in the preferences to disable lid sleep automatically when on AC. Unfortunately I found this setting does not always function correctly, so if you open your Mac laptop to make a modification to the Node.js server, and you also remove the power adapter, you’ll want to attached the power adapter, then quit and restart InsomniaX before closing the lid again.
- Mac laptops do not keep the WiFi active when the lid is closed and InsomniaX unfortunately will not help you here. To stay connected, you will need to connect your Mac laptop by ethernet. If that’s not possible in your setup, then you’ll have to keep the lid open, and in that case there’s no need for InsomniaX.
Postscript
Please let me know about any errors or omissions (with the exception of information about using Stringify with Picos. That will come soon).
[Update 3/1/2019] @Paul_Sheldon has taken over the SmartThings ABC app development from @stephack whom has moved onto Hubitat Elevation (as have I). Please use Paul’s repo for the most up-to-date version of ABC for SmartThings. Links in this post have been update for ABC to point to Paul’s repo.