UPDATE: I suggest you use the blueprint written by @pbergman (and not use the one I posted), it’s much more responsive for dimming lights and works with both operation modes. You can find it here.
Import @pbergman blueprint directly by clicking below if you like:
This is a blueprint for the Moes Smart Knob (operation_mode event) using zigbee2mqtt
Supported actions:
Short press
Double press
Long press (4 seconds)
Rotate Right
Rotate Left
Get started
Click the badge to import this Blueprint: (needs Home Assistant Core 2021.3 or higher)
Or import this Blueprint using the forum topic URL:
blueprint:
name: Zigbee2MQTT - Tuya Moes Smart Knob (Operation Mode = event)
description: Automate your Tuya Smart Knob - ERS-10TZBVK-AA
domain: automation
input:
mode:
name: Automation Modes
description: "https://www.home-assistant.io/docs/automation/modes/"
default: parallel
selector:
select:
mode: dropdown
options:
- single
- restart
- queued
- parallel
switch:
name: Tuya Smart Knob
description: Tuya Smart Knob used as Button
selector:
entity:
integration: mqtt
domain: sensor
multiple: false
button_short_press:
name: Single Press
description: Action to run on single press (careful not to turn knob instead)
default: []
selector:
action: {}
button_double_press:
name: Double Press
description: Action to run on double press (careful not to turn knob instead)
default: []
selector:
action: {}
button_long_press:
name: Long Press
description: Action to run on long press (at least 4 seconds - careful not to turn knob instead)
default: []
selector:
action: {}
button_rotate_right:
name: Rotate Right
description: Action to run when Smart Knob is rotated right
default: []
selector:
action: {}
button_rotate_left:
name: Rotate Left
description: Action to run when Smart Knob is rotated left
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/zigbee2mqtt-tuya-moes-smart-knob-ers-10tzbvk-aa/419989
mode: !input mode
max_exceeded: silent
trigger:
- platform: state
entity_id: !input "switch"
action:
- variables:
command: "{{ trigger.to_state.state }}"
- choose:
- conditions:
- "{{ command == 'single' }}"
sequence: !input "button_short_press"
- conditions:
- "{{ command == 'double' }}"
sequence: !input "button_double_press"
- conditions:
- "{{ command == 'hold' }}"
sequence: !input "button_long_press"
- conditions:
- "{{ command == 'rotate_right' }}"
sequence: !input "button_rotate_right"
- conditions:
- "{{ command == 'rotate_left' }}"
sequence: !input "button_rotate_left"
Removed “attribute: action” under “- platform: state”
Added Automation mode drop down. see: Automation modes - Home Assistant (Also because of the new dropdown you might have to re-edit your automation if you already have one using this blueprint)
Changed default automation mode fom “restart” to “parallel” (which works best for me, a little more responsive I find it)
Hi, thanks for this
My zibgee coordinator firmware was from a february build, I noticed i was able to get additional actions like ‘color_temperature_step_up’, ‘color_temperature_step_down’, ‘hue_stop’
but after I updated to may build i was no longer getting those actions.
I’m just wondering if you had similar issues with that?
from zigbee2mqtt webinterface you can forexample easily change this, and this changes how the button operates and the type of actions received.
This blueprint is for “event” mode and only reacts to the following actions:
single, double, hold, rotate_right and rotate_left.
another blueprint should be written for the command mode (the one you would use for light controls).
You can also change the operation mode by sending an mqtt-message from mqtt-explorer or homeassistant integration for example.
If the name of your device is “Smart Knob” (please note I’ve renamed it) then you can publish the following mqtt message to topic:
zigbee2mqtt/Smart Knob/set
with payload: {“operation_mode”: “command”}
and when rotaing_right you get “brightness_step_up” for example
Has anyone adapted this yet to also include the the other actions like press+rotate? Also, some consideration for how far it is turned at once? There was a pretty good ZHA blueprint but I switched to Z2M and could not find a similar one.
I get the
" Invalid blueprint: extra keys not allowed @ data[‘blueprint’][‘input’][‘switch’][‘selector’][‘multiple’].
Got None"
when adding to my hassio instance. What’s wrong? Any help would be greatly appreciated.
.
not written it for comand mode, but have wrote two automations/scripts so you can choose it to work with either temprature, or us it for cycling scenes (push and rotate) under non push and rotate its is just brightness.
I’ve integrated the smart knob to Z2M as command mode and I’ve created a simple action on node red (one click to on or off). This action is working fine.
The intention here is this button controls a Sonoff D1 dimmer.
To my surprise the rotation is working as well for the dimmer, despite I haven’t any action/programming on node red for the rotation.
It should be ok with less work, but the problem is that the brightness value is wrong… the system (I don’t know if the Z2M or Node Red) gets the rotation value as the new brightness, so let’s suppose I’m with 150 as brightness and I want to increase a little more and rotate it 30, for instance, the new brightness value is 30 and not 180 (150 + 30). This is hard because I have to discover the right “size” of rotation for the perfect brightness I want for that, and it should work as a volume button, where you rotate a small part of it and the volume increase or decrease that small part for the present volume.
In the Z2M logs I can see both values (example below), and as I’ve described above the new brightness comes from the value of action_step_size and not from the brightness.
Info 2022-09-07 22:38:58MQTT publish: topic 'zigbee2mqtt/Botao_Dimmer_Casal', payload '{"action":"brightness_step_up","action_rate":null,"action_step_size":25,"action_transition_time":0.01,"battery":100,"brightness":240,"linkquality":69,"operation_mode":"command","voltage":3000}'
Does anyone know how could I change it? I’d like to work with the brightness value, which changes perfectly (increasing or decreasing from the previous value).
Thanks a lot.
Thanks. This is rather exciting. I have the knob linked to my dimmable light.
I see 1 turn changes 10%. But if I turn fast (feel many clicks), it still does 10%. It doesn’t feel like it’s doing sth.
How can this be made to change more?