blueprint:
name: Tuya ZG-101Z/D ZHA Events
description: Automate Tuya Smart Knob using ZHA events.
domain: automation
input:
smart_knob:
name: Smart Knob Device
description: Select your Tuya Smart Knob
selector:
device:
integration: zha
manufacturer: _TZ3000_gwkzibhs
model: TS004F
multiple: false
action_rotate_right:
name: Rotate Right
default: []
selector:
action: {}
action_rotate_left:
name: Rotate Left
default: []
selector:
action: {}
action_single_press:
name: Single Press
default: []
selector:
action: {}
action_double_press:
name: Double Press
default: []
selector:
action: {}
action_long_press:
name: Long Press
default: []
selector:
action: {}
mode: restart
max_exceeded: silent
trigger:
Captura qualquer evento ZHA vindo do Knob
- platform: event
event_type: zha_event
event_data:
device_id: !input smart_knob
action:
-
choose:
— ROTATE RIGHT —
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.command == ‘rotate_type’ and trigger.event.data.args[0] == 0 }}
sequence: !input action_rotate_right
- condition: template
— ROTATE LEFT —
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.command == ‘rotate_type’ and trigger.event.data.args[0] == 1 }}
sequence: !input action_rotate_left
- condition: template
— SINGLE PRESS —
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.command == ‘press_type’ and trigger.event.data.args[0] == 0 }}
sequence: !input action_single_press
- condition: template
— DOUBLE PRESS —
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.command == ‘press_type’ and trigger.event.data.args[0] == 1 }}
sequence: !input action_double_press
- condition: template
— LONG PRESS —
- conditions:
- condition: template
value_template: >-
{{ trigger.event.data.command == ‘press_type’ and trigger.event.data.args[0] == 2 }}
sequence: !input action_long_press
- condition: template
- conditions: