diff --git a/namron-4-channel-switch-2.yaml b/namron-4-channel-switch-2.yaml new file mode 100644 index 0000000..c0fe885 --- /dev/null +++ b/namron-4-channel-switch-2.yaml @@ -0,0 +1,288 @@ +blueprint: + name: Namron 4 channel switch, 2 button + domain: automation + description: Namron 4 button switch in two button mode + input: + target_left: + selector: + target: + entities: + domain: light + target_right: + selector: + target: + entities: + domain: light + + light_switch_id: + name: Light Switch + selector: + device: + filter: + - integration: zha + model: 4512772 + +triggers: + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_1 + trigger: device + id: chan_1_on + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_2 + trigger: device + id: chan_1_off + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_1 + trigger: device + id: chan_1_dim_up + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_1 + trigger: device + id: chan_1_dim_up_stop + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_2 + trigger: device + id: chan_1_dim_down + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_2 + trigger: device + id: chan_1_dim_down_stop + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_3 + trigger: device + id: chan_2_on + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_4 + trigger: device + id: chan_2_off + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_3 + trigger: device + id: chan_2_dim_up + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_3 + trigger: device + id: chan_2_dim_up_stop + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_4 + trigger: device + id: chan_2_dim_down + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_4 + trigger: device + id: chan_2_dim_down_stop + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_5 + trigger: device + id: chan_3_on + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_6 + trigger: device + id: chan_3_off + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_5 + trigger: device + id: chan_3_dim_up + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_5 + trigger: device + id: chan_3_dim_up_stop + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_6 + trigger: device + id: chan_3_dim_down + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_6 + trigger: device + id: chan_3_dim_down_stop + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_7 + trigger: device + id: chan_4_on + - device_id: !input light_switch_id + domain: zha + type: remote_button_short_press + subtype: button_8 + trigger: device + id: chan_4_off + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_7 + trigger: device + id: chan_4_up + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_7 + trigger: device + id: chan_4_up_stop + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_press + subtype: button_8 + trigger: device + id: chan_4_dim_down + - device_id: !input light_switch_id + domain: zha + type: remote_button_long_release + subtype: button_8 + trigger: device + id: chan_4_dim_down_stop +conditions: [] +actions: + - choose: + - conditions: + - condition: trigger + id: + - chan_3_on + - chan_4_on + sequence: + - action: light.turn_on + metadata: {} + data: {} + target: !input target_left + - conditions: + - condition: trigger + id: + - chan_3_off + - chan_4_off + sequence: + - action: light.turn_off + metadata: {} + data: {} + target: !input target_left + - conditions: + - condition: trigger + id: + - chan_3_dim_up + - chan_4_dim_up + sequence: + - repeat: + sequence: + - action: light.turn_on + metadata: {} + data: + brightness_step_pct: 3 + transition: 1 + target: !input target_left + until: + - condition: trigger + id: + - chan_3_dim_up_stop + - chan_4_dim_up_stop + - conditions: + - condition: trigger + id: + - chan_3_dim_down + - chan_4_dim_down + sequence: + - repeat: + sequence: + - action: light.turn_on + metadata: {} + data: + brightness_step_pct: -3 + transition: 1 + target: !input target_left + until: + - condition: trigger + id: + - chan_3_dim_down_stop + - chan_4_dim_down_stop + - conditions: + - condition: trigger + id: + - chan_1_on + - chan_2_on + sequence: + - action: light.turn_on + metadata: {} + data: {} + target: !input target_right + - conditions: + - condition: trigger + id: + - chan_1_off + - chan_2_off + sequence: + - action: light.turn_off + metadata: {} + data: {} + target: !input target_right + - conditions: + - condition: trigger + id: + - right_dim_up + sequence: + - repeat: + sequence: + - action: light.turn_on + metadata: {} + data: + transition: 1 + brightness_step_pct: 3 + target: !input target_right + until: + - condition: trigger + id: + - chan_1_dim_up_stop + - chan_2_dim_up_stop + - conditions: + - condition: trigger + id: + - chan_1_dim_down + - chan_2_dim_down + sequence: + - repeat: + sequence: + - action: light.turn_on + metadata: {} + data: + brightness_step_pct: -3 + transition: 1 + target: !input target_right + until: + - condition: trigger + id: + - chan_1_dim_down_stop + - chan_2_dim_down_stop +mode: restart