-
-
Save DaveO16176/039255698fadfa5b3298d095c05fbd3b to your computer and use it in GitHub Desktop.
Pico 5 Button (model PJ2-3BRL-GXX-F01) - Fan 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: | |
| domain: automation | |
| source_url: https://gist.github.com/DaveO16176/039255698fadfa5b3298d095c05fbd3b | |
| 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, 6, or 7), 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" | |
| - "7" | |
| 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: 10 | |
| 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 | float) | round(0, 'floor') }}" | |
| 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 | float) | round(0, 'ceil') }}" | |
| 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added a speed option of 7 and changed the minimum on speed from 15 to 10 to enable Big Ass Fan Haiku fans. They have 7 speed steps and the minimum fan speed is 14.