From e63a8040a87d9f35c915d1e67ff17617b3a700e4 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 19 Nov 2022 17:43:56 +0200 Subject: [PATCH] Switch light groups from zigbee2mqtt to HA --- .../modules/lighting/setup/groups.yaml | 291 ++++++++++-------- .../packages/modules/lighting/setup/mqtt.yaml | 36 +-- 2 files changed, 176 insertions(+), 151 deletions(-) diff --git a/config/packages/modules/lighting/setup/groups.yaml b/config/packages/modules/lighting/setup/groups.yaml index 7a3a1fd..1de6ab8 100644 --- a/config/packages/modules/lighting/setup/groups.yaml +++ b/config/packages/modules/lighting/setup/groups.yaml @@ -1,68 +1,70 @@ -mqtt: - light: - - name: "Hallway main" - state_topic: "z2m_deconz/light_hallway_main" - availability_topic: "z2m_deconz/bridge/state" - brightness: true - color_temp: true - xy: false - hs: false - schema: "json" - command_topic: "z2m_deconz/light_hallway_main/set" - brightness_scale: 254 - max_mireds: 500 - min_mireds: 150 +# mqtt: +# light: + # - name: "Hallway main" + # state_topic: "z2m_deconz/light_hallway_main" + # availability_topic: "z2m_deconz/bridge/state" + # brightness: true + # color_temp: true + # xy: false + # hs: false + # schema: "json" + # command_topic: "z2m_deconz/light_hallway_main/set" + # brightness_scale: 254 + # max_mireds: 500 + # min_mireds: 150 - - name: "Hallway entrance" - state_topic: "z2m_deconz/light_hallway_entrance" - availability_topic: "z2m_deconz/bridge/state" - brightness: true - color_temp: false - xy: false - hs: false - schema: "json" - command_topic: "z2m_deconz/light_hallway_entrance/set" - brightness_scale: 254 + # - name: "Hallway entrance" + # state_topic: "z2m_deconz/light_hallway_entrance" + # availability_topic: "z2m_deconz/bridge/state" + # brightness: true + # color_temp: false + # xy: false + # hs: false + # schema: "json" + # command_topic: "z2m_deconz/light_hallway_entrance/set" + # brightness_scale: 254 - - name: "Kitchen main" - state_topic: "z2m_deconz/light_kitchen_main" - availability_topic: "z2m_deconz/bridge/state" - brightness: true - color_temp: true - xy: false - hs: false - schema: "json" - command_topic: "z2m_deconz/light_kitchen_main/set" - brightness_scale: 254 - max_mireds: 500 - min_mireds: 150 - effect: true - effect_list: - - "blink" - - "breathe" - - "okay" - - "channel_change" - - "finish_effect" + # - name: "Kitchen main" + # state_topic: "z2m_deconz/light_kitchen_main" + # availability_topic: "z2m_deconz/bridge/state" + # brightness: true + # color_temp: true + # xy: false + # hs: false + # schema: "json" + # command_topic: "z2m_deconz/light_kitchen_main/set" + # brightness_scale: 254 + # max_mireds: 500 + # min_mireds: 150 + # effect: true + # effect_list: + # - "blink" + # - "breathe" + # - "okay" + # - "channel_change" + # - "finish_effect" + + # - name: "Kitchen secondary" + # availability_topic: "z2m_deconz/bridge/state" + # brightness: true + # brightness_scale: 254 + # color_mode: true + # command_topic: "z2m_deconz/light_kitchen_secondary/set" + # effect: true + # effect_list: + # - "blink" + # - "breathe" + # - "okay" + # - "channel_change" + # - "finish_effect" + # - "stop_effect" + # json_attributes_topic: "z2m_deconz/light_kitchen_secondary" + # max_mireds: 454 + # min_mireds: 153 + # schema: "json" + # state_topic: "z2m_deconz/light_kitchen_secondary" + # supported_color_modes: ["color_temp"] - - name: "Kitchen secondary" - state_topic: "z2m_deconz/light_kitchen_secondary" - availability_topic: "z2m_deconz/bridge/state" - brightness: true - color_temp: true - xy: false - hs: false - schema: "json" - command_topic: "z2m_deconz/light_kitchen_secondary/set" - brightness_scale: 254 - max_mireds: 500 - min_mireds: 150 - effect: true - effect_list: - - "blink" - - "breathe" - - "okay" - - "channel_change" - - "finish_effect" light: - platform: group @@ -105,12 +107,39 @@ light: - light.master_bedroom_main - light.bedside + - platform: group + name: Kitchen main + entities: + - light.tradfri_1 + - light.hue_ambiance_6 + - light.hue_ambiance_8 + + - platform: group + name: Kitchen secondary + entities: + - light.hue_ambiance_1 + - light.hue_ambiance_2 + - light.hue_ambiance_3 + - light.hue_ambiance_4 + - platform: group name: Kitchen entities: - light.kitchen_main - light.kitchen_secondary + - platform: group + name: Hallway main + entities: + - light.hue_ambiance_5 + - light.hue_1 + + - platform: group + name: Hallway entrance + entities: + - light.hue_white_1 + - light.hue_white_2 + - platform: group name: Hallway entities: @@ -144,78 +173,78 @@ light: - light.hallway - light.tradfri_large -automation: - - alias: Lighting · Sync Kitchen Main states - trigger: - platform: state - entity_id: light.kitchen_main - action: - - delay: "00:00:03" - - service: mqtt.publish - data: - topic: "z2m_deconz/tradfri_1/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_ambiance_8/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_ambiance_6/get" - payload: "" +# automation: +# - alias: Lighting · Sync Kitchen Main states +# trigger: +# platform: state +# entity_id: light.kitchen_main +# action: +# - delay: "00:00:03" +# - service: mqtt.publish +# data: +# topic: "z2m_deconz/tradfri_1/get" +# payload: "" +# - service: mqtt.publish +# data: +# topic: "z2m_deconz/hue_ambiance_8/get" +# payload: "" +# - service: mqtt.publish +# data: +# topic: "z2m_deconz/hue_ambiance_6/get" +# payload: "" - - alias: Lighting · Sync Kitchen Secondary states - trigger: - platform: state - entity_id: light.kitchen_secondary - action: - - delay: "00:00:03" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_ambiance_1/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_ambiance_2/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_ambiance_3/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_ambiance_4/get" - payload: "" + # - alias: Lighting · Sync Kitchen Secondary states + # trigger: + # platform: state + # entity_id: light.kitchen_secondary + # action: + # - delay: "00:00:03" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_ambiance_1/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_ambiance_2/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_ambiance_3/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_ambiance_4/get" + # payload: "" - - alias: Lighting · Sync Hallway Main states - trigger: - platform: state - entity_id: light.hallway_main - action: - - delay: "00:00:03" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_ambiance_5/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_1/get" - payload: "" + # - alias: Lighting · Sync Hallway Main states + # trigger: + # platform: state + # entity_id: light.hallway_main + # action: + # - delay: "00:00:03" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_ambiance_5/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_1/get" + # payload: "" - - alias: Lighting · Sync Hallway Entrance states - trigger: - platform: state - entity_id: light.hallway_main - action: - - delay: "00:00:03" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_white_1/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_white_2/get" - payload: "" + # - alias: Lighting · Sync Hallway Entrance states + # trigger: + # platform: state + # entity_id: light.hallway_main + # action: + # - delay: "00:00:03" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_white_1/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/hue_white_2/get" + # payload: "" homeassistant: diff --git a/config/packages/modules/lighting/setup/mqtt.yaml b/config/packages/modules/lighting/setup/mqtt.yaml index d12df7d..0c4ab27 100644 --- a/config/packages/modules/lighting/setup/mqtt.yaml +++ b/config/packages/modules/lighting/setup/mqtt.yaml @@ -353,10 +353,6 @@ automation: data: topic: "z2m_deconz/hue_white_2/get" payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/hue_white_4/get" - payload: "" - service: mqtt.publish data: topic: "z2m_deconz/hue_white_5/get" @@ -421,19 +417,19 @@ automation: data: topic: "z2m_deconz/tradfri_1/get" payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/light_hallway_main/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/light_hallway_entrance/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/light_kitchen_main/get" - payload: "" - - service: mqtt.publish - data: - topic: "z2m_deconz/light_kitchen_secondary/get" - payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/light_hallway_main/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/light_hallway_entrance/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/light_kitchen_main/get" + # payload: "" + # - service: mqtt.publish + # data: + # topic: "z2m_deconz/light_kitchen_secondary/get" + # payload: ""