Moes Smart Knob Lights Control

Thanks, everyone, for contributing & improving on this blueprint to control media player volume & mute for the Moes Tuya (_TZ3000_4fjiwweb) TS004F Smart Knob (rotary dial). This has a high wife-acceptance factor in my home!

1 Like

Any thoughts on adding double press functionality?

It turned out to be the zigbee coordinator firmware was bad. I rolled it back and it started working again.

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.

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