Improvements and better UI for the Blueprints

This commit is contained in:
2021-12-14 09:33:38 +00:00
parent e8fa16edfd
commit 181770695b
5 changed files with 77 additions and 63 deletions

View File

@@ -1,13 +1,16 @@
blueprint:
name: Zigbee2MQTT - Hue Dimmer Switch (324131092621) - Lights
description:
This blueprint is for the Hue Dimmer Switch (324131092621) being controlled via Zigbee2MQTT. This blueprint provides
configuration for a light set, rather than individual buttons.
This blueprint is for the Hue Dimmer Switch (324131092621) being controlled
via Zigbee2MQTT. This blueprint provides configuration for a light set, rather
than individual buttons.
domain: automation
input:
dimmer_switch:
name: Dimmer Switch
description: The Hue Dimmer Switch to use for this automation. Pick the "Action" sensor for the Switch
description:
The Hue Dimmer Switch to use for this automation. Pick the "Action"
sensor for the Switch
selector:
entity:
integration: mqtt
@@ -21,35 +24,35 @@ blueprint:
domain: light
force_brightness:
name: Force turn on brightness
description: >
Force the brightness to the set level below, when the "on" button on
the remote is pushed and lights turn on.
description:
'Force the brightness to the set level below, when the "on" button
on the remote is pushed and lights turn on.'
default: false
selector:
boolean:
boolean: {}
brightness:
name: Brightness
description: Brightness of the light(s) when turning on
default: 50
selector:
number:
min: 0
max: 100
min: 0.0
max: 100.0
mode: slider
step: 1
step: 1.0
unit_of_measurement: "%"
source_url: https://github.com/nikdoof/homeassistant-blueprints/blob/main/zigbee2mqtt/z2m-hue-dimmer-switch-lights.yaml
source_url: https://github.com/nikdoof/homeassistant-blueprints/blob/main/zigbee2mqtt/z2m-hue-dimmer-switch-light.yaml
mode: restart
max_exceeded: silent
variables:
force_brightness: !input force_brightness
force_brightness: !input "force_brightness"
trigger:
- platform: state
entity_id: !input "dimmer_switch"
attribute: action
action:
- variables:
command: '{{ trigger.to_state.attributes.action }}'
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'on-press' }}"
@@ -58,27 +61,27 @@ action:
- conditions: "{{ force_brightness }}"
sequence:
- service: light.turn_on
target: !input light
target: !input "light"
data:
transition: 1
brightness_pct: !input brightness
brightness_pct: !input "brightness"
default:
- service: light.turn_on
target: !input light
- service: light.toggle
target: !input "light"
data:
transition: 1
- conditions:
- "{{ command == 'off-press' }}"
sequence:
- service: light.turn_off
target: !input light
target: !input "light"
data:
transition: 1
- conditions:
- "{{ command == 'up-press' }}"
sequence:
- service: light.turn_on
target: !input light
target: !input "light"
data:
brightness_step_pct: 10
transition: 1
@@ -88,7 +91,7 @@ action:
- repeat:
until:
- condition: state
entity_id: !input dimmer_switch
entity_id: !input "dimmer_switch"
state: up-hold-release
attribute: action
sequence:
@@ -96,13 +99,13 @@ action:
data:
brightness_step_pct: 10
transition: 1
target: !input light
target: !input "light"
- delay: "1"
- conditions:
- "{{ command == 'down-press' }}"
sequence:
- service: light.turn_on
target: !input light
target: !input "light"
data:
brightness_step_pct: -10
transition: 1
@@ -112,7 +115,7 @@ action:
- repeat:
until:
- condition: state
entity_id: !input dimmer_switch
entity_id: !input "dimmer_switch"
state: down-hold-release
attribute: action
sequence:
@@ -120,5 +123,5 @@ action:
data:
brightness_step_pct: -10
transition: 1
target: !input light
target: !input "light"
- delay: "1"