Moes Smart Knob Lights Control

I just picked up a couple of these today saw this thread. I’m using zigbee2mqtt and wanted the color temperature to work as well so I created this blueprint. It works in command mode and will set brightness (just turn the dial) and color temperature (press and turn the dial) as long as the light has max_mired and min_mired like the tplink bulbs I have do. It requires the mqtt topic to get the data from and uses the action_step_size to match the speed of the dial to how fast to change the brightness or color temp. Single press will toggle on and off.

blueprint:
  name: Moes Dial Automation
  description: Control brightness and color temperature with a Moes dial button
  domain: automation
  input:
    target_light:
      name: Lights
      description: The light(s) with Mireds
      selector:
        entity:
          filter:
            - domain: light
    mqtt_topic:
      name: Device specific MQTT topic
      description: Topic that the Moes dial publishes to
    step_value:
      name: Step Value
      description: Used for configuring percentage of each step for brightness and color temperature
      default: 5
      selector:
        number:
          min: 1
          max: 100

trigger:
  - platform: mqtt
    topic: !input mqtt_topic
action:
  - variables:
      command: "{{ trigger.payload_json.action }}"
      size: "{{ trigger.payload_json.action_step_size }}"
      target_light: !input target_light
      light_temp: "{{ state_attr(target_light, 'color_temp') }}"
      brigtness_step: 13
      temperature_step: 18
      pct_change: !input step_value
      temp_pct_change: >-
        {{ ((state_attr(target_light, 'max_mireds') -
        state_attr(target_light, 'min_mireds')) /100 ) * pct_change }}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ trigger.payload_json.action == 'toggle' }}"
        sequence:
          - service: light.toggle
            entity_id: !input target_light
      - conditions:
          - condition: template
            value_template: "{{ command == 'brightness_step_up' }}"
        sequence:
          - service: light.turn_on
            data:
              brightness_step_pct: "{{ pct_change * (size / brigtness_step) }}"
            target:
              entity_id: !input target_light
      - conditions:
          - condition: template
            value_template: "{{ command == 'brightness_step_down'  }}"
        sequence:
          - service: light.turn_on
            data:
              brightness_step_pct: "{{ -pct_change * (size / brigtness_step) }}"
            target:
              entity_id: !input target_light
      - conditions:
          - condition: template
            value_template: "{{ command == 'color_temperature_step_down'  }}"
        sequence:
          - service: light.turn_on
            metadata: {}
            data:
              color_temp: >-
                {{ light_temp + (-temp_pct_change * (size / temperature_step)) |
                int }}
            target:
              entity_id: !input target_light
      - conditions:
          - condition: template
            value_template: "{{ command == 'color_temperature_step_up' }} "
        sequence:
          - service: light.turn_on
            metadata: {}
            data:
              color_temp: >-
                {{ light_temp + (temp_pct_change * (size / temperature_step)) |
                int }}
            target:
              entity_id: !input target_light
mode: single
max_exceeded: silent

Thanks! I got stuck a little with this one as it didn’t respond very well to my actions and all was really slow. (Maybe because by default it doesn’t have “mode: restart”?). It sucked and was quite dissappointed with it. :stuck_out_tongue:

But with this good blueprints, it’s quite OK. Thanks again.

I made a copy without the manufacturer lock, because I have “_TZ3000_qja6nq5z” there.

ZHA - Moes Smart Knob for lights (without manufacturer lock) (github.com)

Hello all !

I just discovered this device, and setting in up with your blueprint made it very easy to control things. Thanks to all of you !

At this time, I wondered if it’s possible to control devices instead of lights, that’s why I got my hands dirty and made a version inspired by the improved version of gonzaloalbito !

It’s my first blueprint so it’s possible that there are a few things that could be changed :slight_smile:

And here is another version where step_size is used and mode is queued, so you it doesn’t matter how fast you rotate. It feels much smoother than the original.

I also removed al redundant conditions and manufacturer, since my device was different)

  • press toggles the light
  • rotate changes brightness
  • press-rotate changes the color temperature (or hue, see next point)
  • long press switches the lamp between rgb and color temperature
  • tripple click switches the device into a separate mode where double click and long click are available. This blueprint just writes to the console but you can adapt as necessary

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

1 Like

I removed the manufacturer lock too, as I found out it works perfectly with the more generic “Tuya Mini Smart Knob”
image

2 Likes

It works fine, thank you

I tried this version as well, but it is throwing an error.

Would someone be so kind and make a z2m version of that?
The blueprint has everything I am looking for.

2 Likes

image

1 Like

I’ve just bought one of these, and I’ve used mateine’s blueprint as it looks like the latest on here.
Works fine for on / off and dimming, but I can’t get it to change the colour temperature.
Mine is a TS004F
by _TZ3000_qja6nq5z
It’s supposedly a “Moes” device, but it’s from AliExpress, so could easily be rebranded.
I can see there is an quirk loaded for it: Quirk: zhaquirks.tuya.ts004f.TuyaSmartRemote004FROK

I’ve not had to troubleshoot zigbee issues yet, and I don’t really understand the code in the blueprint for changing colour.

Any suggestions most welcome!

did you ever get it working with z2m?

I have not yet tried it.

:pray: Thank you @mateine - works like a charme! :slight_smile:

1 Like

Works like a charm. Any chanse to add turning left limit? So light doesnt turn off by turning knob left?

@mateine
which quirk are you using?
it seems it changed “magically” for me, and the events are different than some weeks ago …

I didn’t change anything beyond the blueprint, but I haven’t updated home assistant for a while either

Here’s a Zigbee2MQTT (Z2M) version. I haven’t tried it yet though.

Hi,

I have a Moes smart knob (the black and grey one), and the ZHA event doesn’t have the parameters you use in your blueprint, which seems necessarry to implement double and long press actions.
I only get:

event:
    event_type: zha_event
    data:
      endpoint_id: 1
      cluster_id: 6
      command: toggle
      args: []
      params: {}

How did you get press_type and the other parameters ? Is it because you use a different knob ? Or did I miss something ?

Thanks for the help !

Developer Tools => Listen to events ‘zha_event’

Triple click the knob - it changes between two modes on the device. In the other mode it shows all the correct parameters.