I've gotten the Lutron Radio RA2 lights integrated into iRule. Or, mostly integrated I should say. Big kudos/thanks to Barry for leading me in the right direction as well as introducing me to a couple of cool tools including his TCPIPExplorer program. I've sent him a copy of my sample Lutron commands and no doubt it will be integrated into his example set.
Here is a sample command set for my setup:
Login= lutron\\x0d\\x0aintegration\\x0d\\x0a
Office-On= #OUTPUT,56,1,100\\x0d\\x0a
Office-Dim= #OUTPUT,56,1,50\\x0d\\x0a
Office-Off= #OUTPUT,56,1,0\\x0d\\x0a
Movie= #DEVICE,55,2,3\\x0d\\x0a
Logout= LOGOUT\\x0d\\x0a
You'll want to look at the Lutron Integration document for all of the commands that you can send to Lutron devices (as well as status you can receive). The easiest way to figure out what your device numbers are is simply to telnet to your repeater and start pressing buttons/switches. The first command echoed back is the button press status. So, for example, if I press button 2 on my living room keypad, I'd see a status message ~DEVICE,55,2,3 (followed by a bazillion other status messages, in my case).
I setup a gateway on port 23 to the IP address of my Lutron repeater. Because of the session issues, and also because the repeater won't allow multiple users logged in via the same login/password combination, what I'd really like to do is login each time, send a command and then logout. So, for me, a high level command (attached to a button) looks like a macro of:
Login, Delay (.05), COMMAND (e.g. Office-Dim), Delay(.05), Logout
There is only one problem with this approach. The logout shuts down the gateway and iRule won't re-setup the gateway until a panel switch or a sleep/unsleep type event. itai - I'm wondering if there is a better way for me to do this?? Or could iRule recognize that the session has shut down and reopen the connection?? As it is, it is workable for me as I only need to do a couple of simple things with my lighting setup. If you wanted to do a great deal of complicated setup the session shutdown problem would need to be addressed differently. An even better approach would be if somehow when a gateway is initialized, there is a setup option that allows the login/password to be sent.
Other comments/suggestions appreciated.
EDIT: Combined login/password on single line. Seems to allow this without a delay in between. Removing the other delays though isn't working for me.
Here is a sample command set for my setup:
Login= lutron\\x0d\\x0aintegration\\x0d\\x0a
Office-On= #OUTPUT,56,1,100\\x0d\\x0a
Office-Dim= #OUTPUT,56,1,50\\x0d\\x0a
Office-Off= #OUTPUT,56,1,0\\x0d\\x0a
Movie= #DEVICE,55,2,3\\x0d\\x0a
Logout= LOGOUT\\x0d\\x0a
You'll want to look at the Lutron Integration document for all of the commands that you can send to Lutron devices (as well as status you can receive). The easiest way to figure out what your device numbers are is simply to telnet to your repeater and start pressing buttons/switches. The first command echoed back is the button press status. So, for example, if I press button 2 on my living room keypad, I'd see a status message ~DEVICE,55,2,3 (followed by a bazillion other status messages, in my case).
I setup a gateway on port 23 to the IP address of my Lutron repeater. Because of the session issues, and also because the repeater won't allow multiple users logged in via the same login/password combination, what I'd really like to do is login each time, send a command and then logout. So, for me, a high level command (attached to a button) looks like a macro of:
Login, Delay (.05), COMMAND (e.g. Office-Dim), Delay(.05), Logout
There is only one problem with this approach. The logout shuts down the gateway and iRule won't re-setup the gateway until a panel switch or a sleep/unsleep type event. itai - I'm wondering if there is a better way for me to do this?? Or could iRule recognize that the session has shut down and reopen the connection?? As it is, it is workable for me as I only need to do a couple of simple things with my lighting setup. If you wanted to do a great deal of complicated setup the session shutdown problem would need to be addressed differently. An even better approach would be if somehow when a gateway is initialized, there is a setup option that allows the login/password to be sent.
Other comments/suggestions appreciated.
EDIT: Combined login/password on single line. Seems to allow this without a delay in between. Removing the other delays though isn't working for me.
























