Lutron Caseta Pico 4-Button Scene Remote

This blueprint allows the user to map actions to buttons on the Lutron Caseta four-button scene pico remote.

  • This works with the core Lutron Caseta integration only.
  • Works with four-button scene pico remote model PJ2-4B-GXX-X31 (Pico4ButtonScene).
  • Supports press and release action for each button.

Blueprint

Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)

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

Or import this Blueprint by using the forum topic URL:

blueprint:
  name: Lutron Four-Button Scene Pico Actions
  description: Specify actions when pico buttons are pressed/released.
  domain: automation
  input:
    pico:
      name: Pico Four-Button Scene Remote
      description: "Select the pico four-button scene remote to configure."
      selector:
        device:
          integration: lutron_caseta
          model: PJ2-4B-GXX-X31 (Pico4ButtonScene)
    button_1_press:
      name: Scene One Pressed
      default: []
      selector:
        action: {}
    button_1_released:
      name: Scene One Released
      default: []
      selector:
        action: {}
    button_2_press:
      name: Scene Two Pressed
      default: []
      selector:
        action: {}
    button_2_released:
      name: Scene Two Released
      default: []
      selector:
        action: {}
    button_3_press:
      name: Scene Three Pressed
      default: []
      selector:
        action: {}
    button_3_released:
      name: Scene Three Released
      default: []
      selector:
        action: {}
    off_button_press:
      name: Off Pressed
      default: []
      selector:
        action: {}
    off_button_released:
      name: Off Released
      default: []
      selector:
        action: {}

trigger:
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: press
    subtype: 'button_1'
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: release
    subtype: 'button_1'
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: press
    subtype: 'button_2'
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: release
    subtype: 'button_2'
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: press
    subtype: 'button_3'
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: release
    subtype: 'button_3'
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: press
    subtype: 'off'
  - platform: device
    device_id: !input pico
    domain: lutron_caseta
    type: release
    subtype: 'off'

action:
  - choose:
      # First scene button press
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 8 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "press" }}'
        sequence: !input button_1_press
      # First scene button release
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 8 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "release" }}'
        sequence: !input button_1_released
      # Second scene button press
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 9 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "press" }}'
        sequence: !input button_2_press
      # Second scene button release
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 9 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "release" }}'
        sequence: !input button_2_released
      # Third scene button press
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 10 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "press" }}'
        sequence: !input button_3_press
      # Third scene button release
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 10 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "release" }}'
        sequence: !input button_3_released
      # Off button press
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 11 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "press" }}'
        sequence: !input off_button_press
      # Off button release
      - conditions:
          - condition: template
            value_template: '{{ trigger.event.data.button_number == 11 }}'
          - condition: template
            value_template: '{{ trigger.event.data.action == "release" }}'
        sequence: !input off_button_released
    default: []
mode: restart

Based on the Lutron Caseta Pico (Core Integration Only) blueprint by @stephack.

7 Likes

@mattsheffiel, take a look at the updates to my Pico BP. Took a few suggestions from @erikg to optimize the code…it looks little prettier too :wink:

@stephack, nice! I’ll modify mine to use that logic when I get a moment. That is much cleaner. Great idea @erikg!

I wish there was a way to make a generic BP for all of the pico remotes but I don’t see a simple way to execute such a thing with the current BP capabilities.

It’s “possible” but the BP would become way too complicated for such a simple function. That was initially why I left out the release function since I believe it would be rarely used anyway. When you added it, I figured the feature request would be coming along at some point anyway, so I went ahead and added it as well.
To have all the various picos, each with their own button layout and different button numbers…well…it would be nested, within nested, within nested. Not really worth IMHO.

would this work for Lutron RA2 select system??

I’m looking to activate a scene through IFTTT when a button is pressed on a pico remote, with the ultimate goal of being able to send rf codes from a button press.

Hello, are you considering setting up a badge so that we can do the automated “import blueprint”? (From a newbie)
Thanks.

Pretty awesome

Does this only work with a Pro or RA2 bridge?

Hi @mattsheffiel and @stephack
I don’t totally understand the release event.
I’d like to have each button on a single press turn a scene on, then if the scene is on another press turns it off. Is this possible?

Also do you guys know if this script will work with PJ2-4B-GXX-L01?

See my response in the other thread regarding toggling scenes.

Thanks stephack
I read into the input select and toggling. A little over my head. I’m more or less a newbie that is good at following guides. Learning as I go.

If I’m not mistaken I can make any 4 button pico control a group of lights to ramp on via HA integration right? Just wouldn’t be native lutron and would require core integration and some HA programming?
If I can’t get toggling to work well my backup plan was to get a PJ2-4B-GWH-L01 because they are cheaper and make
Button 1 Kitchen (3 caseta loads to 75%
Button 2 Kitchen Off (3 caseta loads to 0%)
Button 3 Family (4 family room caseta loads to 75%)
Button 4 Family Off (4 family room caseta loads to 0%)

I’d have the buttons custom engraved after everything is installed and tweaked correctly.

All that said, maybe I should just add (I have plenty of jboxes) some wifi topgreener scene controllers like these flash with tasmota have it backhaul to the lutron casetas.

It seems like I would be able to toggle easier this way and have more flexibility of loads to dim. Does this seem feasible?

Do you think with wifi switches flashed w tasmota will be as fast and synchronized ?
IE
WiFiswitch>hass>lutron casetas
vs
Pico>HA>Lutron casetas

Any way to open this up to all the 4 button scene picos? So that different screen-prints / model numbers can work without modification?

PJ2-4B-GXX-P02 (Pico4ButtonScene)
PJ2-4B-GXX-P03 (Pico4ButtonScene)
PJ2-4B-GXX-P01 (Pico4ButtonScene)

These models come to mind, these are probably the most common scene keypad screenprints.

I hacked on the blueprint to add support for button long presses. I was also working on other Pico blueprints shared in the community, and some features from them made it in as well such as setting the automation mode, which is probably not as useful to others.

I put it online at: 4button-pico-bp.yaml - GitHub

blueprint:
  name: Lutron Caseta Four-Button Scene Pico Actions
  description: Short and long press automations for the Pico four-button remote.
  domain: automation
  input:
    pico_remote:
      name: Pico Four-Button Scene Remote
      description: Select the Pico four-button scene remote to configure.
      selector:
        device:
          model: PJ2-4B-GXX-X31 (Pico4ButtonScene)
          multiple: true
    button_1_press:
      name: Scene One Button - Short press
      description: Action when the scene one button is pressed.
      default: []
      selector:
        action: {}
    button_1_hold:
      name:  Scene One Button - Long press
      description: Action when the scene one button is held.
      default: []
      selector:
        action: {}
    button_1_release:
      name: Scene One Button - Release
      description: Action when the scene one button is released.
      default: []
      selector:
        action: {}
    button_2_press:
      name: Scene Two Button - Short press
      description: Action when the scene two button is pressed.
      default: []
      selector:
        action: {}
    button_2_hold:
      name: Scene Two Button - Long press
      description: Action when the scene two button is held.
      default: []
      selector:
        action: {}
    button_2_release:
      name: Scene Two Button - Release
      description: Action when the scene two button is released.
      default: []
      selector:
        action: {}
    button_3_press:
      name: Scene Three Button - Short press
      description: Action when the scene three button is pressed.
      default: []
      selector:
        action: {}
    button_3_hold:
      name: Scene Three Button - Long press
      description: Action when the scene three button is held.
      default: []
      selector:
        action: {}
    button_3_release:
      name: Scene Three Button - Released
      description: Action when the scene three button is released.
      default: []
      selector:
        action: {}
    off_button_press:
      name: Off Button - Short Press
      description: Action when the off button is pressed.
      default: []
      selector:
        action: {}
    off_button_hold:
      name: Off Button - Long Press
      description: Action when the off button is held.
      default: []
      selector:
        action: {}
    off_button_release:
      name: Off Button - Release
      description: Action when the off button is released.
      default: []
      selector:
        action: {}
    time_before_long_press:
      name: Time before long press
      description: Amount of time button needs to be held before triggering "long press" action.
      default: 1
      selector:
        number:
          min: 0.25
          max: 10.0
          step: 0.25
          unit_of_measurement: seconds
          mode: slider
    auto_mode:
      name: Automation Mode
      description: Mode that automation runs in (single,  restart, queued, parallel).
      default: restart
      selector:
        select:
          options:
            - single
            - restart
            - queued
            - parallel
    mode_max:
      name: Mode Max (ignored by Single and Restart Modes)
      description: Maximum number of runs that can be executed or queued at a time.
      default: 10
      selector:
        number:
          min: 1
          max: 15
trigger:
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: press
    subtype: 'button_1'
    id: button_1_press
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: release
    subtype: 'button_1'
    id: button_1_release
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: press
    subtype: 'button_2'
    id: button_2_press
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: release
    subtype: 'button_2'
    id: button_1_release
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: press
    subtype: 'button_3'
    id: button_3_press
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: release
    subtype: 'button_3'
    id: button_3_release
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: press
    subtype: 'off'
    id: off_button_press
  - platform: device
    device_id: !input pico_remote
    domain: lutron_caseta
    type: release
    subtype: 'off'
    id: off_button_release
action:
  - choose:
      # First scene button press
      - conditions:
          - condition: trigger
            id: button_1_press
        sequence:
          - wait_for_trigger:
              - platform: device
                device_id: !input pico_remote
                domain: lutron_caseta
                type: release
                subtype: 'button_1'
            timeout: !input time_before_long_press
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ not wait.trigger }}"
                sequence: !input button_1_hold
            default: !input button_1_press
      # First scene button release
      - conditions:
          - condition: trigger
            id: button_1_release
        sequence: !input button_1_release
      # Second scene button press
      - conditions:
          - condition: trigger
            id: button_2_press
        sequence:
          - wait_for_trigger:
              - platform: device
                device_id: !input pico_remote
                domain: lutron_caseta
                type: release
                subtype: 'button_2'
            timeout: !input time_before_long_press
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ not wait.trigger }}"
                sequence: !input button_2_hold
            default: !input button_2_press
      # Second scene button release
      - conditions:
          - condition: trigger
            id: button_2_release
        sequence: !input button_2_release
      # Third scene button press
      - conditions:
          - condition: trigger
            id: button_3_press
        sequence:
          - wait_for_trigger:
              - platform: device
                device_id: !input pico_remote
                domain: lutron_caseta
                type: release
                subtype: 'button_3'
            timeout: !input time_before_long_press
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ not wait.trigger }}"
                sequence: !input button_3_hold
            default: !input button_3_press
      # Third scene button release
      - conditions:
          - condition: trigger
            id: button_3_release
        sequence: !input button_3_release
      # Off button press
      - conditions:
          - condition: trigger
            id: off_button_press
        sequence:
          - wait_for_trigger:
              - platform: device
                device_id: !input pico_remote
                domain: lutron_caseta
                type: release
                subtype: 'off'
            timeout: !input time_before_long_press
          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ not wait.trigger }}"
                sequence: !input off_button_hold
            default: !input off_button_press
      # Off button release
      - conditions:
          - condition: trigger
            id: off_button_release
        sequence: !input off_button_release
    default: []
mode: !input auto_mode
max: !input mode_max

I have a PJ2-4B-GBL-L31 that is showing up in @LoremIpsum’s fork of the blueprint but not @mattsheffiel’s original. Does anyone know why that might be the case?

Happy to provide more info, just not sure what would be the most useful.

Thank you for doing this. It seems to be working well for me. With the addition of long press support, I’m trying to add a hold-to-brighten/dim function, but HA does not seem to provide that service. Has anyone else figured out how to do this?

There is an option on the light.turn_on service called Brightness step value. If you call the service with the option, it will adjust the brightness up or down based on the value you give it.

If you use this service call for the button hold action, along with a time delay, and set it to loop, you’ll get a form of the function you’re looking for. It’s not perfect, but it works.

This chunk of blueprint yaml is the above for the down button on a five button pico…

    down_button_should_loop: true
    down_button_hold:
      - service: light.turn_on
        data:
          brightness_step: -5
        target:
          entity_id:
            - light.kitchen_lights
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 250

EDIT: I just realized I wasn’t in a thread about the 5-button blueprint, and I didn’t implement looping in my 4-button BP. It could be added though, it just wasn’t a use case that I had previously considered.

I’ll give that a go. How would I get it to loop?

Here, give this blueprint a shot.

It’s untested, but I just brought in the pieces that handle hold loops on the my five button blueprint, so it was largely just a matter of renaming some stuff. It does remove selection of automation mode and concurrency settings as these need to be set in a specific way to support looping.

Thanks! I just tested it and it worked great to increase the brightness. I’ve got the four buttons set to a group of three lights (Group/Downlights/Chandelier/Lamp), so I’m trying to get the functionality for toggling power and dimming (up and down) for each one out of a single button. With this blueprint, I can do all I need except that when it gets to 100%, it doesn’t reset to 0% or start decreasing. Is there a way to make it do that?

Not natively in the blueprint, no.

I can imagine such functionality could be built using conditionals in the actions (chooser, if/then), along with helper entities to know if brightness should be increasing or decreasing.

1 Like