I use Z2M with MOES Tuya zigbee smart knob ( TuYa ERS-10TZBVK-AA control via MQTT | Zigbee2MQTT)
and this zigbee light bulb: ( TuYa TS0505B_1 control via MQTT | Zigbee2MQTT)
this is the automation I use:
alias: 6
description: ""
trigger:
- platform: mqtt
topic: zigbee2mqtt/smart_knob
condition: []
action:
- variables:
command: "{{ trigger.payload_json.action }}"
size: "{{ trigger.payload_json.action_step_size }}"
- choose:
- conditions:
- condition: template
value_template: "{{ command == 'toggle' }}"
sequence:
- service: light.toggle
data: {}
target:
entity_id: light.0xa4c13820c8f952c4
- conditions:
- condition: template
value_template: "{{ command == 'brightness_step_up' }}"
sequence:
- service: mqtt.publish
data:
topic: zigbee2mqtt/office_celling_zb_light/set
payload: >
{"brightness_step_onoff": {{( size *
0.2)|round}},"transition":0.1 }
- conditions:
- condition: template
value_template: "{{ command == 'brightness_step_down' }}"
sequence:
- service: mqtt.publish
data:
topic: zigbee2mqtt/office_celling_zb_light/set
payload: |
{"brightness_step_down": {{( size *
0.2)|round}},"transition":0.1 }
- conditions:
- condition: template
value_template: "{{ command == 'color_temperature_step_up' }}"
enabled: true
sequence:
- service: mqtt.publish
data:
topic: zigbee2mqtt/office_celling_zb_light/set
payload: |
{"color_temp_step": {{ size * 0.5}},"transition":0.1 }
enabled: true
- conditions:
- condition: template
value_template: "{{ command == 'color_temperature_step_down' }}"
enabled: true
sequence:
- service: mqtt.publish
data:
topic: zigbee2mqtt/office_celling_zb_light/set
payload: |
{"color_temp_step": -{{ size * 0.5 }},"transition":0.1 }
enabled: true
mode: queued
max_exceeded: silent
max: 10
The two issues I cannot solve are the gradual brightness change (rotate left/right) and color temp change (press + rotate left/right)
what am I doing wrong here?