I also use this device but I cannot listen via mqtt. How did you achieve this?
I installed mqtt integration, created a username and password and activated it. I couldn’t figure out how to listen to this and my other zigbee devices. I couldn’t do it.
Thank you for the code. It is great. I had some little problems when I first set it but I was able to edit the blueprint and everything works.
I had to change 2 small things on it to work, my edited version is here:
blueprint:
name: Zigbee2MQTT - Tuya Moes Smart Knob (Operation Mode = event or command)
description: Automate your Tuya Smart Knob - ERS-10TZBVK-AA
domain: automation
input:
switch:
name: Tuya Smart Knob
description: Tuya Smart Knob used in command or event mode (triple press will switch modes)
selector:
entity:
integration: mqtt
domain:
- sensor
multiple: false
event_button_short_press:
name: Event - Single Press
description: Action to run on single press (careful not to turn knob instead)
default: []
selector:
action: {}
event_button_double_press:
name: Event - Double Press
description: (Most likely won't work in command) Action to run on double press (careful not to turn knob instead)
default: []
selector:
action: {}
event_button_long_press:
name: Event - Long Press
description: Action to run on long press (at least 4 seconds - careful not to
turn knob instead)
default: []
selector:
action: {}
event_button_rotate_right:
name: Event - Rotate Right
description: Action to run when Smart Knob is rotated right
default: []
selector:
action: {}
event_button_rotate_left:
name: Event - Rotate Left
description: Action to run when Smart Knob is rotated left
default: []
selector:
action: {}
command_button_short_press:
name: Command - Single Press
description: Action to run on single press (careful not to turn knob instead)
default: []
selector:
action: {}
command_button_long_press:
name: Command - Long Press
description: Action to run on long press (at least 4 seconds - careful not to
turn knob instead)
default: []
selector:
action: {}
command_button_rotate_right:
name: Command - Rotate Right
description: Action to run when Smart Knob is rotated right
default: []
selector:
action: {}
command_button_rotate_left:
name: Command - Rotate Left
description: Action to run when Smart Knob is rotated left
default: []
selector:
action: {}
command_button_rotate_press_right:
name: Command - Rotate Press Right
description: Action to run when Smart Knob is rotated left
default: []
selector:
action: {}
command_button_rotate_press_left:
name: Command - Rotate Press Left
description: Action to run when Smart Knob is rotated left
default: []
selector:
action: {}
source_url: https://dummyurl.com/new
mode: restart
max_exceeded: silent
trigger:
- platform: state
entity_id: !input switch
action:
- variables:
command: '{{ trigger.to_state.state }}'
- choose:
- conditions:
- '{{ command == ''single'' }}'
sequence: !input event_button_short_press
- conditions:
- '{{ command == ''double'' }}'
sequence: !input event_button_double_press
- conditions:
- '{{ command == ''hold'' }}'
sequence: !input event_button_long_press
- conditions:
- '{{ command == ''rotate_right'' }}'
sequence: !input event_button_rotate_right
- conditions:
- '{{ command == ''rotate_left'' }}'
sequence: !input event_button_rotate_left
- conditions:
- '{{ command == ''toggle'' }}'
sequence: !input command_button_short_press
- conditions:
- '{{ command == ''hue_move'' }}'
sequence: !input command_button_long_press
- conditions:
- '{{ command == ''brightness_step_up'' }}'
sequence: !input command_button_rotate_right
- conditions:
- '{{ command == ''brightness_step_down'' }}'
sequence: !input command_button_rotate_left
- conditions:
- '{{ command == ''color_temperature_step_up'' }}'
sequence: !input command_button_rotate_press_right
- conditions:
- '{{ command == ''color_temperature_step_down'' }}'
sequence: !input command_button_rotate_press_left
this is great, thanks a lot for sharing. This is so far the smoothest code i found to control my light with this Knob.
any chance somebody can guide on how to implement color temperature control?
i know the commad equivalent
"{{ command == ''color_temperature_step_up'' }}"
but i don’t know which is the equivalent color temp code of the below:
I bought this device this week and using this blueprint from the beginning of the page. It seems to be working, but it’s very slow to increase/decrease brightness with z2m. Any way to solve it?"
FWIW this is my solution for now for a light entitiy - see below.
This will only work in command mode.
Supports:
-light entity toggle (single click)
-brightness dimming (turn button)
-prevents dimming to 0 and therefore switching off the light. The Minimum brightness is adjustable through a variable.
-color temperature (press & turn) with safety mechanisms: you can define min and max Kelvin values of your specific bulb through variables
-fine-tune the resolution for color temperature adjustments via step_multiplier variable (recommended between 4 to 8 but feel free to experiment)
For now not a blueprint but a normal automation. So if somebody uses it you will have to adjust to your specific MQTT topic and the light entity.
I (like many others) can’t seem to get this button to work. I’ve got it connected fine on Zigbee2Mqtt but whenever I press the button or rotate, no events are emitted. It’s correctly identified, is this a Z2M issue?
Amigo muchas gracias por tu configuracion, despues de dias buscando un ```
blueprint para mi Moes he conseguido dar con tu automatizacion y me ha funcionado a la primera, cambiando un par de cosas.
de verdad mil gracias por tu aporte¡¡¡¡¡
un saludo
Hi. Thanks for sharing your automation. I could not get the blueprints to work so far as I cannot find my bulb in the list of available entities. However, only the toggle action works for me. When I go into z2m I get the following error:
So I took the time, transferred the basic idea of this automation into an blueprint and added a couple more feature including keeping the knob in command-mode automatically: