[OBSOLETE] How to control anything with inexpensive Lutron Pico remotes

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.

  1. Keep your router firmware up-to-date and disable common attack surfaces like remote web access and UPnP.

  2. 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.

  1. 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.

  2. 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

  1. Install the Lutron Caséta SmartBridge Pro.

  2. Install the app on your smartphone or tablet and then register your account with Lutron.

  3. Launch the app and tap the “gear” icon in the top left of the app.

  4. Tap Advanced > Integration and set “Telnet Support” to ON

caseta%20telnet%20support

  1. Go back to the first screen of “Settings” and tap + Add Device.

  2. 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.

  3. 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

  1. 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”.

  2. Open a terminal window and navigate to the directory where you want to install Lutron Caséta v1.0

  3. Type npm install lutronpro (This will install the server and all it’s dependencies automatically).

  4. Highlight and copy the text from NATE SCHWARTZ’s GitHub repository here.

  5. Create a new file in Atom text editor and paste the text

  6. 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.

  7. Save the text file as runServer.js in the same directory as you installed your Lutron Caséta v1.0 server.

  8. 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.

  1. Sign-in to the SmartThings IDE at the URL you determined is correct from Part 2 - step 6b above.

  2. Choose My SmartApps at that top, then click the Enable GitHub Integration button on the top right.

  3. 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

  4. Click the blue Save button at the bottom right of the window.

  5. Click the Update from Repo button and select lutronpro (master)

  6. Under the New (only in GitHub) field, check the box next to "smartapps/njschwartz/lutron-pro-service-manager.src/lutron-pro-service-manager.groovy”

  7. Check the “Publish” check box at bottom right, and then click the blue Execute Update button.

  8. Next, choose My Device Handlers at that top of your SmartThings IDE, and click the Settings button

  9. In the “GitHub Repository Integration” window, enter njschwartz in the “Owner” box, lutronrpo in the “Name” box, and leave the “Branch” box as master

  10. Click the blue Save button at the bottom right of the window.

  11. Click the Update from Repo button and select lutronpro (master)

  12. Under the New (only in GitHub) field, check the box next to each of the device handlers,

  13. 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)

  1. Sign-in to the SmartThings IDE at the URL you determined is correct from Part 2 - step 6b above.

  2. Choose My SmartApps at that top, then click the green + New SmartApps button on the top right.

  3. Select the From Code tab and paste the code copied from here.

  4. Click the blue Create button at the bottom left.

  5. Click Publish and select For Me from the drop-down that appears.

  6. Now choose My Device Handlers at that top, then click the green + Create New Device Hander button on the top right.

  7. 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.

  8. Select the From Code tab in the SmartThings IDE and paste the code copied from the .groovey file.

  9. Click the blue Create button at the bottom left.

  10. Click Publish and select For Me from the drop-down that appears.

  11. Repeat steps 6-11 for each of the 6 separate Device Handlers that need to be created.

lutron%20pro%20v1%20required%20DH

Part 4 - Configure the Lutron Caséta v1.0 SmartApps

  1. 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.

  1. Open the SmartThings App on your phone or tablet and tap Marketplace > SmartApps, then scroll to the bottom and tap My Apps.

  2. Tap the Lutron Pro Service Manager app and wait until it finds your server.

Found%20Raspberry%20PI%20server

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).

  1. 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.

  2. 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.

  1. 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.

  2. 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.

  1. In the SmartThings IDE, choose My SmartApps at that top, then click the green + New SmartApp button on the top right.

  2. Select the From Code tab and paste the code copied from here.

  3. Click the blue Create button at the bottom left.

  4. 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.

  1. In the SmartThings IDE, click the green + New SmartApps button on the top right
  2. Select the From Code tab and paste the code copied from here
  3. Click the blue Create button at the bottom left and stop.

DO NOT PUBLISH THE CHILD APP!

  1. Open the SmartThings app on your phone or tablet and tap Marketplace > SmartApps and then scroll to the bottom and tap My Apps
  2. Tap the ABC Manager SmartApp and then tap New Button Device Mapping

ABC%20screen%201

  1. Tap Button Device, and then tap the bubble to the right of your Pico remote, then tap Done.

  2. 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.
    ABC%20Button%20MapPico%20Button%20Map

  3. 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.

  1. If you have more than one Pico remote assigned in the Lutron Pro Service Manager, deselect all except for one and tap Save.
  2. 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
  3. Repeat the steps above found under Part 4 - Configure the Lutron Caséta v1.0 SmartApp.
  4. 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
  1. 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.

InsomniaX

  1. 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.

10 Likes

Wow…this seems like a really comprehensive write up. Thank you for taking the time. I’m sure this will help a lot of people who would otherwise find it took intimidating to to put all the necessary pieces together.
Once all the steps have been verified, a link too this should probably be placed in the initial Luton Caseta post by @njschwartz.

2 Likes

Thank you for Stephan. ABC is a crucial piece to making the Picos easy to configure!

Ah, another Staples Connect refugee! I had such high hopes for that thing, and truth be told, still using it for some existing stuff while I convert to ST/Lutron at home.

A couple of notes on your very impressive how-to:
a. At Part 2 #7 I think you wanted runNodeServer.js rather than runServer.js
b. At Part 3, starting at #2 onward, rather than cutting and pasting all Nate’s SmartApp and Device Handlers, consider a walkthrough to use the IDE’s GitHub integration, which will link directly to Nate’s master branch code w/o any cut-and-paste (and I THINK stay updated with his future changes). It’s been a while so I don’t have all the steps, but it starts on the SmartApps IDE page with the Gear/Settings button, leading to the GitHub Repository Integration window, wherein you can set your own namespace and then Add New Respository, enter owner= njschwartz name= lutronpro branch= master, then Save, and you’ve got it. I believe both SmartApps and Device Handlers are linked in that step. (Can’t recall if you have to publish subsequently). I’m not sure if you can do the same thing for @stephack’s ABC or not.

If I get some moments, maybe I can flesh out the Raspberry Pi (esp. Zero) procedures to add in.

1 Like

Thanks for catching that error and for the notes Bill. The reason I wrote it that way was because I tried linking to Nate’s repo and unlike other repos I have been able to get this to work with, I couldn’t get it to work here.

If you’re able to, let me know and I’ll try again, then change the writeup if I can get it happening too.

PI Zero W would be a nice add-in. Much more cost effective for this task.

Tried update from repo and it worked this time. Might have been an error on my part, or things just weren’t working at the time I tired. Likely the former :wink:

I’ll update to reflect this simpler method when I get a chance. Thanks for the suggestion.

1 Like

Can the Lutron Caséta SmartBridge Pro be the Gen1 version?

It should work. The only difference between gen 1 and 2 is that 2 has the HomeKit chip, and that’s not required for this particular integration, which is using the Lutron API.

Just make sure it’s the Pro version and not the standard Bridge.

1 Like

Newbie here… I was all excited about seeing this, since I am investing into Caseta and ST. I wanted to use the picos to control my Figaro RGBW controller. However, no option to run the nodeserver.js on Windows? I have a windows home server i was hoping to use…

@HenrikDK

Hubitat has native, local integration with Lutron Caseta Pro Bridge via Telnet. No nodejs server is required. I just received a Pro Bridge and set up my first Lutron Pico Remote last night. It took about 10 minutes with Hubitat and it is amazingly fast. Pressing a button on the Pico results in my two zigbee bulbs changing state immediately. There really is almost zero delay.

1 Like

I’ll second @ogiewon 's recommendation for Hubitat. I and @stephack are also owners. However, you said you are investing in ST and exicted about it, so I think it is only fair to explore all the options.

You can find node.js for Windows here
In the original post, @njschwartz did say there was an issue with OpenSSL certs. I don’t know if a workaround was ever created. @BHO has continued to contribute a fair amount of the work with this project on ST and may be able to provide some insight. I have heard of running node.js in a Docker container on Windows, but don’t know the details of that setup.

Now, as a Hubitat user, I would strongly suggest you consider that as an option. It’s everything you want with this setup, without any dependency on cloud for this.

3 Likes

As @SmartHomePrimer mentioned, node.js is available for Windows and I believe people have reported the original Lutron interface working there. You might want to look through the main thread on that interface, here: https://community.smartthings.com/t/lutronpro-caseta-v1-0

(but note that some of the early info is corrected in later posts, so have a thorough read-through!)

FWIW, I recently floated a beta test version of an updated/improved version of Nate’s SmartThings/Lutron interface and I’m running that under Windows node.js at this moment. So I guess it works there. See LutronPro Caseta v1.0 if interested.

1 Like

Wonderful! Very excited that there is a solution. Stupid how difficult it seems to be to turn my LED lights on/off via physical switches - found a couple of solutions, but complicated by needing them to be BLACK without a LIGHT (it is in a home theater). The Pico will be perfect. Now I need to get a PRO bridge

1 Like

Best step by step I have seen so far! Thanks for the great write up and spending the time on it.

Everything worked great until I saved the “pico” from the smart app. The green banner appears and shortly after a red error banner and no device is added.

In logs, I see this error message:
“physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘Raspberry Pi Lutron Caseta’ in namespace ‘njschwartz’ not found. @line 383 (addBridge)”

I hope someone can point me into the right direction. :slight_smile:

1 Like

Sounds like you may have missed the steps where you install the child device handlers and publish them? Part 3 in the first post.

2 Likes

Sure did! I can’t believe I missed that :frowning:

Thanks so much for the help!

2 Likes

When trying to add a smartapp from repository, there is an error message saying that the repo is not found. I copied the “owner” and “name” so there is not a chance of a misspelling, what I am doing wrong?

Might be a broken link. Use the manual method. [See Part 3 - Method A] in the first post.

1 Like

Yep, worked nicely, thank you very much!
Wonder if there is an easy way for a newbie to have runServer.js start automatically when Pi boots instead of having to issue the command every time.
Thank you again