Skip to content

Instantly share code, notes, and snippets.

@smartqasa
Last active July 26, 2025 18:19
Show Gist options
  • Select an option

  • Save smartqasa/4bc708e5f0a9618b0471b7ebaa7d25d2 to your computer and use it in GitHub Desktop.

Select an option

Save smartqasa/4bc708e5f0a9618b0471b7ebaa7d25d2 to your computer and use it in GitHub Desktop.
Pico 5 Button (model PJ2-3BRL-GXX-F01) - Fan Control
blueprint:
domain: automation
source_url: https://gist.github.com/smartqasa/4bc708e5f0a9618b0471b7ebaa7d25d2
name: Lutron Pico 5 Button - Fan Entity Control
description: >-
Control one or more fans using a Lutron Pico 5 Button (model PJ2-3BRL-GXX-X01).
This blueprint simulates a standard Lutron Caseta fan controller, including press-and-hold
for the raise/lower buttons. Specify the number of speed settings the fan supports
(4 or 6), and set the speed percentage for the "on" button. The blueprint also allows you to
assign any action to the middle (favorite) button.
input:
pico:
name: Pico Device
description: "Pico remote to associate with entity."
selector:
device:
filter:
model: PJ2-3BRL-GXX-F01 (Pico3ButtonRaiseLower)
entity:
name: Fan Entity
description: "Fan entity to control."
selector:
entity:
filter:
domain: fan
speeds:
name: Speeds
description: "The number of speed settings the fan entity supports."
selector:
select:
options:
- "4"
- "6"
on_speed:
name: On Speed
description: "The speed percentage at which the fan will be set when the on button is pressed."
selector:
number:
min: 15
max: 100
default: 100
middle_button_action:
name: Middle (Favorite) Button Action - Optional
description: "Action(s) to execute when MIDDLE button is pressed."
selector:
action: {}
default:
variables:
speeds: !input speeds
middle_button_action: !input middle_button_action
trigger:
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "on"
id: on_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "raise"
id: up_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: release
subtype: "raise"
id: up_released
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "stop"
id: stop_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "lower"
id: down_pressed
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: release
subtype: "lower"
id: down_released
- trigger: device
device_id: !input pico
domain: lutron_caseta
type: press
subtype: "off"
id: off_pressed
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: on_pressed
sequence:
- action: fan.turn_on
data:
percentage: !input on_speed
target:
entity_id: !input entity
- conditions:
- condition: trigger
id: up_pressed
sequence:
- repeat:
sequence:
- action: fan.increase_speed
data:
percentage_step: "{{ (100 / speeds | int) | round }}"
target:
entity_id: !input entity
- delay:
milliseconds: 750
until:
- condition: state
entity_id: !input entity
attribute: percentage
state: "100"
- conditions:
- condition: trigger
id: up_released
sequence:
- delay:
milliseconds: 1
- conditions:
- condition: trigger
id: stop_pressed
sequence:
- choose:
- conditions: "{{ middle_button_action is not none and middle_button_action | length > 0 }}"
sequence: !input middle_button_action
default:
- if:
- condition: state
entity_id: !input entity
attribute: direction
state: reverse
then:
- action: fan.set_direction
data:
direction: forward
target:
entity_id: !input entity
else:
- action: fan.set_direction
data:
direction: reverse
target:
entity_id: !input entity
- conditions:
- condition: trigger
id: down_pressed
sequence:
- repeat:
sequence:
- action: fan.decrease_speed
data:
percentage_step: "{{ (100 / speeds | int) | round }}"
target:
entity_id: !input entity
- delay:
milliseconds: 750
until:
- condition: numeric_state
entity_id: !input entity
attribute: percentage
below: 1
- conditions:
- condition: trigger
id: down_released
sequence:
- delay:
milliseconds: 1
- conditions:
- condition: trigger
id: off_pressed
sequence:
- action: fan.turn_off
target:
entity_id: !input entity
mode: restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment