Skip to content

Instantly share code, notes, and snippets.

@korotin
Forked from SpeedyGoneZales/tuya_rotary_switch.yaml
Last active March 14, 2025 22:58
Show Gist options
  • Save korotin/10494d814ad7d2dd7cc0c27d008f2d1a to your computer and use it in GitHub Desktop.
Save korotin/10494d814ad7d2dd7cc0c27d008f2d1a to your computer and use it in GitHub Desktop.
ZHA Tuya Rotary Switch _TZ3000_402vrq2i (TS004F)
blueprint:
name: Tuya Rotary Switch
description: Automate your Tuya rotary switch using ZHA events.
domain: automation
input:
tuya_rotary_dimmer_switch:
name: Tuya Rotary Dimmer Switch
description: Tuya Rotary Dimmer Switch
selector:
device:
integration: zha
manufacturer: _TZ3000_402vrq2i
model: TS004F
button_press:
name: Toggle
description: Push button
default: []
selector:
action: {}
rotate_right:
name: Dim up
description: Rotate right
default: []
selector:
action: {}
rotate_left:
name: Dim down
description: Rotate left
default: []
selector:
action: {}
mode: queued
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input 'tuya_rotary_dimmer_switch'
action:
- variables:
command: '{{ trigger.event.data.command }}'
- choose:
- conditions: '{{ command == ''remote_button_short_press'' }}'
sequence: !input 'button_press'
- conditions: '{{ command == ''right'' }}'
sequence: !input 'rotate_right'
- conditions: '{{ command == ''left'' }}'
sequence: !input 'rotate_left'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment