Author Topic: Lutron RadioRA2 Gateway plugin  (Read 43328 times)

Offline Frmjmd

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: Lutron RadioRA2 Gateway plugin
« Reply #135 on: January 07, 2017, 10:18:00 pm »
I am managed to change some of the RA2 plugin so that Vera changes the dimmer status to on when the dimmer is switched on.  With the original plugin when you turned on a dimmer the loadlevel would goto 100 but the status would stay at 0.   When you use the dimmer in a scene it was looking for the status to be 1.

I modified the plugin so when you turn on the dimmer it will set the status to 1.  I can now make scenes using a Lutron dimmer.   I did a test hitting 1 dimmer and making it turn on another lutron dimmer.  Both the on and off scene work now.   Their is a second or 2 delay but it does work now.

If I dim up the scene trigger the action dimmer goes on full.  I have not tried to make it match the dim level yet.

I also modified the plugin so that when the lutron dimmer is on and or dimmed the web UI shows it as on.  Prior to this it always showed as off in the webUI.

This also fixed my issue with the allon/alloff on the dashboard.  It now correctly shows how many lutron lights are on using dimmers.

I'm not sure if the author of the RA2 plugin is still around and working on it, so I worked on it myself.  I am not a trained coder, but with some cut and pasteing and testing I was able to make it work better.

RS7, I was also having trouble triggering scenes with Lutron dimmers. You are a brilliant!!! I updated the plugin with your file and it worked like a charm. Amazing!!! Thank you!!! Thank you!!!

Thanks for the help!
« Last Edit: January 07, 2017, 11:17:41 pm by Frmjmd »

Offline ljp2017

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Lutron RadioRA2 Gateway plugin
« Reply #136 on: March 25, 2017, 09:48:19 pm »
Im looking for help in setting up Vera Pluis with Lutron Casetta Pro bridge.

The app installs, and the bridge is identified, but I then get this:

Status:Startup Failed!
Version:1.63

HELP!!

Offline electnixon

  • Jr. Member
  • **
  • Posts: 56
  • Karma: +2/-0
Re: Lutron RadioRA2 Gateway plugin
« Reply #137 on: September 16, 2018, 04:59:46 pm »
Hey all, I'm not much of a lua / luup programmer but I was pretty good a C+ 20 years ago.
A couple of topics:
I think I found a problem with this app - when I press a button on a RadioRa2 keypad to trigger a scene, it stays pressed.  The release doesn't seem to be working for me.  It seems like when the "KeypadCommand" variable for a given device / button is the same as the one pressed, it highlights the button like it's held down.  My workaround (I use PLEG but I think it would work with a scene) is to set one of the 6 buttons to "0" in the "componentNumber" field, then tell the action / scene to press that unused button any time a given button is pressed.  With the original code, I had to press another button on the keypad before it would accept the same one again.  This is a solution I've found that didn't require modifying the app code.

The second issue is devices with receiving presses from keypad numbers >6 including nonstandard picos.  In the original app, I was able to change the "componentNumber" to the appropriate button number to send commands, but not to receive commands.  Obviously for picos, there is no point in sending button presses from the vera but you do want to receive button presses from the pico.  The messy workaround solution that I came up with is to change the code in L_LutronRA2Telnet1.lua so that incoming messages with componentNumber > 6 are converted to 1-6.  I used this on buttons 4&5 on a grafik Eye QS, which come in from Lutron as 77 & 83.  This, of course will map those buttons from all Grafik Eyes to 4&5.  Implementing the fix and the one above means that only 5 button presses can be used per device, but that's better than nothing / flaky for me.  Here's what I changed in the "RESPONSES_HANDLERS" function (added a couple of "if" statements to change the compoenentNumber).  you can ignore the debug statements:


   ["DEVICE"] = function ( parameters)            -- param[1]    = Integration ID
      debug("(Lutron RA2 Gateway PLugin)::(debug)::(RESPONSES_HANDLERS) : DEVICE : PARAMETER received :" .. parameters)
      local param = {}                     -- param[2]    = Component number
      local k = 0                           -- param[3]    = Action Number
      for v in parameters:gmatch("(.-),") do      -- param[4-6]    = Parameters
         k = k + 1
         param[k] = v
      end
      if param[2] == "77" then
         debug("(Lutron RA2 Gateway PLugin)::(debug)::(RESPONSES_HANDLERS) : found a component 77! attempting to change")   
         param[2] = 4   
      else
         debug("(Lutron RA2 Gateway PLugin)::(debug)::(RESPONSES_HANDLERS) : DEVICE : no77!" .. deviceActionNumber[param[3]] .." for device with Component number : " .. param[2] .. " and Integration ID : " .. param[1] )      
         if param[2] == "83" then
         param[2] = 5
         else
         debug("(Lutron RA2 Gateway PLugin)::(debug)::(RESPONSES_HANDLERS) : DEVICE : no83!" .. deviceActionNumber[param[3]] .." for device with Component number : " .. param[2] .. " and Integration ID : " .. param[1] )         
         end
      end


 Kludgy, yes, but the WAF factor was greatly improved!  So far so good until I learn enough about how all this works to rewrite it correctly.
« Last Edit: September 16, 2018, 05:05:01 pm by electnixon »