[OBSOLETE] LutronPro Caseta v1.0

Thanks. I’m sure I could make the four button keypad work. I’ll need some info from you though since I don’t have one. When you first start things up and it pulls all your device data, can you copy and paste that output to me? I just need to see a couple of the fields for that device. Thanks

If you get that PJ2-4B config info and move forward on it, one thing to watch out for is that the button codes may be different than those of the smaller picos: 8,9,10,11 (instead of 2,3,4,5,6), but it looks like the press & release op codes are still 3 & 4. (This from the Lutron integration docs)

Playing around with the Caseta Pro Hub here: it appears that the Telnet commands for fade and delay DO work at least in some cases. All I’ve tested is a Pro Dimmer (PD-10NXD) on a Pro Hub, and here’s what works:

#OUTPUT1,deviceID,1[,ramptime][,delaytime] (ramptime,delaytime optional, SS, SS:ss,MM:SS,HH:MM:SS though I’ve only checked SS.ss and MM:SS so far)
#OUTPUT,deviceID,2 starts the dimmer level self-ramping ‘brighter’ until stopped
#OUTPUT,deviceID,3 starts the dimmer level self-ramping ‘dimmer’ until stopped
#OUTPUT,deviceID,4 stops either of those self-ramping operations

it appears that sending a specific output level to that same dimmer will ALSO stop a ramp in progress, and interestingly: the hub reports that commanded brightness level back, but doesn’t actually do it… the actual (bulb) brightness remains where the ramping left off. It gets back to reporting correctly after the next command.

what doesn’t work is flashing or pulsing:
#OUTPUT,deviceID,5[,flashrate[,delaytime]
#OUTPUT,deviceID,6[,pulserate[,delaytime]

I don’t know if there are equivalent SSL commands that would work on the non-Pro hub, nor do I know whether these ramp/delay functions work on all Caseta dimmers or only the Pro dimmer(s). If I find out, I’ll note it later.

Thanks @BHO for the info. I didn’t know about the button numbering so that makes things much simpler! I was aware that ramp rates worked, in fact I had it implemented at one time but got the impression that no one wanted/needed it so I dropped it somewhere along the line. Is it something you were hoping to use or just playing? Thanks again!

Hello Nate,

Thanks for your work. My set up is non-Pro. I just got it set up and it works initially as the original python version that you wrote. However, it has an issue where after a while (maybe 10 minutes or so), the server reports the bridge module has closed the socket connection. Have you run into this issue? Perhaps some form of keep-alive is needed…

Error: This socket has been ended by the other party
    at TLSSocket.writeAfterFIN [as write] (net.js:268:12)
    at /home/kh/node_modules/lutronpro/lutronpro.js:665:16
    at Layer.handle [as handle_request] (/home/kh/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/kh/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/kh/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/kh/node_modules/express/lib/router/layer.js:95:5)
    at /home/kh/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/kh/node_modules/express/lib/router/index.js:335:12)
    at next (/home/kh/node_modules/express/lib/router/index.js:275:10)
    at /home/kh/node_modules/body-parser/lib/read.js:130:5
    at invokeCallback (/home/kh/node_modules/raw-body/index.js:224:16)
    at done (/home/kh/node_modules/raw-body/index.js:213:7)
    at IncomingMessage.onEnd (/home/kh/node_modules/raw-body/index.js:273:7)
    at emitNone (events.js:67:13)
    at IncomingMessage.emit (events.js:166:7)
    at endReadableNT (_stream_readable.js:905:12)

Hey @kkfh thanks for the report. I had seen that originally but thought I’d fixed it. Apparently not. I think it’s simply a timeout issue if there’s no traffic. I can fix it I think by adding a “heartbeat” call every few minutes to prevent the timeout. Let me look into it and I’ll try to get it fixed. Thanks.

Fwiw I ran into that SSL session socket closure issue also, did some fiddling… I tried turning on the session keep alive, but that did not seem to do the trick, nor did the allowHalfOpen option ( socket is really only haLR closed due to a FIN from the bridge, In the bridge will continue to talk to the node app, just not the other way around ). What I ended up doing was re-factoring the SSL session code to simply resume the session if it was closed since the last transaction. Used that tls feature where you can save the session info in a Buffer and then restore it to a new socket later, whenever a new send request comes through. So the SSL session doesn’t have to be set up again from scratch. Worked great… but yeah, an occasional ping might be a lot simpler and do the same job for this particular type of disconnect.

The session save looks like this:
if (!resume) {
self.sslSession = Buffer.from(self.sslClient.getSession());
}

@BHO @njschwartz I think a reconnect approach would indeed be more robust than keep-alive. For example, I’m concerned about the situation where the bridge loses power and reboots, and the session would have to be reconnected in that case. Without reconnetion, we’d have to restart the node server to restore the connection, which is undesirable since we would like to keep that server running unattended.

Yeah, even the TLS session resume probably wouldn’t help with a full bridge reboot, though I think it would work across a temporary ethernet disconnection. In the more extreme case, a full re-setup of the secure session would probably have to be done. And in the case of the pro bridge, the telnet session would have to be re-triggered anyhow. I guess I’ll try pulling the plug tomorrow and see!

With three separate devices involved, there sure are a variety of different ways the lashup can fail when anyone of them drops out, reboots, changes IP address, etc. I’ve been tinkering with discovery and SSDP readvertising, as well as session resumption, to try to firm some of that up in my rig. Maybe it’ll be worth passing along at some point.

1 Like

@njschwartz
So after getting a new router and having to change my bridge IP settings and getting the server working again I now see the following output:

Outdoor Front Lights
Dec 27 14:23:55 raspberrypi node[6329]: The device ID’s for leap and lip servers do not match! This might cause problems for you.
Dec 27 14:23:55 raspberrypi node[6329]: Outdoor Front Lights Remote
Dec 27 14:23:55 raspberrypi node[6329]: The device ID’s for leap and lip servers do not match! This might cause problems for you.
Dec 27 14:23:55 raspberrypi node[6329]: Jasmine’s Night Light Remote
Dec 27 14:23:55 raspberrypi node[6329]: The device ID’s for leap and lip servers do not match! This might cause problems for you.
Dec 27 14:23:55 raspberrypi node[6329]: Van’s Night Light Remote
Dec 27 14:23:55 raspberrypi node[6329]: The device ID’s for leap and lip servers do not match! This might cause problems for you.
Dec 27 14:23:55 raspberrypi node[6329]: Family Room Lamp Remote
Dec 27 14:23:55 raspberrypi node[6329]: The device ID’s for leap and lip servers do not match! This might cause problems for you.

I’m getting “The device ID’s for leap and lip servers do not match! This might cause problems for you.” for all my devices however everything seems to be functioning ok. Still having tried ramping again as i’ve settle on just multiple clicks to get the dimming to where i need it. But wondering what these messages mean.

I do not have a Pro Hub (yet) but my understanding is that my switches/dimmers should be found. I installed nodejs on windows 10 and the smartapp finds a “rasberry pi” but doesn’t find any switches. The runNodeServer.js shows the following:

192.168.1.237
Error: This socket has been ended by the other party
at TLSSocket.writeAfterFIN [as write] (net.js:351:12)
at c:\Program Files\nodejs\node_modules\lutronpro\lutronpro.js:624:30
at Layer.handle [as handle_request] (c:\Program Files\nodejs\node_modules\express\lib\router\layer.js:95:5)
at next (c:\Program Files\nodejs\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (c:\Program Files\nodejs\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (c:\Program Files\nodejs\node_modules\express\lib\router\layer.js:95:5)
at c:\Program Files\nodejs\node_modules\express\lib\router\index.js:281:22
at Function.process_params (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:335:12)
at next (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:275:10)
at jsonParser (c:\Program Files\nodejs\node_modules\body-parser\lib\types\json.js:109:7)
at Layer.handle [as handle_request] (c:\Program Files\nodejs\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:317:13)
at c:\Program Files\nodejs\node_modules\express\lib\router\index.js:284:7
at Function.process_params (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:335:12)
at next (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:275:10)
at expressInit (c:\Program Files\nodejs\node_modules\express\lib\middleware\init.js:40:5)

Also, will this work with the new black RA2 select hub?

The standard (non-Pro) SmartBridge seems to be prone to disconnecting itself after a while with no chit-chat from the “Lutron Pi” server. That’s what you’re seeing in that final error message. Nate’s mentioned looking into a keep-alive to remedy that.

But the lack of switch discovery sounds like another matter entirely. Maybe you can scroll back up and capture everything from the “node lutronpro” command onward? All the logging info from this program after you started it, that is. The problem might be logged (or at least hinted at) further up from this disconnect error. If you can cut all that text from there and paste it in a message here, someone might be able to hazard a guess.

It’s rather a lot:

c:\Program Files\nodejs>node runNodeServer.js
Listening on port 5000…
appCert exists! YEAH!!
192.168.1.237
connected at 1515039683542
data in listenSSL
json not valid, probably don’t have it all yet
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at TLSSocket. (c:\Program Files\nodejs\node_modules\lutronpro\lutronpro.js:264:11)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:594:20)
data in listenSSL
Buffered data is proper json
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“MultipleDeviceDefinition”,“StatusCode”:“200 OK”,“Url”:"/device"},“Body”:{“Devices”:[{“href”:"/device/1",“Name”:“Smart Bridge”,“FullyQualifiedName”:[“Smart Bridge”],“Parent”:{“href”:"/project"},“SerialNumber”:31980730,“ModelNumber”:“L-BDG2-WH”,“DeviceType”:“SmartBridge”,“RepeaterProperties”:{“IsRepeater”:true}},{“href”:"/device/2",“Name”:“Main Lights”,“FullyQualifiedName”:[“Living Room”,“Main Lights”],“Parent”:{“href”:"/project"},“SerialNumber”:22387296,“ModelNumber”:“PD-6WCL-XX”,“DeviceType”:“WallDimmer”,“LocalZones”:[{“href”:"/zone/1"}],“AssociatedArea”:{“href”:"/area/2"}},{“href”:"/device/3",“Name”:“Main Lights Remote 1”,“FullyQualifiedName”:[“Main Lights Remote 1”],“Parent”:{“href”:"/project"},“SerialNumber”:28559669,“ModelNumber”:“PJ2-3BRL-GXX-X01”,“DeviceType”:“Pico3ButtonRaiseLower”,“ButtonGroups”:[{“href”:"/buttongroup/2"}]},{“href”:"/device/4",“Name”:“Pico”,“FullyQualifiedName”:[“Master Bedroom”,“Pico”],“Parent”:{“href”:"/project"},“SerialNumber”:30755654,“ModelNumber”:“PJ2-3BRL-GXX-X01”,“DeviceType”:“Pico3ButtonRaiseLower”,“ButtonGroups”:[{“href”:"/buttongroup/3"}],“AssociatedArea”:{“href”:"/area/3"}}]}}

Leap Data was recieved and sent to parser
false
data in listenSSL
json not valid, probably don’t have it all yet
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at TLSSocket. (c:\Program Files\nodejs\node_modules\lutronpro\lutronpro.js:264:11)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:594:20)
data in listenSSL
json not valid, probably don’t have it all yet
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at TLSSocket. (c:\Program Files\nodejs\node_modules\lutronpro\lutronpro.js:264:11)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:594:20)
data in listenSSL
json not valid, probably don’t have it all yet
SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at TLSSocket. (c:\Program Files\nodejs\node_modules\lutronpro\lutronpro.js:264:11)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at TLSSocket.Readable.push (_stream_readable.js:208:10)
at TLSWrap.onread (net.js:594:20)
data in listenSSL
Buffered data is proper json
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“MultipleVirtualButtonDefinition”,“StatusCode”:“200 OK”,“Url”:"/virtualbutton"},“Body”:{“VirtualButtons”:[{“href”:"/virtualbutton/1",“Name”:“Button 1”,“ButtonNumber”:0,“ProgrammingModel”:{“href”:"/programmingmodel/1"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/2",“Name”:“Button 2”,“ButtonNumber”:1,“ProgrammingModel”:{“href”:"/programmingmodel/2"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/3",“Name”:“Button 3”,“ButtonNumber”:2,“ProgrammingModel”:{“href”:"/programmingmodel/3"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/4",“Name”:“Button 4”,“ButtonNumber”:3,“ProgrammingModel”:{“href”:"/programmingmodel/4"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/5",“Name”:“Button 5”,“ButtonNumber”:4,“ProgrammingModel”:{“href”:"/programmingmodel/5"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/6",“Name”:“Button 6”,“ButtonNumber”:5,“ProgrammingModel”:{“href”:"/programmingmodel/6"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/7",“Name”:“Button 7”,“ButtonNumber”:6,“ProgrammingModel”:{“href”:"/programmingmodel/7"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/8",“Name”:“Button 8”,“ButtonNumber”:7,“ProgrammingModel”:{“href”:"/programmingmodel/8"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/9",“Name”:“Button 9”,“ButtonNumber”:8,“ProgrammingModel”:{“href”:"/programmingmodel/9"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/10",“Name”:“Button 10”,“ButtonNumber”:9,“ProgrammingModel”:{“href”:"/programmingmodel/10"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/11",“Name”:“Button 11”,“ButtonNumber”:10,“ProgrammingModel”:{“href”:"/programmingmodel/11"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/12",“Name”:“Button 12”,“ButtonNumber”:11,“ProgrammingModel”:{“href”:"/programmingmodel/12"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/13",“Name”:“Button 13”,“ButtonNumber”:12,“ProgrammingModel”:{“href”:"/programmingmodel/13"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/14",“Name”:“Button 14”,“ButtonNumber”:13,“ProgrammingModel”:{“href”:"/programmingmodel/14"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/15",“Name”:“Button 15”,“ButtonNumber”:14,“ProgrammingModel”:{“href”:"/programmingmodel/15"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/16",“Name”:“Button 16”,“ButtonNumber”:15,“ProgrammingModel”:{“href”:"/programmingmodel/16"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/17",“Name”:“Button 17”,“ButtonNumber”:16,“ProgrammingModel”:{“href”:"/programmingmodel/17"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/18",“Name”:“Button 18”,“ButtonNumber”:17,“ProgrammingModel”:{“href”:"/programmingmodel/18"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/19",“Name”:“Button 19”,“ButtonNumber”:18,“ProgrammingModel”:{“href”:"/programmingmodel/19"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/20",“Name”:“Button 20”,“ButtonNumber”:19,“ProgrammingModel”:{“href”:"/programmingmodel/20"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/21",“Name”:“Button 21”,“ButtonNumber”:20,“ProgrammingModel”:{“href”:"/programmingmodel/21"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/22",“Name”:“Button 22”,“ButtonNumber”:21,“ProgrammingModel”:{“href”:"/programmingmodel/22"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/23",“Name”:“Button 23”,“ButtonNumber”:22,“ProgrammingModel”:{“href”:"/programmingmodel/23"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/24",“Name”:“Button 24”,“ButtonNumber”:23,“ProgrammingModel”:{“href”:"/programmingmodel/24"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/25",“Name”:“Button 25”,“ButtonNumber”:24,“ProgrammingModel”:{“href”:"/programmingmodel/25"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/26",“Name”:“Button 26”,“ButtonNumber”:25,“ProgrammingModel”:{“href”:"/programmingmodel/26"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/27",“Name”:“Button 27”,“ButtonNumber”:26,“ProgrammingModel”:{“href”:"/programmingmodel/27"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/28",“Name”:“Button 28”,“ButtonNumber”:27,“ProgrammingModel”:{“href”:"/programmingmodel/28"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/29",“Name”:“Button 29”,“ButtonNumber”:28,“ProgrammingModel”:{“href”:"/programmingmodel/29"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/30",“Name”:“Button 30”,“ButtonNumber”:29,“ProgrammingModel”:{“href”:"/programmingmodel/30"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/31",“Name”:“Button 31”,“ButtonNumber”:30,“ProgrammingModel”:{“href”:"/programmingmodel/31"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/32",“Name”:“Button 32”,“ButtonNumber”:31,“ProgrammingModel”:{“href”:"/programmingmodel/32"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/33",“Name”:“Button 33”,“ButtonNumber”:32,“ProgrammingModel”:{“href”:"/programmingmodel/33"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/34",“Name”:“Button 34”,“ButtonNumber”:33,“ProgrammingModel”:{“href”:"/programmingmodel/34"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/35",“Name”:“Button 35”,“ButtonNumber”:34,“ProgrammingModel”:{“href”:"/programmingmodel/35"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/36",“Name”:“Button 36”,“ButtonNumber”:35,“ProgrammingModel”:{“href”:"/programmingmodel/36"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/37",“Name”:“Button 37”,“ButtonNumber”:36,“ProgrammingModel”:{“href”:"/programmingmodel/37"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/38",“Name”:“Button 38”,“ButtonNumber”:37,“ProgrammingModel”:{“href”:"/programmingmodel/38"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/39",“Name”:“Button 39”,“ButtonNumber”:38,“ProgrammingModel”:{“href”:"/programmingmodel/39"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/40",“Name”:“Button 40”,“ButtonNumber”:39,“ProgrammingModel”:{“href”:"/programmingmodel/40"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/41",“Name”:“Button 41”,“ButtonNumber”:40,“ProgrammingModel”:{“href”:"/programmingmodel/41"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/42",“Name”:“Button 42”,“ButtonNumber”:41,“ProgrammingModel”:{“href”:"/programmingmodel/42"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/43",“Name”:“Button 43”,“ButtonNumber”:42,“ProgrammingModel”:{“href”:"/programmingmodel/43"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/44",“Name”:“Button 44”,“ButtonNumber”:43,“ProgrammingModel”:{“href”:"/programmingmodel/44"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/45",“Name”:“Button 45”,“ButtonNumber”:44,“ProgrammingModel”:{“href”:"/programmingmodel/45"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/46",“Name”:“Button 46”,“ButtonNumber”:45,“ProgrammingModel”:{“href”:"/programmingmodel/46"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/47",“Name”:“Button 47”,“ButtonNumber”:46,“ProgrammingModel”:{“href”:"/programmingmodel/47"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/48",“Name”:“Button 48”,“ButtonNumber”:47,“ProgrammingModel”:{“href”:"/programmingmodel/48"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/49",“Name”:“Button 49”,“ButtonNumber”:48,“ProgrammingModel”:{“href”:"/programmingmodel/49"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/50",“Name”:“Button 50”,“ButtonNumber”:49,“ProgrammingModel”:{“href”:"/programmingmodel/50"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/51",“Name”:“Button 51”,“ButtonNumber”:50,“ProgrammingModel”:{“href”:"/programmingmodel/51"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/52",“Name”:“Button 52”,“ButtonNumber”:51,“ProgrammingModel”:{“href”:"/programmingmodel/52"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/53",“Name”:“Button 53”,“ButtonNumber”:52,“ProgrammingModel”:{“href”:"/programmingmodel/53"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/54",“Name”:“Button 54”,“ButtonNumber”:53,“ProgrammingModel”:{“href”:"/programmingmodel/54"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/55",“Name”:“Button 55”,“ButtonNumber”:54,“ProgrammingModel”:{“href”:"/programmingmodel/55"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/56",“Name”:“Button 56”,“ButtonNumber”:55,“ProgrammingModel”:{“href”:"/programmingmodel/56"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/57",“Name”:“Button 57”,“ButtonNumber”:56,“ProgrammingModel”:{“href”:"/programmingmodel/57"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/58",“Name”:“Button 58”,“ButtonNumber”:57,“ProgrammingModel”:{“href”:"/programmingmodel/58"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/59",“Name”:“Button 59”,“ButtonNumber”:58,“ProgrammingModel”:{“href”:"/programmingmodel/59"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/60",“Name”:“Button 60”,“ButtonNumber”:59,“ProgrammingModel”:{“href”:"/programmingmodel/60"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/61",“Name”:“Button 61”,“ButtonNumber”:60,“ProgrammingModel”:{“href”:"/programmingmodel/61"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/62",“Name”:“Button 62”,“ButtonNumber”:61,“ProgrammingModel”:{“href”:"/programmingmodel/62"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/63",“Name”:“Button 63”,“ButtonNumber”:62,“ProgrammingModel”:{“href”:"/programmingmodel/63"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/64",“Name”:“Button 64”,“ButtonNumber”:63,“ProgrammingModel”:{“href”:"/programmingmodel/64"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/65",“Name”:“Button 65”,“ButtonNumber”:64,“ProgrammingModel”:{“href”:"/programmingmodel/65"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/66",“Name”:“Button 66”,“ButtonNumber”:65,“ProgrammingModel”:{“href”:"/programmingmodel/66"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/67",“Name”:“Button 67”,“ButtonNumber”:66,“ProgrammingModel”:{“href”:"/programmingmodel/67"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/68",“Name”:“Button 68”,“ButtonNumber”:67,“ProgrammingModel”:{“href”:"/programmingmodel/68"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/69",“Name”:“Button 69”,“ButtonNumber”:68,“ProgrammingModel”:{“href”:"/programmingmodel/69"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/70",“Name”:“Button 70”,“ButtonNumber”:69,“ProgrammingModel”:{“href”:"/programmingmodel/70"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/71",“Name”:“Button 71”,“ButtonNumber”:70,“ProgrammingModel”:{“href”:"/programmingmodel/71"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/72",“Name”:“Button 72”,“ButtonNumber”:71,“ProgrammingModel”:{“href”:"/programmingmodel/72"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/73",“Name”:“Button 73”,“ButtonNumber”:72,“ProgrammingModel”:{“href”:"/programmingmodel/73"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/74",“Name”:“Button 74”,“ButtonNumber”:73,“ProgrammingModel”:{“href”:"/programmingmodel/74"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/75",“Name”:“Button 75”,“ButtonNumber”:74,“ProgrammingModel”:{“href”:"/programmingmodel/75"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/76",“Name”:“Button 76”,“ButtonNumber”:75,“ProgrammingModel”:{“href”:"/programmingmodel/76"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/77",“Name”:“Button 77”,“ButtonNumber”:76,“ProgrammingModel”:{“href”:"/programmingmodel/77"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/78",“Name”:“Button 78”,“ButtonNumber”:77,“ProgrammingModel”:{“href”:"/programmingmodel/78"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/79",“Name”:“Button 79”,“ButtonNumber”:78,“ProgrammingModel”:{“href”:"/programmingmodel/79"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/80",“Name”:“Button 80”,“ButtonNumber”:79,“ProgrammingModel”:{“href”:"/programmingmodel/80"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/81",“Name”:“Button 81”,“ButtonNumber”:80,“ProgrammingModel”:{“href”:"/programmingmodel/81"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/82",“Name”:“Button 82”,“ButtonNumber”:81,“ProgrammingModel”:{“href”:"/programmingmodel/82"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/83",“Name”:“Button 83”,“ButtonNumber”:82,“ProgrammingModel”:{“href”:"/programmingmodel/83"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/84",“Name”:“Button 84”,“ButtonNumber”:83,“ProgrammingModel”:{“href”:"/programmingmodel/84"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/85",“Name”:“Button 85”,“ButtonNumber”:84,“ProgrammingModel”:{“href”:"/programmingmodel/85"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/86",“Name”:“Button 86”,“ButtonNumber”:85,“ProgrammingModel”:{“href”:"/programmingmodel/86"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/87",“Name”:“Button 87”,“ButtonNumber”:86,“ProgrammingModel”:{“href”:"/programmingmodel/87"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/88",“Name”:“Button 88”,“ButtonNumber”:87,“ProgrammingModel”:{“href”:"/programmingmodel/88"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/89",“Name”:“Button 89”,“ButtonNumber”:88,“ProgrammingModel”:{“href”:"/programmingmodel/89"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/90",“Name”:“Button 90”,“ButtonNumber”:89,“ProgrammingModel”:{“href”:"/programmingmodel/90"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/91",“Name”:“Button 91”,“ButtonNumber”:90,“ProgrammingModel”:{“href”:"/programmingmodel/91"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/92",“Name”:“Button 92”,“ButtonNumber”:91,“ProgrammingModel”:{“href”:"/programmingmodel/92"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/93",“Name”:“Button 93”,“ButtonNumber”:92,“ProgrammingModel”:{“href”:"/programmingmodel/93"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/94",“Name”:“Button 94”,“ButtonNumber”:93,“ProgrammingModel”:{“href”:"/programmingmodel/94"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/95",“Name”:“Button 95”,“ButtonNumber”:94,“ProgrammingModel”:{“href”:"/programmingmodel/95"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/96",“Name”:“Button 96”,“ButtonNumber”:95,“ProgrammingModel”:{“href”:"/programmingmodel/96"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/97",“Name”:“Button 97”,“ButtonNumber”:96,“ProgrammingModel”:{“href”:"/programmingmodel/97"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/98",“Name”:“Button 98”,“ButtonNumber”:97,“ProgrammingModel”:{“href”:"/programmingmodel/98"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/99",“Name”:“Button 99”,“ButtonNumber”:98,“ProgrammingModel”:{“href”:"/programmingmodel/99"},“Parent”:{“href”:"/project"},“IsProgrammed”:false},{“href”:"/virtualbutton/100",“Name”:“Button 100”,“ButtonNumber”:99,“ProgrammingModel”:{“href”:"/programmingmodel/100"},“Parent”:{“href”:"/project"},“IsProgrammed”:false}]}}

Scene Data Recieved
[]
data in listenSSL
Buffered data is proper json
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:0,“Zone”:{“href”:"/zone/1"}}}}

false
got the incoming data
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:0,“Zone”:{“href”:"/zone/1"}}}}

data in listenSSL
Buffered data is proper json
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:36,“Zone”:{“href”:"/zone/1"}}}}

false
got the incoming data
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:36,“Zone”:{“href”:"/zone/1"}}}}

data in listenSSL
Buffered data is proper json
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:0,“Zone”:{“href”:"/zone/1"}}}}

false
got the incoming data
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:0,“Zone”:{“href”:"/zone/1"}}}}

data in listenSSL
Buffered data is proper json
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:100,“Zone”:{“href”:"/zone/1"}}}}

false
got the incoming data
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:100,“Zone”:{“href”:"/zone/1"}}}}

data in listenSSL
Buffered data is proper json
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:0,“Zone”:{“href”:"/zone/1"}}}}

false
got the incoming data
{“CommuniqueType”:“ReadResponse”,“Header”:{“MessageBodyType”:“OneZoneStatus”,“StatusCode”:“200 OK”,“Url”:"/zone/1/status/level"},“Body”:{“ZoneStatus”:{“Level”:0,“Zone”:{“href”:"/zone/1"}}}}

Request for Device List
192.168.1.237
Error: This socket has been ended by the other party
at TLSSocket.writeAfterFIN [as write] (net.js:351:12)
at c:\Program Files\nodejs\node_modules\lutronpro\lutronpro.js:624:30
at Layer.handle [as handle_request] (c:\Program Files\nodejs\node_modules\express\lib\router\layer.js:95:5)
at next (c:\Program Files\nodejs\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (c:\Program Files\nodejs\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (c:\Program Files\nodejs\node_modules\express\lib\router\layer.js:95:5)
at c:\Program Files\nodejs\node_modules\express\lib\router\index.js:281:22
at Function.process_params (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:335:12)
at next (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:275:10)
at jsonParser (c:\Program Files\nodejs\node_modules\body-parser\lib\types\json.js:109:7)
at Layer.handle [as handle_request] (c:\Program Files\nodejs\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:317:13)
at c:\Program Files\nodejs\node_modules\express\lib\router\index.js:284:7
at Function.process_params (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:335:12)
at next (c:\Program Files\nodejs\node_modules\express\lib\router\index.js:275:10)
at expressInit (c:\Program Files\nodejs\node_modules\express\lib\middleware\init.js:40:5)

Hmm, looks like You’ve made a good connection to the Lutron bridge, and I can see you dimming and turning on and off your living room main light. And I see the request for the device list coming in from the smart things hub, so that communication is working to some degree.I wonder if this is just a matter of timing such that you are running into this communication shut down by the Lutron bridge. Try this: start the node server (Node lutronpro) from scratch, and as soon as all the start up logging ends, immediately use the SmartThings app to discover the server (Raspberry Pi, Lutron Pi, CasetaPi, whatever it’s called!). And again, immediately select it and work through the device discovery and selection. It may take a few seconds to populate device list, but if you get right to it it should happen. You should see it logged on the node server as a request for the device list, just as in the log you posted above. I think perhaps you were just not getting around to doing the device discovery before the Lutron Caseta bridge gets bored and “hangs up”, so give it a shot.

I believe this is showing up because Nate‘s original pass at this version was for the pro hub only, which uses a different (Telnet) communications channel that doesn’t have this propensity to hang up after a while. And this difficulty in the communications scheme for the standard bridge (SSL) may have appeared recently along with the other comm changes that Lutron made. Hence wasn’t caught and fixed just yet. Just guessing.

@BHO, That was it!. Thanks.

Does anyone know if this would work for the ra2 select hub (the black one)? As i will have to go “pro” to use picos I might as well go all in…

@Doerfler and also @kkfh if you are feeling brave and trusting:

I’ve thrown together a version of Nate’s server code with a quick-and-dirty pinger that will hold open the connection to the Lutron Caseta SmartBridge (the SSL connection, so either type). That’s the only change from Nate’s last-posted version on npm, other than tweaking some diagnostic logging to hold down the console noise. Look in
https://github.com/billhinkle/lutronsmartthings/tree/master/lutronpro_pinger
and grab the lutronpro.js file, with which you will replace the file of the same name in your local node_modules/lutronpro directory (folder).

Of course you will want to save a safety copy of Nate’s original file, first! Feel free to diff -b the two files to verify the changes.

1 Like

Revised: I just noticed that Gilbert Chan reported that Nate’s server does work with the RA2 Select (Dec 22 2017, above)

hmmm, from what I’m reading online it doesn’t seem like the RA2 Select hub works with Caseta dimmers at all. So the software rework might be more extensive if only because of all new device types.

Thanks for sharing the update @BHO. I have been running the updated code this evening and so far it has not lost connection. I’ll keep testing it out and let you know if there are problems.