From 613a02f260ff4d3d8ec1c3248f121c041e401897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dav=C3=AD=C3=B0=20Steinn=20Geirsson?= Date: Fri, 5 Sep 2025 23:44:38 +0000 Subject: [PATCH] Hue dimmer config --- hue_dimmer_zigbee2mqtt.yaml | 115 ++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 hue_dimmer_zigbee2mqtt.yaml diff --git a/hue_dimmer_zigbee2mqtt.yaml b/hue_dimmer_zigbee2mqtt.yaml new file mode 100644 index 0000000..c1c26a7 --- /dev/null +++ b/hue_dimmer_zigbee2mqtt.yaml @@ -0,0 +1,115 @@ +blueprint: + name: Philips Hue 929002398602 + Zigbee2MQTT + Light + description: | + # Requirements: + - Philips Hue Dimmer Switch 929002398602 + - Zigbee2MQTT + - MQTT + + domain: automation + input: + Remote_MQTT_Topic: + name: Remote MQTT Topic + description: Philips Hue Dimmer Switch (e.g., zigbee2mqtt/remote_1/action) + default: "zigbee2mqtt//action" + Target_MQTT_Topic: + name: Target MQTT Topic + description: Target light (e.g., zigbee2mqtt/light_1/set) + default: "zigbee2mqtt//set" + + move_rate: + name: Brightness Move Rate [steps/s] + description: The rate at which brightness should change on up/down press. + default: 50 + selector: + number: + min: 1 + max: 255 + step: 1 + mode: slider + color_temp: + name: Color Temperature (optional) + description: The color temperature to set when turning on the light (in mireds). Leave empty to not set color temperature. + default: 370 + selector: + text: + color: + name: Color (optional) + description: The color to set when turning on the light (RGB, e.g. [255,0,0] for red). Leave empty to not set color. + default: '' + selector: + text: + +variables: + move_rate: !input move_rate + color_temp: !input color_temp + color: !input color + remote_topic: !input Remote_MQTT_Topic + target_topic: !input Target_MQTT_Topic + +mode: restart + +trigger: + - platform: mqtt + topic: !input Remote_MQTT_Topic # Needs to be set static + id: mqtt_action + +condition: [] + +action: + - choose: + - conditions: + - condition: template + value_template: "{{ trigger.payload == 'on_press' }}" + sequence: + - service: mqtt.publish + data: + topic: "{{ target_topic }}" + payload: > + {"state":"ON", "brightness": 100{% if color_temp != '' %}, "color_temp":{{ color_temp }}{% endif %}{% if color|length > 0 %}, "color": {"rgb": {{ color }} }{% endif %}} + qos: 0 + retain: false + - conditions: + - condition: template + value_template: "{{ trigger.payload == 'off_press' }}" + sequence: + - service: mqtt.publish + data: + topic: "{{ target_topic }}" + payload: '{"state":"OFF"}' + qos: 0 + retain: false + - conditions: + - condition: template + value_template: "{{ trigger.payload == 'up_press' }}" + sequence: + - service: mqtt.publish + data: + topic: "{{ target_topic }}" + payload: '{"brightness_move": {{ move_rate }}}' + qos: 0 + retain: false + - conditions: + - condition: template + value_template: "{{ trigger.payload == 'down_press' }}" + sequence: + - service: mqtt.publish + data: + topic: "{{ target_topic }}" + payload: '{"brightness_move": {{ -move_rate }}}' + qos: 0 + retain: false + - conditions: + - condition: template + value_template: > + {{ trigger.payload in ['up_press_release', 'down_press_release', + 'up_hold_release', 'down_hold_release'] }} + sequence: + - service: mqtt.publish + data: + topic: "{{ target_topic }}" + payload: '{"brightness_move": 0}' + qos: 0 + retain: false + default: [] +