Skip to content

Instantly share code, notes, and snippets.

@OddF
Last active July 25, 2022 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OddF/ac960ddd40d83e85cf995b43f7486818 to your computer and use it in GitHub Desktop.
Save OddF/ac960ddd40d83e85cf995b43f7486818 to your computer and use it in GitHub Desktop.
blueprint:
domain: automation
name: Namron 2 channel dimmer switch
description: Namron 4512719 2 channel 4 button dimmer switch
input:
controller_device:
name: namron switch
description: List of devices
selector:
device:
integration: zha
Channel_1_On_Press:
name: Channel 1 on press
default: []
selector:
action: null
Channel_1_Off_Press:
name: Channel 1 off press
default: []
selector:
action: null
Channel_2_On_Press:
name: Channel 2 on press
default: []
selector:
action: null
Channel_2_Off_Press:
name: Channel 2 off press
default: []
selector:
action: null
mode: restart
max_exceeded: silent
trigger:
- platform: event
event_type: zha_event
event_data:
device_id: !input controller_device
condition: "{{ trigger.event.data.device_id == device_id }}"
action:
- delay:
milliseconds: 30
- variables:
command_type: "{{ trigger.event.data.command }}"
channel: "{{ trigger.event.data.endpoint_id }}"
- service: logbook.log
data:
name: trigger.event.data
message: "{{ trigger.event.data }}"
- service: logbook.log
data:
name: Command
message: "{{ command_type }}"
- choose:
- conditions: '{{ command_type == "on" && channel == 1 }}'
sequence: !input "Channel_1_On_Press"
- conditions: '{{ command_type == "off" && channel == 1 }}'
sequence: !input "Channel_1_Off_Press"
- conditions: '{{ command_type == "on" && channel == 2 }}'
sequence: !input "Channel_2_On_Press"
- conditions: '{{ command_type == "off" && channel == 2 }}'
sequence: !input "Channel_2_Off_Press"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment