From 41977b676f8efd61708eadb2dd53dca329198b7a Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Thu, 20 May 2021 10:48:06 +0300 Subject: [PATCH] Replace PC light --- .../advanced_dashboard/02_lights.yaml | 6 +-- .../packages/modules/lighting/setup/hue.yaml | 8 +-- .../packages/modules/lighting/setup/mqtt.yaml | 49 ------------------- 3 files changed, 7 insertions(+), 56 deletions(-) diff --git a/config/lovelace/advanced_dashboard/02_lights.yaml b/config/lovelace/advanced_dashboard/02_lights.yaml index 5e368e1..ab4d267 100644 --- a/config/lovelace/advanced_dashboard/02_lights.yaml +++ b/config/lovelace/advanced_dashboard/02_lights.yaml @@ -72,11 +72,11 @@ cards: - fade: switch.light_le_4_fade - wifi: sensor.light_le_4_wifi - type: custom:decluttering-card - template: light_with_fade_and_switch + template: light_with_update_and_lqi variables: - light: light.pc - - fade: switch.pc_fade - - wifi: sensor.pc_wifi + - lqi: sensor.pc_lqi + - update: binary_sensor.pc_update_available - light.living_room_ambient - light.living_room_ambient_main - type: custom:fold-entity-row diff --git a/config/packages/modules/lighting/setup/hue.yaml b/config/packages/modules/lighting/setup/hue.yaml index b96c353..a19254b 100644 --- a/config/packages/modules/lighting/setup/hue.yaml +++ b/config/packages/modules/lighting/setup/hue.yaml @@ -36,7 +36,7 @@ light: brightness_scale: 254 - platform: "mqtt" - name: "hue_white_4" + name: "pc" state_topic: "z2m_deconz/hue_white_4" availability_topic: "z2m_deconz/bridge/state" brightness: true @@ -286,14 +286,14 @@ sensor: value_template: "{{ value_json['update']['state'] }}" - platform: "mqtt" - name: "hue_white_4_lqi" + name: "pc_lqi" state_topic: "z2m_deconz/hue_white_4" availability_topic: "z2m_deconz/bridge/state" value_template: "{{ value_json.linkquality }}" unit_of_measurement: "lqi" icon: "mdi:signal" - platform: "mqtt" - name: "hue_white_4_update_state" + name: "pc_update_state" state_topic: "z2m_deconz/hue_white_4" availability_topic: "z2m_deconz/bridge/state" icon: "mdi:update" @@ -428,7 +428,7 @@ sensor: binary_sensor: - platform: "mqtt" - name: "hue_white_1_update_available" + name: "pc_update_available" state_topic: "z2m_deconz/hue_white_1" availability_topic: "z2m_deconz/bridge/state" payload_on: true diff --git a/config/packages/modules/lighting/setup/mqtt.yaml b/config/packages/modules/lighting/setup/mqtt.yaml index 4ea7ba1..5da05dc 100644 --- a/config/packages/modules/lighting/setup/mqtt.yaml +++ b/config/packages/modules/lighting/setup/mqtt.yaml @@ -108,34 +108,6 @@ light: qos: 1 retain: false - - platform: mqtt - name: "pc" - state_topic: "tele/light_lohas_1/STATE" - state_value_template: "{{ value_json.POWER }}" - command_topic: "cmnd/light_lohas_1/POWER" - payload_on: "ON" - payload_off: "OFF" - availability_topic: "tele/light_lohas_1/LWT" - payload_available: "Online" - payload_not_available: "Offline" - on_command_type: "brightness" - brightness_command_topic: "cmnd/light_lohas_1/Dimmer" - brightness_state_topic: "tele/light_lohas_1/STATE" - brightness_scale: 100 - brightness_value_template: "{{ value_json.Dimmer }}" - hs_command_topic: "cmnd/light_lohas_1/HSBColor" - hs_state_topic: "tele/light_lohas_1/STATE" - hs_value_template: "{{ value_json.HSBColor.split(',')[0:2]|join(',') }}" - color_temp_command_topic: "cmnd/light_lohas_1/CT" - color_temp_state_topic: "tele/light_lohas_1/STATE" - color_temp_value_template: "{{ value_json.CT }}" - rgb_command_topic: "cmnd/light_lohas_1/Color" - rgb_state_topic: "tele/light_lohas_1/STATE" - rgb_command_template: "{{ '%02X%02X%02X=' | format(red, green, blue)}}" - rgb_value_template: "{{ (value_json.Color[0:2]|int(base=16),value_json.Color[2:4]|int(base=16),value_json.Color[4:6]|int(base=16)) | join(',')}}" - qos: 1 - retain: false - - platform: mqtt name: "light_lohas_2" state_topic: "tele/light_lohas_2/STATE" @@ -365,16 +337,6 @@ sensor: unit_of_measurement: "%" value_template: "{{ value_json.Wifi.RSSI }}" - - platform: mqtt - name: "pc_wifi" - availability_topic: "tele/light_lohas_1/LWT" - device_class: signal_strength - payload_available: "Online" - payload_not_available: "Offline" - state_topic: "tele/light_lohas_1/STATE" - unit_of_measurement: "%" - value_template: "{{ value_json.Wifi.RSSI }}" - - platform: mqtt name: "light_lohas_2_wifi" availability_topic: "tele/light_lohas_2/LWT" @@ -491,17 +453,6 @@ switch: state_topic: "stat/light_le_4/RESULT" value_template: "{{ value_json.Fade }}" - - platform: mqtt - name: "pc_fade" - availability_topic: "tele/light_lohas_1/LWT" - command_topic: "cmnd/light_lohas_1/FADE" - icon: mdi:gradient - payload_available: "Online" - payload_not_available: "Offline" - qos: 1 - state_topic: "stat/light_lohas_1/RESULT" - value_template: "{{ value_json.Fade }}" - - platform: mqtt name: "light_lohas_2_fade" availability_topic: "tele/light_lohas_2/LWT"