blueprint: name: 'Zigbee2MQTT - Hue Tap Dail Switch' description: | Control lights with a Philips Hue Tap Switch. Use the four buttons to control up to four light(s) with an on/off toggle. The dial can be used to dim the most recently used light. source https://community.home-assistant.io/t/philips-hue-tap-dial-switch-zha/446636/114 domain: automation input: mqtt_topic: name: MQTT Topic description: The mqtt topic that zigbee2mqtt publishes on (zigbee2mqtt/device_id/action) selector: text: remote_button_1_single_press: name: Button 1 Single Press description: The light(s) to control with first button selector: target: entity: domain: light remote_button_2_single_press: name: Button 2 Single Press description: The light(s) to control with second button selector: target: entity: domain: light remote_button_3_single_press: name: Button 3 Single Press description: The light(s) to control with third button selector: target: entity: domain: light remote_button_4_single_press: name: Button 4 Single Press description: The light(s) to control with fourth button selector: target: entity: domain: light current_button: name: (OPTIONAL) Current Light description: Text helper to track the current light to dim. Set for the dimmer controls to change which light they are controlling according to the last one turned on. default: selector: entity: domain: - input_text multiple: false dim_scale: name: Diming Scale description: Scale factor for the dimming. This value will be multiplied by the value given from the dial. So lower number, more gradual dimming. Larger number, faster dimming. default: 1.0 selector: number: min: 0.0 max: 5.0 step: 0.01 mode: slider mode: restart max_exceeded: silent variables: remote_button_1_single_press: !input remote_button_1_single_press remote_button_2_single_press: !input remote_button_2_single_press remote_button_3_single_press: !input remote_button_3_single_press remote_button_4_single_press: !input remote_button_4_single_press current_button: !input current_button dim_scale: !input dim_scale lights: remote_button_1_single_press: !input remote_button_1_single_press remote_button_2_single_press: !input remote_button_2_single_press remote_button_3_single_press: !input remote_button_3_single_press remote_button_4_single_press: !input remote_button_4_single_press trigger: - platform: mqtt topic: !input mqtt_topic action: - variables: action: '{{ trigger.payload }}' - choose: - conditions: '{{ action == ''button_1_press'' }}' sequence: - service: light.turn_on target: !input remote_button_1_single_press data: brightness: 50 - choose: - conditions: '{{ current_button != none }}' sequence: - service: input_text.set_value target: entity_id: !input current_button data: value: remote_button_1_single_press - conditions: '{{ action == ''button_2_press'' }}' sequence: - service: light.turn_on target: !input remote_button_2_single_press data: brightness: 50 - choose: - conditions: '{{ current_button != none }}' sequence: - service: input_text.set_value target: entity_id: !input current_button data: value: remote_button_2_single_press - conditions: '{{ action == ''button_3_press'' }}' sequence: - service: light.turn_on target: !input remote_button_3_single_press data: brightness: 50 - choose: - conditions: '{{ current_button != none }}' sequence: - service: input_text.set_value target: entity_id: !input current_button data: value: remote_button_3_single_press - conditions: '{{ action == ''button_4_press'' }}' sequence: - service: homeassistant.turn_off target: '{{ lights[states(current_button)] }}' - conditions: - '{{ action == ''dial_rotate_left_step'' }}' sequence: - choose: - conditions: '{{ current_button != none }}' sequence: - service: light.turn_on target: '{{ lights[states(current_button)] }}' data: brightness_step_pct: '{{ -dim_scale }}' transition: 1 default: - service: light.turn_on target: !input remote_button_1_single_press data: brightness_step_pct: '{{ -dim_scale }}' transition: 1 - conditions: - '{{ action == ''dial_rotate_right_step'' }}' sequence: - choose: - conditions: '{{ current_button != none }}' sequence: - service: light.turn_on target: '{{ lights[states(current_button)] }}' data: brightness_step_pct: '{{ dim_scale }}' transition: 1 default: - service: light.turn_on target: !input remote_button_1_single_press data: brightness_step_pct: '{{ dim_scale }}' transition: 1 - conditions: - '{{ action == ''dial_rotate_left_slow'' }}' sequence: - choose: - conditions: '{{ current_button != none }}' sequence: - service: light.turn_on target: '{{ lights[states(current_button)] }}' data: brightness_step_pct: '{{ -dim_scale * 2 }}' transition: 1 default: - service: light.turn_on target: !input remote_button_1_single_press data: brightness_step_pct: '{{ -dim_scale * 2 }}' transition: 1 - conditions: - '{{ action == ''dial_rotate_right_slow'' }}' sequence: - choose: - conditions: '{{ current_button != none }}' sequence: - service: light.turn_on target: '{{ lights[states(current_button)] }}' data: brightness_step_pct: '{{ dim_scale * 2 }}' transition: 1 default: - service: light.turn_on target: !input remote_button_1_single_press data: brightness_step_pct: '{{ dim_scale * 2 }}' transition: 1 - conditions: - '{{ action == ''dial_rotate_left_fast'' }}' sequence: - choose: - conditions: '{{ current_button != none }}' sequence: - service: light.turn_on target: '{{ lights[states(current_button)] }}' data: brightness_step_pct: '{{ -dim_scale * 5 }}' transition: 1 default: - service: light.turn_on target: !input remote_button_1_single_press data: brightness_step_pct: '{{ -dim_scale * 5 }}' transition: 1 - conditions: - '{{ action == ''dial_rotate_right_fast'' }}' sequence: - choose: - conditions: '{{ current_button != none }}' sequence: - service: light.turn_on target: '{{ lights[states(current_button)] }}' data: brightness_step_pct: '{{ dim_scale * 5 }}' transition: 1 default: - service: light.turn_on target: !input remote_button_1_single_press data: brightness_step_pct: '{{ dim_scale * 5 }}' transition: 1