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!
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.
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
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
I removed the manufacturer lock too, as I found out it works perfectly with the more generic āTuya Mini Smart Knobā
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.
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.
Works like a charm. Any chanse to add turning left limit? So light doesnt turn off by turning knob left?