Switch lights - lohas_5 (RIP) with hama_1

This commit is contained in:
2020-06-02 18:45:55 +03:00
parent 75dbe6799b
commit 31c30aeb1a
4 changed files with 77 additions and 79 deletions
@@ -210,9 +210,9 @@ cards:
- type: custom:decluttering-card
template: light_with_fade_and_switch
variables:
- light: light.light_lohas_5
- fade: switch.light_lohas_5_fade
- wifi: sensor.light_lohas_5_wifi
- light: light.light_hama_1
- fade: switch.light_hama_1_fade
- wifi: sensor.light_hama_1_wifi
- type: custom:decluttering-card
template: light_with_fade_and_switch
variables:
@@ -64,7 +64,8 @@ light:
- platform: group
name: Hallway entrance
entities:
- light.light_lohas_5
# - light.light_lohas_5
- light.light_hama_1
- light.light_lohas_6
- platform: group
@@ -174,7 +175,9 @@ homeassistant:
light.hallway_entrance:
icon: bha:ceiling-lamp-plafond
light.light_lohas_5:
# light.light_lohas_5:
# friendly_name: Entrance 1
light.light_hama_1:
friendly_name: Entrance 1
light.light_lohas_6:
friendly_name: Entrance 2
@@ -1,27 +1,27 @@
light:
- platform: mqtt
name: "PC" # should be hama_1.
state_topic: "tele/pc_light/STATE"
name: "light_hama_1"
state_topic: "tele/light_hama_1/STATE"
state_value_template: "{{ value_json.POWER }}"
command_topic: "cmnd/pc_light/POWER"
command_topic: "cmnd/light_hama_1/POWER"
payload_on: "ON"
payload_off: "OFF"
availability_topic: "tele/pc_light/LWT"
availability_topic: "tele/light_hama_1/LWT"
payload_available: "Online"
payload_not_available: "Offline"
on_command_type: "brightness"
brightness_command_topic: "cmnd/pc_light/Dimmer"
brightness_state_topic: "tele/pc_light/STATE"
brightness_command_topic: "cmnd/light_hama_1/Dimmer"
brightness_state_topic: "tele/light_hama_1/STATE"
brightness_scale: 100
brightness_value_template: "{{ value_json.Dimmer }}"
hs_command_topic: "cmnd/pc_light/HSBColor"
hs_state_topic: "tele/pc_light/STATE"
hs_command_topic: "cmnd/light_hama_1/HSBColor"
hs_state_topic: "tele/light_hama_1/STATE"
hs_value_template: "{{ value_json.HSBColor.split(',')[0:2]|join(',') }}"
color_temp_command_topic: "cmnd/pc_light/CT"
color_temp_state_topic: "tele/pc_light/STATE"
color_temp_command_topic: "cmnd/light_hama_1/CT"
color_temp_state_topic: "tele/light_hama_1/STATE"
color_temp_value_template: "{{ value_json.CT }}"
rgb_command_topic: "cmnd/pc_light/Color"
rgb_state_topic: "tele/pc_light/STATE"
rgb_command_topic: "cmnd/light_hama_1/Color"
rgb_state_topic: "tele/light_hama_1/STATE"
rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
qos: 1
retain: false
@@ -132,7 +132,7 @@ light:
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/pc_light/STATE"
rgb_state_topic: "tele/light_hama_1/STATE"
rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
qos: 1
retain: false
@@ -159,7 +159,7 @@ light:
color_temp_state_topic: "tele/light_lohas_2/STATE"
color_temp_value_template: "{{ value_json.CT }}"
rgb_command_topic: "cmnd/light_lohas_2/Color"
rgb_state_topic: "tele/pc_light/STATE"
rgb_state_topic: "tele/light_hama_1/STATE"
rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
qos: 1
retain: false
@@ -186,7 +186,7 @@ light:
color_temp_state_topic: "tele/light_lohas_3/STATE"
color_temp_value_template: "{{ value_json.CT }}"
rgb_command_topic: "cmnd/light_lohas_3/Color"
rgb_state_topic: "tele/pc_light/STATE"
rgb_state_topic: "tele/light_hama_1/STATE"
rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
qos: 1
retain: false
@@ -213,37 +213,37 @@ light:
color_temp_state_topic: "tele/light_lohas_4/STATE"
color_temp_value_template: "{{ value_json.CT }}"
rgb_command_topic: "cmnd/light_lohas_4/Color"
rgb_state_topic: "tele/pc_light/STATE"
rgb_state_topic: "tele/light_hama_1/STATE"
rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
qos: 1
retain: false
- platform: mqtt
name: "light_lohas_5"
state_topic: "tele/light_lohas_5/STATE"
state_value_template: "{{ value_json.POWER }}"
command_topic: "cmnd/light_lohas_5/POWER"
payload_on: "ON"
payload_off: "OFF"
availability_topic: "tele/light_lohas_5/LWT"
payload_available: "Online"
payload_not_available: "Offline"
on_command_type: "brightness"
brightness_command_topic: "cmnd/light_lohas_5/Dimmer"
brightness_state_topic: "tele/light_lohas_5/STATE"
brightness_scale: 100
brightness_value_template: "{{ value_json.Dimmer }}"
hs_command_topic: "cmnd/light_lohas_5/HSBColor"
hs_state_topic: "tele/light_lohas_5/STATE"
hs_value_template: "{{ value_json.HSBColor.split(',')[0:2]|join(',') }}"
color_temp_command_topic: "cmnd/light_lohas_5/CT"
color_temp_state_topic: "tele/light_lohas_5/STATE"
color_temp_value_template: "{{ value_json.CT }}"
rgb_command_topic: "cmnd/light_lohas_5/Color"
rgb_state_topic: "tele/pc_light/STATE"
rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
qos: 1
retain: false
# - platform: mqtt
# name: "light_lohas_5"
# state_topic: "tele/light_lohas_5/STATE"
# state_value_template: "{{ value_json.POWER }}"
# command_topic: "cmnd/light_lohas_5/POWER"
# payload_on: "ON"
# payload_off: "OFF"
# availability_topic: "tele/light_lohas_5/LWT"
# payload_available: "Online"
# payload_not_available: "Offline"
# on_command_type: "brightness"
# brightness_command_topic: "cmnd/light_lohas_5/Dimmer"
# brightness_state_topic: "tele/light_lohas_5/STATE"
# brightness_scale: 100
# brightness_value_template: "{{ value_json.Dimmer }}"
# hs_command_topic: "cmnd/light_lohas_5/HSBColor"
# hs_state_topic: "tele/light_lohas_5/STATE"
# hs_value_template: "{{ value_json.HSBColor.split(',')[0:2]|join(',') }}"
# color_temp_command_topic: "cmnd/light_lohas_5/CT"
# color_temp_state_topic: "tele/light_lohas_5/STATE"
# color_temp_value_template: "{{ value_json.CT }}"
# rgb_command_topic: "cmnd/light_lohas_5/Color"
# rgb_state_topic: "tele/light_hama_1/STATE"
# rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
# qos: 1
# retain: false
- platform: mqtt
name: "light_lohas_6"
@@ -267,7 +267,7 @@ light:
color_temp_state_topic: "tele/light_lohas_6/STATE"
color_temp_value_template: "{{ value_json.CT }}"
rgb_command_topic: "cmnd/light_lohas_6/Color"
rgb_state_topic: "tele/pc_light/STATE"
rgb_state_topic: "tele/light_hama_1/STATE"
rgb_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
qos: 1
retain: false
@@ -324,12 +324,12 @@ light:
sensor:
- platform: mqtt
name: "PC light WiFi"
availability_topic: "tele/pc_light/LWT"
name: "light_hama_1_wifi"
availability_topic: "tele/light_hama_1/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/pc_light/STATE"
state_topic: "tele/light_hama_1/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json.Wifi.RSSI }}"
@@ -413,15 +413,15 @@ sensor:
unit_of_measurement: "%"
value_template: "{{ value_json.Wifi.RSSI }}"
- platform: mqtt
name: "light_lohas_5_wifi"
availability_topic: "tele/light_lohas_5/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/light_lohas_5/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json.Wifi.RSSI }}"
# - platform: mqtt
# name: "light_lohas_5_wifi"
# availability_topic: "tele/light_lohas_5/LWT"
# device_class: signal_strength
# payload_available: "Online"
# payload_not_available: "Offline"
# state_topic: "tele/light_lohas_5/STATE"
# unit_of_measurement: "%"
# value_template: "{{ value_json.Wifi.RSSI }}"
- platform: mqtt
name: "light_lohas_6_wifi"
@@ -455,14 +455,14 @@ sensor:
switch:
- platform: mqtt
name: "PC Light Fade"
availability_topic: "tele/pc_light/LWT"
command_topic: "cmnd/pc_light/FADE"
name: "light_hama_1_fade"
availability_topic: "tele/light_hama_1/LWT"
command_topic: "cmnd/light_hama_1/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/pc_light/RESULT"
state_topic: "stat/light_hama_1/RESULT"
value_template: "{{ value_json.Fade }}"
- platform: mqtt
@@ -553,16 +553,16 @@ switch:
state_topic: "stat/light_lohas_4/RESULT"
value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "light_lohas_5_fade"
availability_topic: "tele/light_lohas_5/LWT"
command_topic: "cmnd/light_lohas_5/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/light_lohas_5/RESULT"
value_template: "{{ value_json.Fade }}"
# - platform: mqtt
# name: "light_lohas_5_fade"
# availability_topic: "tele/light_lohas_5/LWT"
# command_topic: "cmnd/light_lohas_5/FADE"
# icon: mdi:gradient
# payload_available: "Online"
# payload_not_available: "Offline"
# qos: 1
# state_topic: "stat/light_lohas_5/RESULT"
# value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "light_lohas_6_fade"
@@ -19,8 +19,6 @@ automation:
- light.light_lohas_2
- light.light_lohas_3
- light.light_lohas_4
- light.light_lohas_5
- light.light_lohas_6
- light.light_le_1
- light.light_le_2
- light.light_le_3
@@ -46,9 +44,6 @@ automation:
- service: script.lighting_temperature_adjust
data:
entity_id: light.living_room_main
- service: script.lighting_temperature_adjust
data:
entity_id: light.hallway_entrance
- service: logbook.log
data_template:
name: "💡 Lighting Module · "