Double, long and combination press support for lutron-caseta-pro

I forked the lutron-caseta-pro project and added long, double and combination press to pico-remote. If you already have this custom_components setup, you just need to:

  1. overwrite (do backup first) the original script with files in GitHub - coldfire0200/lutron-caseta-pro: Custom Home Assistant Component for Lutron Caseta Smart Bridge PRO / RA2 Select
  2. add these lines to configuration file:
      enable_long_and_double: True
      long_press_time: 1.4
      double_press_time: 0.8
  1. add 64 to original button value to register double press, add 128 to register long press. e.g., if the button value is 1, use 65 for double press and 129 for long press.
  2. set enable_long_and_double to False will fallback to original behavior.
  3. Once long and double press is enabled, there would be no more physical button release event. Instead a single release (set state to 0) will immediate follow the press event.

Note that due to the nature of the communication, if you set the double press time to be really small then you will end up getting two single press. I found 0.6 - 0.8s to be a good value to start. The long press is pretty reliable. Be careful that you should not hold the button for extended period of time (>5s) that might put the controller to factory default

Now adding the combination is little bit tricky, here is a example of yaml for combination:

      timeout_between_press: 3.0
      button_combination:
        - pico_name: "Car Pico"
          silent_press: True
          combinations:
            - code: 1000
              combination: [65, 68, 8, 16, 2]
            - code: 1001
              combination: [65, 66, 68]
            - code: 1002
              combination: [1, 66, 1]

Basically you specify timeout between press so if you need to do combination press make sure interval between any two press is within the timeout_between_press. Then you configure the combination for each pico. In my example, I have a pico remote named “Car Pico”, I turn on silent_press so no individual key press will be sent to HA. I created 3 combinations, [double press key 1, double press key 4, single press up, single press down, single press middle] will generate new event code 1000. [double press key 1, double press middle, double press key 4] will generate new event code 1001, and so on. In automation, set trigger to state change, and put 1000/1001/1002 as the new state, and that’s it.

1 Like