BP - Lutron Caseta Pico Paddle Remote Button Actions

I finally was able to sit down and take another look at my previous pico paddle blueprint. Based off of the previous blueprint I had immense trouble editing it to do double clicks and long presses. So I instead I based this edit off of GregTR’s extremely talented blueprints, and just tailored it for use with the new Lutron Pico Paddle Remote.

Let me know how it works for you(, I only have my own testing of actions to base it’s functionality).

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

blueprint:
  name: BP - Lutron Caseta Pico Paddle Remote Button Actions
  description: 'Different Actions on Short, Long, and Double Click button presses.'
  domain: automation
  input:
    pico_id:
      name: Lutron Pico
      description: The Lutron Pico used to trigger the automations
      selector:
        device:
          model: PJ2-1P-GXX (PaddleSwitchPico)
          multiple: false
    short_click_action_on:
      name: On Button Short Click
      description: The action(s) to launch for a single short click
      default: []
      selector:
        action: {}
    short_click_action_off:
      name: Off Button Short Click
      description: The action(s) to launch for a single short click
      default: []
      selector:
        action: {}
    long_click_action_on:
      name: On Button Long Click
      description: The action(s) to launch for a long click
      default: []
      selector:
        action: {}
    long_click_action_off:
      name: Off Button Long Click
      description: The action(s) to launch for a long click
      default: []
      selector:
        action: {}
    double_click_action_on:
      name: On Button Double Click
      description: The action(s) to launch for a double click
      default: []
      selector:
        action: {}
    double_click_action_off:
      name: Off Button Double Click
      description: The action(s) to launch for a double click
      default: []
      selector:
        action: {}
    delay_click:
      name: Double Click Delay
      description: The time in milliseconds used for the double click detection
      default: 250
      selector:
        number:
          min: 100.0
          max: 1000.0
          unit_of_measurement: milliseconds
          step: 1.0
          mode: slider
    delay_hold:
      name: Hold Delay
      description: The time in milliseconds used for the hold detection
      default: 1000
      selector:
        number:
          min: 1000.0
          max: 4000.0
          unit_of_measurement: milliseconds
          step: 1.0
          mode: slider

trigger:
- platform: device
  device_id: !input pico_id
  domain: lutron_caseta
  type: press
  subtype: 'Button 0'
  id: on_pressed
- platform: device
  device_id: !input pico_id
  domain: lutron_caseta
  type: press
  subtype: 'Button 2'
  id: off_pressed
action:
- variables:
    hold_ms: !input delay_hold
    tap_ms: !input delay_click
    pico_id: '{{ trigger.event.data.device_id }}'
    button_name: '{{ trigger.event.data.button_type }}'
- choose:
  - conditions:
    - condition: trigger
      id: on_pressed
    sequence:
    - wait_for_trigger:
      - platform: device
        device_id: !input pico_id
        domain: lutron_caseta
        type: release
        subtype: 'Button 0'
      timeout:
        milliseconds: '{{ hold_ms }}'
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ wait.trigger == none }}'
        sequence: !input long_click_action_on
      default:
      - wait_for_trigger:
        - platform: device
          device_id: !input pico_id
          domain: lutron_caseta
          type: press
          subtype: 'Button 0'
        timeout:
          milliseconds: '{{ tap_ms }}'
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ wait.trigger == none }}'
          sequence: !input short_click_action_on
        default: !input double_click_action_on
  - conditions:
    - condition: trigger
      id: off_pressed
    sequence:
    - wait_for_trigger:
      - platform: device
        device_id: !input pico_id
        domain: lutron_caseta
        type: release
        subtype: 'Button 2'
      timeout:
        milliseconds: '{{ hold_ms }}'
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ wait.trigger == none }}'
        sequence: !input long_click_action_off
      default:
      - wait_for_trigger:
        - platform: device
          device_id: !input pico_id
          domain: lutron_caseta
          type: press
          subtype: 'Button 2'
        timeout:
          milliseconds: '{{ tap_ms }}'
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ wait.trigger == none }}'
          sequence: !input short_click_action_off
        default: !input double_click_action_off
mode: single
4 Likes

This looks good! I had made one of my own for this remote, but yours is better, so I’ve switched to it. However, I was getting errors on startup like the following. (The automation still ran fine.)

ERROR (MainThread) [homeassistant.components.lutron_caseta.device_trigger] Cannot validate trigger {‘platform’: ‘device’, ‘device_id’: ‘xxxx’, ‘domain’: ‘lutron_caseta’, ‘type’: ‘release’, ‘subtype’: ‘on’} because subtype on is invalid

Per this comment, I modified the script to switch from device triggers to event triggers. (As an aside, the issue associated with that comment is not exactly the same as my error. And it seems to have been resolved anyway, so I’m not sure why I’m getting that error. Perhaps it’s a bug with the Lutron Caséta bug core integration that I should reported…) Anyway, here’s my modified version of your script in case anyone is having the same errors.

blueprint:
  name: BP - Lutron Caseta Pico Paddle Remote Button Actions
  description: Different Actions on Short, Long, and Double Click button presses.
  domain: automation
  input:
    pico_id:
      name: Lutron Pico
      description: The Lutron Pico used to trigger the automations
      selector:
        device:
          model: PJ2-1P-GXX (PaddleSwitchPico)
          multiple: false
    short_click_action_on:
      name: On Button Short Click
      description: The action(s) to launch for a single short click
      default: []
      selector:
        action: {}
    short_click_action_off:
      name: Off Button Short Click
      description: The action(s) to launch for a single short click
      default: []
      selector:
        action: {}
    long_click_action_on:
      name: On Button Long Click
      description: The action(s) to launch for a long click
      default: []
      selector:
        action: {}
    long_click_action_off:
      name: Off Button Long Click
      description: The action(s) to launch for a long click
      default: []
      selector:
        action: {}
    double_click_action_on:
      name: On Button Double Click
      description: The action(s) to launch for a double click
      default: []
      selector:
        action: {}
    double_click_action_off:
      name: Off Button Double Click
      description: The action(s) to launch for a double click
      default: []
      selector:
        action: {}
    delay_click:
      name: Double Click Delay
      description: The time in milliseconds used for the double click detection
      default: 250
      selector:
        number:
          min: 100.0
          max: 1000.0
          unit_of_measurement: milliseconds
          step: 1.0
          mode: slider
    delay_hold:
      name: Hold Delay
      description: The time in milliseconds used for the hold detection
      default: 1000
      selector:
        number:
          min: 1000.0
          max: 4000.0
          unit_of_measurement: milliseconds
          step: 1.0
          mode: slider
  source_url: https://community.home-assistant.io/t/bp-lutron-caseta-pico-paddle-remote-button-actions/719285
trigger:
- platform: event
  event_type: lutron_caseta_button_event
  event_data:
    device_id: !input pico_id
    leap_button_number: 0
    action: press
  id: on_pressed
- platform: event
  event_type: lutron_caseta_button_event
  event_data:
    device_id: !input pico_id
    leap_button_number: 2
    action: press
  id: off_pressed

action:
- variables:
    hold_ms: !input delay_hold
    tap_ms: !input delay_click
    pico_id: '{{ trigger.event.data.device_id }}'
- choose:
  - conditions:
    - condition: trigger
      id: on_pressed
    sequence:
    - wait_for_trigger:
      - platform: event
        event_type: lutron_caseta_button_event
        event_data:
          device_id: !input pico_id
          leap_button_number: 0
          action: release
      timeout:
        milliseconds: '{{ hold_ms }}'
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ wait.trigger == none }}'
        sequence: !input long_click_action_on
      default:
      - wait_for_trigger:
        - platform: event
          event_type: lutron_caseta_button_event
          event_data:
            device_id: !input pico_id
            leap_button_number: 0
            action: press
        timeout:
          milliseconds: '{{ tap_ms }}'
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ wait.trigger == none }}'
          sequence: !input short_click_action_on
        default: !input double_click_action_on
  - conditions:
    - condition: trigger
      id: off_pressed
    sequence:
    - wait_for_trigger:
      - platform: event
        event_type: lutron_caseta_button_event
        event_data:
          device_id: !input pico_id
          leap_button_number: 2
          action: release
      timeout:
        milliseconds: '{{ hold_ms }}'
    - choose:
      - conditions:
        - condition: template
          value_template: '{{ wait.trigger == none }}'
        sequence: !input long_click_action_off
      default:
      - wait_for_trigger:
        - platform: event
          event_type: lutron_caseta_button_event
          event_data:
            device_id: !input pico_id
            leap_button_number: 2
            action: press
        timeout:
          milliseconds: '{{ tap_ms }}'
      - choose:
        - conditions:
          - condition: template
            value_template: '{{ wait.trigger == none }}'
          sequence: !input short_click_action_off
        default: !input double_click_action_off
mode: single
1 Like

Thanks for this! I will have to try it out once i install my Caseta switches.