Double and long press support for lutron-caseta-pro

I forked the lutron-caseta-pro project and added long and double 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
  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.8s to be a good value to start. The long press is pretty reliable. Be cautious that you should not hold the button for extended period of time (>5s) that might put the controller to factory default


Just a heads up that 2021.12 is throwing warnings about this custom component

 (<class 'custom_components.lutron_caseta_pro.sensor.CasetaPicoRemote'>) implements device_state_attributes. Please report it to the custom component author.

From what I’ve seen with other components, it might be an easy change, but not sure.

BTW, love the double tap and long press capabilites. This has been a game changer for me. Thanks


Fixed. Thanks for reporting!