Forked from sle118/set-zen32-indicator-for-light-with-onoff-state-overwrite.yaml
Last active
June 7, 2024 18:41
-
-
Save jakep82/69d1c7016e0da7ff578184eea6604b40 to your computer and use it in GitHub Desktop.
Blueprint: Set Indicator on a ZEN71 800LR Switch Based on Light Status with on/off state overwrite
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: Set Indicator Light on ZEN71 with State Overwrite | |
| description: For Zooz ZEN71 800LR. Sets the indicator color when light is off or dimmed. | |
| domain: automation | |
| input: | |
| zooz_switch: | |
| name: Zooz Switch | |
| description: List of available Zooz ZEN71 800LR switches. | |
| selector: | |
| device: | |
| integration: zwave_js | |
| manufacturer: Zooz | |
| model: ZEN71 800LR | |
| target_light: | |
| name: Light | |
| description: The light to link to button | |
| selector: | |
| entity: | |
| domain: light | |
| scene_button: | |
| name: Scene Button | |
| description: The button to link to light | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - label: Scene 1 | |
| value: '1' # param 2 for on/off, param 14 for color | |
| off_state: | |
| name: Off State | |
| description: Led state when light is off | |
| default: Led On | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - label: Led On | |
| value: '3' | |
| - label: Led Off | |
| value: '2' | |
| off_color: | |
| name: Off Led Color | |
| description: Color for led when light is off (default white) | |
| default: White | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - label: White | |
| value: '0' | |
| - label: Blue | |
| value: '1' | |
| - label: Green | |
| value: '2' | |
| - label: Red | |
| value: '3' | |
| on_state: | |
| name: On State | |
| description: Led state when light is not dimmed | |
| default: Led On | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - label: Led On | |
| value: '3' | |
| - label: Led Off | |
| value: '2' | |
| on_color: | |
| name: Not Dimmed Led Color | |
| description: Color for led when not dimmed (default white) | |
| default: White | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - label: White | |
| value: '0' | |
| - label: Blue | |
| value: '1' | |
| - label: Green | |
| value: '2' | |
| - label: Red | |
| value: '3' | |
| dim_state: | |
| name: Dim State | |
| description: Led state when light is dimmed | |
| default: Led On | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - label: Led On | |
| value: '3' | |
| - label: Led Off | |
| value: '2' | |
| dimmed_color: | |
| name: Dimmed Color | |
| description: Color to make indicator when light is dimmed (default blue) | |
| default: Blue | |
| selector: | |
| select: | |
| mode: dropdown | |
| options: | |
| - label: White | |
| value: '0' | |
| - label: Blue | |
| value: '1' | |
| - label: Green | |
| value: '2' | |
| - label: Red | |
| value: '3' | |
| mode: single | |
| max_exceeded: silent | |
| variables: | |
| controller_id: !input 'zooz_switch' | |
| light_id: !input 'target_light' | |
| button_id: !input 'scene_button' | |
| toggle_offset: 1 | |
| color_offset: 13 | |
| on_state: !input 'on_state' | |
| off_state: !input 'off_state' | |
| dim_state: !input 'dim_state' | |
| off_color: !input 'off_color' | |
| on_color: !input 'on_color' | |
| dimmed_color: !input 'dimmed_color' | |
| full_brightness: 255 | |
| trigger: | |
| - platform: state | |
| entity_id: !input 'target_light' | |
| attribute: brightness | |
| for: | |
| hours: 0 | |
| minutes: 0 | |
| seconds: 5 | |
| - platform: state | |
| entity_id: !input 'target_light' | |
| action: | |
| - choose: | |
| - conditions: '{{ is_state(light_id, ''off'') }}' # light off | |
| sequence: | |
| - parallel: | |
| - service: zwave_js.set_config_parameter # set indicator color | |
| data: | |
| parameter: '{{ (button_id | int) + (color_offset | int) }}' | |
| value: '{{ off_color }}' | |
| target: | |
| device_id: '{{ controller_id }}' | |
| - service: zwave_js.set_config_parameter # turn indicator to its off state | |
| data: | |
| parameter: '{{ (button_id | int) + (toggle_offset | int) }}' | |
| value: '{{ off_state }}' | |
| target: | |
| device_id: '{{ controller_id }}' | |
| - conditions: '{{ is_state(light_id, ''on'') and not is_state_attr(light_id, ''brightness'', full_brightness) }}' # light on but dim, show dimmed color | |
| sequence: | |
| - parallel: | |
| - service: zwave_js.set_config_parameter # set indicator color | |
| data: | |
| parameter: '{{ (button_id | int) + (color_offset | int) }}' | |
| value: '{{ dimmed_color }}' | |
| target: | |
| device_id: '{{ controller_id }}' | |
| - service: zwave_js.set_config_parameter # turn indicator to its on state | |
| data: | |
| parameter: '{{ (button_id | int) + (toggle_offset | int) }}' | |
| value: '{{ dim_state }}' | |
| target: | |
| device_id: '{{ controller_id }}' | |
| - conditions: '{{ is_state(light_id, ''on'') and is_state_attr(light_id, ''brightness'', full_brightness) }}' # light on all the way, turn off indicator | |
| sequence: | |
| - parallel: | |
| - service: zwave_js.set_config_parameter # set indicator color | |
| data: | |
| parameter: '{{ (button_id | int) + (color_offset | int) }}' | |
| value: '{{ on_color }}' | |
| target: | |
| device_id: '{{ controller_id }}' | |
| - service: zwave_js.set_config_parameter # turn indicator to its off state | |
| data: | |
| parameter: '{{ (button_id | int) + (toggle_offset | int) }}' | |
| value: '{{ on_state }}' | |
| target: | |
| device_id: '{{ controller_id }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment