- Change trigger for ERS Knob Z2M

This commit is contained in:
Nate Harris 2023-09-25 22:37:15 -06:00
parent 513aff4811
commit fe779797bc
1 changed files with 6 additions and 12 deletions

View File

@ -63,22 +63,16 @@ blueprint:
filter: filter:
domain: input_number domain: input_number
base_topic:
name: Zigbee2MQTT Base mqtt topic
description: The base topic configured in Zigbee2MQTT. If you haven't changed this, leave the default here ("zigbee2mqtt")
default: zigbee2mqtt
# Queued, to ignore non-matched events but capture existing ones # Queued, to ignore non-matched events but capture existing ones
mode: queued mode: queued
max: 20 max: 20
max_exceeded: silent max_exceeded: silent
trigger_variables:
base_topic: !input base_topic
trigger: trigger:
- platform: mqtt - platform: state
topic: "{{ base_topic }}/+" entity_id: !input dial
not_to: ""
attribute: action
action: action:
- variables: - variables:
@ -93,8 +87,8 @@ action:
command: "{{ trigger.to_state.state }}" command: "{{ trigger.to_state.state }}"
single_pressed: "{{ command == 'toggle' }}" single_pressed: "{{ command == 'toggle' }}"
double_pressed: "{{ command == 'double' }}" double_pressed: "{{ command == 'double' }}"
rotated: "{{ command in ['brightness_step_up', 'brightness_step_up'] }}" rotated: "{{ command in ['brightness_step_up', 'brightness_step_down', 'color_temperature_step_up', 'color_temperature_step_down'] }}"
positive: "{{ command == 'brightness_step_up' }}" positive: "{{ command in ['brightness_step_up', 'color_temperature_step_up'] }}"
step_size: "{{ trigger.to_state.attributes.action_step_size }}" step_size: "{{ trigger.to_state.attributes.action_step_size }}"
# How many steps to go full rotation (min 13 per step * 20 steps per full rotation) # How many steps to go full rotation (min 13 per step * 20 steps per full rotation)
full_rotate_step_count: "{{ 13 * 20 | int }}" full_rotate_step_count: "{{ 13 * 20 | int }}"