-
-
Save Sperryfreak01/59e16cda1d661daf5c1ba1e9682de897 to your computer and use it in GitHub Desktop.
Lutron Pico 5 Button - Light Entity Control
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: Lutron Pico 4 Button - Light Entity Control | |
description: "This blueprint allows for the association a Lutron Pico 4 Button (model PJ2-2BRL-GXX-X01) remote with a light entity. It is designed to simulate the operation of a standard Lutron Caseta wall dimmer including the press and hold functionality for the raise/lower buttons. It allows for the control over the brightness step percentage and transition speed and the assignment of any action to the middle button." | |
source_url: https://gist.github.com/Sperryfreak01/59e16cda1d661daf5c1ba1e9682de897 based on work by cymone, https://gist.github.com/cymone-smart/9814a750a0d0cfb196fa1fa7ae3630bb | |
domain: automation | |
input: | |
pico_1: | |
name: Pico Device | |
description: "Pico remote to associate with light entity." | |
selector: | |
device: | |
model: PJ2-4B-GXX-X01 (Pico4ButtonZone) | |
# enabled_2: | |
# name: 2nd Pico - Enable | |
# description: "Toggle on to activate a second Pico remote." | |
# selector: | |
# boolean: | |
# default: false | |
# pico_2: | |
# name: 2nd Pico - Device | |
# description: "Pico remote to associate with light entity." | |
# selector: | |
# device: | |
# model: PJ2-4B-GXX-X01 (Pico4ButtonZone) | |
# default: | |
# enabled_3: | |
# name: 3rd Pico - Enable | |
# description: "Toggle on to activate a third Pico remote." | |
# selector: | |
# boolean: | |
# default: false | |
# pico_3: | |
# name: 3rd Pico - Device | |
# description: "Pico remote to associate with light entity." | |
# selector: | |
# device: | |
# model: PJ2-4B-GXX-X01 (Pico4ButtonZone) | |
# default: | |
# enabled_4: | |
# name: 4th Pico - Enable | |
# description: "Toggle on to activate a fourth Pico remote." | |
# selector: | |
# boolean: | |
# default: false | |
# pico_4: | |
# name: 4th Pico - Device | |
# description: "Pico remote to associate with light entity." | |
# selector: | |
# device: | |
# model: PJ2-4B-GXX-X01 (Pico4ButtonZone) | |
# default: | |
entity: | |
name: Light Entity(ies) | |
description: "Light entity to control." | |
selector: | |
entity: | |
domain: light | |
multiple: true | |
transition_on: | |
name: On Transition | |
description: "The duration in seconds for the light entity to transiton on." | |
selector: | |
number: | |
min: 0 | |
max: 15 | |
unit_of_measurement: seconds | |
default: 1 | |
transition_off: | |
name: Off Transition | |
description: "The duration in seconds for the light entity to transiton off." | |
selector: | |
number: | |
min: 0 | |
max: 15 | |
unit_of_measurement: seconds | |
default: 2 | |
step: | |
name: Brightness Step Percentage | |
description: "The percentage of brightness to which the light is changed when the RAISE/LOWER buttons are pressed and held." | |
selector: | |
number: | |
min: 1 | |
max: 33 | |
unit_of_measurement: percentage | |
default: 10 | |
speed: | |
name: Brightness Transition Speed | |
description: "The rate of speed in milliseconds at which the brightness of the light entity will be changed." | |
selector: | |
number: | |
min: 100 | |
max: 2000 | |
unit_of_measurement: milliseconds | |
default: 500 | |
trigger: | |
- platform: device | |
device_id: !input pico_1 | |
domain: lutron_caseta | |
type: press | |
subtype: 'on' | |
id: on_pressed | |
- platform: device | |
device_id: !input pico_1 | |
domain: lutron_caseta | |
type: press | |
subtype: 'raise' | |
id: up_pressed | |
- platform: device | |
device_id: !input pico_1 | |
domain: lutron_caseta | |
type: release | |
subtype: 'raise' | |
id: up_released | |
- platform: device | |
device_id: !input pico_1 | |
domain: lutron_caseta | |
type: press | |
subtype: 'lower' | |
id: down_pressed | |
- platform: device | |
device_id: !input pico_1 | |
domain: lutron_caseta | |
type: release | |
subtype: 'lower' | |
id: down_released | |
- platform: device | |
device_id: !input pico_1 | |
domain: lutron_caseta | |
type: press | |
subtype: 'off' | |
id: off_pressed | |
# - enabled: !input enabled_2 | |
# platform: device | |
# device_id: !input pico_2 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'on' | |
# id: on_pressed | |
# - enabled: !input enabled_2 | |
# platform: device | |
# device_id: !input pico_2 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'raise' | |
# id: up_pressed | |
# - enabled: !input enabled_2 | |
# platform: device | |
# device_id: !input pico_2 | |
# domain: lutron_caseta | |
# type: release | |
# subtype: 'raise' | |
# id: up_released | |
# - enabled: !input enabled_2 | |
# platform: device | |
# device_id: !input pico_2 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'stop' | |
# id: stop_pressed | |
# - enabled: !input enabled_2 | |
# platform: device | |
# device_id: !input pico_2 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'lower' | |
# id: down_pressed | |
# - enabled: !input enabled_2 | |
# platform: device | |
# device_id: !input pico_2 | |
# domain: lutron_caseta | |
# type: release | |
# subtype: 'lower' | |
# id: down_released | |
# - enabled: !input enabled_2 | |
# platform: device | |
# device_id: !input pico_2 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'off' | |
# id: off_pressed | |
# | |
# - enabled: !input enabled_3 | |
# platform: device | |
# device_id: !input pico_3 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'on' | |
# id: on_pressed | |
# - enabled: !input enabled_3 | |
# platform: device | |
# device_id: !input pico_3 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'raise' | |
# id: up_pressed | |
# - enabled: !input enabled_3 | |
# platform: device | |
# device_id: !input pico_3 | |
# domain: lutron_caseta | |
# type: release | |
# subtype: 'raise' | |
# id: up_released | |
# - enabled: !input enabled_3 | |
# platform: device | |
# device_id: !input pico_3 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'stop' | |
# id: stop_pressed | |
# - enabled: !input enabled_3 | |
# platform: device | |
# device_id: !input pico_3 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'lower' | |
# id: down_pressed | |
# - enabled: !input enabled_3 | |
# platform: device | |
# device_id: !input pico_3 | |
# domain: lutron_caseta | |
# type: release | |
# subtype: 'lower' | |
# id: down_released | |
# - enabled: !input enabled_3 | |
# platform: device | |
# device_id: !input pico_3 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'off' | |
# id: off_pressed | |
# | |
# - enabled: !input enabled_4 | |
# platform: device | |
# device_id: !input pico_4 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'on' | |
# id: on_pressed | |
# - enabled: !input enabled_4 | |
# platform: device | |
# device_id: !input pico_4 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'raise' | |
# id: up_pressed | |
# - enabled: !input enabled_4 | |
# platform: device | |
# device_id: !input pico_4 | |
# domain: lutron_caseta | |
# type: release | |
# subtype: 'raise' | |
# id: up_released | |
# - enabled: !input enabled_4 | |
# platform: device | |
# device_id: !input pico_4 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'stop' | |
# id: stop_pressed | |
# - enabled: !input enabled_4 | |
# platform: device | |
# device_id: !input pico_4 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'lower' | |
# id: down_pressed | |
# - enabled: !input enabled_4 | |
# platform: device | |
# device_id: !input pico_4 | |
# domain: lutron_caseta | |
# type: release | |
# subtype: 'lower' | |
# id: down_released | |
# - enabled: !input enabled_4 | |
# platform: device | |
# device_id: !input pico_4 | |
# domain: lutron_caseta | |
# type: press | |
# subtype: 'off' | |
# id: off_pressed | |
variables: | |
step: !input step | |
speed: !input speed | |
condition: [] | |
action: | |
- choose: | |
- conditions: | |
- condition: trigger | |
id: on_pressed | |
sequence: | |
- service: light.turn_on | |
data: | |
transition: !input transition_on | |
brightness_pct: 100 | |
target: | |
entity_id: !input entity | |
- conditions: | |
- condition: trigger | |
id: up_pressed | |
sequence: | |
- repeat: | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_step_pct: !input step | |
transition: "{{ speed / 1000 }}" | |
target: | |
entity_id: !input entity | |
- delay: | |
milliseconds: !input speed | |
until: | |
- condition: state | |
entity_id: !input entity | |
attribute: brightness | |
state: "100" | |
- conditions: | |
- condition: trigger | |
id: up_released | |
sequence: | |
- delay: | |
milliseconds: 100 | |
- conditions: | |
- condition: trigger | |
id: down_pressed | |
sequence: | |
- repeat: | |
sequence: | |
- service: light.turn_on | |
data: | |
brightness_step_pct: "{{ step * -1 }}" | |
transition: "{{ speed / 1000 }}" | |
target: | |
entity_id: !input entity | |
- delay: | |
milliseconds: !input speed | |
until: | |
- condition: numeric_state | |
entity_id: !input entity | |
attribute: brightness | |
below: 1 | |
- conditions: | |
- condition: trigger | |
id: down_released | |
sequence: | |
- delay: | |
milliseconds: 100 | |
- conditions: | |
- condition: trigger | |
id: off_pressed | |
sequence: | |
- service: light.turn_off | |
data: | |
transition: !input transition_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
very much a work in progress. Just started updating the script to work with PJ2-4B-GXX-X01 (Pico4ButtonZone)