Zigbee2MQTT Tuya Moes Smart Knob (ERS-10TZBVK-AA)

I’m using the blueprint from the top of this thread since quite some time, so in event mode.
Everything was OK until some weeks ago where the single press on the button is not triggering the action (light.toggle). All other actions are working fine (double press, rotate, long press).
The strangest thing is that if I go to this automation and run manually the action for single press (click click “run” from the 3 dots menu next to the action, it executes properly.

Any idea ?

Is the device now set to command mode instead of event mode?

I checked and it’s still in event mode. Switched it to command then back to event and it remains the same

I had the same problem with “Empty string(”“)” actions when using z2m. After I switched to ZHA the problem seems to be gone. Maybe a problem in the z2m converter?

Hm, probably related to:

  • Fix duplicate actions for TuYa ERS-10TZBVK-AA and ERS-10TZBVB-AA (#6326) (d69dc7a)

After searching a bit more:

alanmgomes means, that this behaviour is “a feature”

Z2M create two entity “Action step size” & “Action” that are not syncrhone giving wrong results when getting the value after a trigger.
Using directly the MQTT root topic bypass this prob because with one query you have the two value at the same time

alias: Knob - LED Bureau
description: ""
trigger:
  - platform: mqtt
    topic: zigbee2mqtt/Knob1
condition: []
action:
  - variables:
      command: "{{ trigger.payload_json.action  }}"
      step_size: "{{ trigger.payload_json.action_step_size }}"
      step_percent: >-
        {% if is_number(step_size) %} {{ (step_size / 2 ) | int }} {% else %} {{
        0 }} {% endif %}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ command== 'toggle' }}"
        sequence:
          - service: light.toggle
            target:
              entity_id: light.wled_pc
            data: {}
      - conditions:
          - condition: template
            value_template: "{{ command == 'brightness_step_down' }}"
        sequence:
          - service: light.turn_on
            data_template:
              brightness_step_pct: "-{{ step_percent }}"
              transition: 0.5
            target:
              entity_id: light.wled_pc
      - conditions:
          - condition: template
            value_template: "{{ command == 'brightness_step_up' }}"
        sequence:
          - service: light.turn_on
            data_template:
              brightness_step_pct: "{{ step_percent }}"
              transition: 0.5
            target:
              entity_id: light.wled_pc
mode: single

1 Like

Hi there,
for me this doesn’t work, it triggers the automation but won’t run one of the three actions it has to choose.
any idea on what might be the problem?

Z2M 1.33.2-1
HA is updated

Hello;

Just chiming in to say this device is useless and never works. It’s been months and every single time I try it nothing happens. Sometimes I can click it a bunch and get the mapped light to come on, but I’ve never gotten it to turn off.

I guess I have to replace this since nobody seems to believe there is serious issues induced through zigbee2mqtt or through home assistant.

Before this trouble started it was working absolutely perfectly.

1 Like

Check Z2M log tab, you will see what’s in the mqtt event that is triggered
condition & action have to match (maybe it spell different between version)

Exemple of my log
{"action":"brightness_step_up", "action_rate":null,"action_step_size":37,"action_transition_time":0.02,"battery":100,"linkquality":124,"operation_mode":"command","voltage":3000}

Hello,

For me, it was not working.
Error: UndefinedError: ‘dict object’ has no attribute ‘to_state’

My scenario was easy to code so i did it with an easy automation
Here is the code if you have same issue than me

description: ""
alias: Knob - Bureau Yoann
trigger:
  - platform: mqtt
    topic: zigbee2mqtt/entity_name/action
condition: []
action:
  - variables:
      command: "{{ trigger.payload.strip() }}"
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ command == 'single' }}"
        sequence:
          - type: turn_on
            device_id: 123456hd
            entity_id: 123456hd
            domain: light
        alias: Single Action
      - conditions:
          - condition: template
            value_template: "{{ command == 'double' }}"
        sequence:
          - type: turn_off
            device_id: 123456hd
            entity_id: 123456hd
            domain: light
        alias: Double Action
      - conditions:
          - condition: template
            value_template: "{{ command == 'hold' }}"
        sequence: []
        alias: Hold Action
      - conditions:
          - condition: template
            value_template: "{{ command == 'rotate_left' }}"
        sequence:
          - device_id: 123456hd
            domain: light
            entity_id: 123456hd
            type: brightness_decrease
        alias: Rotate Left Action
      - conditions:
          - condition: template
            value_template: "{{ command == 'rotate_right' }}"
        sequence:
          - device_id: 123456hd
            domain: light
            entity_id: 123456hd
            type: brightness_increase
        alias: Rotate Right Action
mode: single

Works like a charm

Couldn’t get this blueprint to work so i created one that works with both command and event mode (and switching operations).

For anybody interested the blue print can be found here

2 Likes

Hello.
This blueprint its very interesting because inify the 2 modes.
But dont work for me, can you explan exactly what i need to fill in the blueprint?

Name: its the name as apears in the zigbee2mqtt (default name is 0x… but i rename. its correct?)

State: I dont know what i need to put in the “state”

thanks a lot!

Hello,

For mqtt_entity you should the friendly name as it is defined in the zigebee2mqtt

This can be also a 0x… name when you don`t have a friendly name defined.

Base topic should only be changed when this is changed in your “zigbee2mqtt - home assistant” config and is default zigbee2mqtt so if you don`t have changed that you can leave that for what it is.

The state entity should be the entity which can be used to get/set the current state.

The name you can find by pressing on the icon and you should be able to pick that one out of the select list.

This is used to create a change trigger which i have used to blink the light which i control because i control different light groups on the different modes.

Hope this clarifies it a bit more.

Cheer

2 Likes

Hi @pbergman ,

Thanks for creating this.

I also tried it, but apparently it doesn’t work for me either.

So I am trying to increase the brightness of a bulb and it just works once when I update/save the automation and then it does not.

This is the yaml version of my automation script after using your blueprint.

alias: Test - Zigbee2MQTT - ERS-10TZBVK-AA
description: ""
use_blueprint:
  path: pbergman/ERS-10TZBVK-AA.yaml
  input:
    mqtt_entity: "0x4c5bb3fffe2e8d5a"
    state_entity: select.0x4c5bb3fffe2e8d5a_operation_mode
    event_rotate_right:
      - service: light.turn_on
        target:
          entity_id: light.zigbee_bulb_light
        data:
          brightness_step: 30
          flash: short
    command_toggle:
      - service: light.toggle
        target:
          entity_id: light.zigbee_bulb_light
        data: {}
    command_brightness_step_up: []

The knob is in event mode currently.

Is there something I am doing wrong?

Perhaps it has to do with the action you have defined? I`m new to home assistant but would think when you call “light.turn_on” would also do a state check? Which would be on first call set to true? I have a device defined that decreases the brightness what seems to work.

You can also check your logs to see if the trigger is published.

If it the topic is published you could check the the automation traces to see where it hangs.

@pbergman , Thanks a lot

It worked for me.

I was using the wrong service. I should have used the device option.

I also updated the mode to “restart” so that rotating the knob would be faster to increase and decrease the brightness.

Thanks a lot once again.

Hello,
I have problems because never launch de actions, i see the log and can see that allways launch de automation with event action not the click.

i add this to the yaml:
mode: parallel

and works!!!

Hello everyone. I had a problem. I connect knob via ZigbeeZ2MQTT for the first time and it starts controlling my curtains ZNCLDJ11LM. At the same time, no automation is involved. How can this problem be solved?

see z2m page for this device

leading to