Reimplement main Living room lights as MQTT/Tasmota lights

This commit is contained in:
2020-03-16 22:18:21 +02:00
parent 9f08f63c39
commit 7c3933a0ae
4 changed files with 250 additions and 31 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ cards:
name: Temperature
attribute: color_temp
hide_state: true
step: 100
step: 5
- light.living_room_1
- light.living_room_2
- light.living_room_3
+65 -14
View File
@@ -16,29 +16,80 @@ cards:
step: 5
- type: custom:fold-entity-row
head:
type: custom:slider-entity-row
entity: light.living_room_main_lights
name: Main lights
toggle: true
step: 5
entities:
- type: custom:slider-entity-row
entity: light.living_room_main_lights
name: Brightness
hide_state: true
step: 5
- type: custom:slider-entity-row
entity: light.living_room_main_lights
name: Temperature
attribute: color_temp
hide_state: true
min: 0
max: 1000
min: 153
max: 500
step: 5
- type: custom:multiple-entity-row
entity: light.living_room_1
show_state: false
entities:
- entity: switch.living_room_1_light_fade
name: Fade
toggle: true
- entity: light.living_room_1
name: Switch
toggle: true
- type: custom:multiple-entity-row
entity: light.living_room_2
show_state: false
entities:
- entity: switch.living_room_2_light_fade
name: Fade
toggle: true
- entity: light.living_room_2
name: Switch
toggle: true
- type: custom:multiple-entity-row
entity: light.living_room_3
show_state: false
entities:
- entity: switch.living_room_3_light_fade
name: Fade
toggle: true
- entity: light.living_room_3
name: Switch
toggle: true
- type: custom:multiple-entity-row
entity: light.living_room_4
show_state: false
entities:
- entity: switch.living_room_4_light_fade
name: Fade
toggle: true
- entity: light.living_room_4
name: Switch
toggle: true
- type: custom:fold-entity-row
head:
type: custom:multiple-entity-row
entity: light.pc
show_state: false
entities:
- entity: switch.pc_light_fade
name: Fade
toggle: true
- entity: light.pc
name: Switch
toggle: true
entities:
- type: custom:slider-entity-row
entity: light.pc
name: Brightness
hide_state: true
step: 5
- light.living_room_1
- light.living_room_2
- light.living_room_3
- light.living_room_4
- type: custom:slider-entity-row
entity: light.pc
toggle: true
step: 5
- switch.pc_light_fade
- type: "custom:mini-media-player"
artwork: cover
+182 -16
View File
@@ -29,6 +29,90 @@ light:
qos: 1
retain: false
- platform: mqtt
name: "Living room 1"
availability_topic: "tele/living_room_1/LWT"
command_topic: "cmnd/living_room_1/POWER"
state_topic: "tele/living_room_1/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/living_room_1/Dimmer"
brightness_state_topic: "tele/living_room_1/STATE"
brightness_scale: 100
on_command_type: "brightness"
brightness_value_template: "{{ value_json.Dimmer }}"
color_temp_command_topic: "cmnd/living_room_1/CT"
color_temp_state_topic: "tele/living_room_1/STATE"
color_temp_value_template: "{{ value_json.CT }}"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: false
- platform: mqtt
name: "Living room 2"
availability_topic: "tele/living_room_2/LWT"
command_topic: "cmnd/living_room_2/POWER"
state_topic: "tele/living_room_2/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/living_room_2/Dimmer"
brightness_state_topic: "tele/living_room_2/STATE"
brightness_scale: 100
on_command_type: "brightness"
brightness_value_template: "{{ value_json.Dimmer }}"
color_temp_command_topic: "cmnd/living_room_2/CT"
color_temp_state_topic: "tele/living_room_2/STATE"
color_temp_value_template: "{{ value_json.CT }}"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: false
- platform: mqtt
name: "Living room 3"
availability_topic: "tele/living_room_3/LWT"
command_topic: "cmnd/living_room_3/POWER"
state_topic: "tele/living_room_3/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/living_room_3/Dimmer"
brightness_state_topic: "tele/living_room_3/STATE"
brightness_scale: 100
on_command_type: "brightness"
brightness_value_template: "{{ value_json.Dimmer }}"
color_temp_command_topic: "cmnd/living_room_3/CT"
color_temp_state_topic: "tele/living_room_3/STATE"
color_temp_value_template: "{{ value_json.CT }}"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: false
- platform: mqtt
name: "Living room 4"
availability_topic: "tele/living_room_4/LWT"
command_topic: "cmnd/living_room_4/POWER"
state_topic: "tele/living_room_4/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/living_room_4/Dimmer"
brightness_state_topic: "tele/living_room_4/STATE"
brightness_scale: 100
on_command_type: "brightness"
brightness_value_template: "{{ value_json.Dimmer }}"
color_temp_command_topic: "cmnd/living_room_4/CT"
color_temp_state_topic: "tele/living_room_4/STATE"
color_temp_value_template: "{{ value_json.CT }}"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: false
- platform: group
name: Living room main lights
entities:
@@ -51,7 +135,7 @@ light:
sensor:
- platform: mqtt
name: "PC Light WiFi"
name: "PC light WiFi"
availability_topic: "tele/pc_light/LWT"
device_class: signal_strength
payload_available: "Online"
@@ -60,6 +144,46 @@ sensor:
unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}"
- platform: mqtt
name: "Living room 1 light WiFi"
availability_topic: "tele/living_room_1/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/living_room_1/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}"
- platform: mqtt
name: "Living room 2 light WiFi"
availability_topic: "tele/living_room_2/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/living_room_2/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}"
- platform: mqtt
name: "Living room 3 light WiFi"
availability_topic: "tele/living_room_3/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/living_room_3/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}"
- platform: mqtt
name: "Living room 4 light WiFi"
availability_topic: "tele/living_room_4/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/living_room_4/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}"
switch:
- platform: mqtt
name: "PC Light Fade"
@@ -72,6 +196,50 @@ switch:
state_topic: "stat/pc_light/RESULT"
value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "Living room 1 light Fade"
availability_topic: "tele/living_room_1/LWT"
command_topic: "cmnd/living_room_1/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/living_room_1/RESULT"
value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "Living room 2 light Fade"
availability_topic: "tele/living_room_2/LWT"
command_topic: "cmnd/living_room_2/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/living_room_2/RESULT"
value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "Living room 3 light Fade"
availability_topic: "tele/living_room_3/LWT"
command_topic: "cmnd/living_room_3/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/living_room_3/RESULT"
value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "Living room 4 light Fade"
availability_topic: "tele/living_room_4/LWT"
command_topic: "cmnd/living_room_4/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/living_room_4/RESULT"
value_template: "{{ value_json.Fade }}"
automation:
- id: lighting_turn_on_after_sunset
alias: Lighting · Turn on all lights after sunset
@@ -146,19 +314,17 @@ automation:
action:
- service: mqtt.publish
data:
topic: "cmnd/tasmotas/STATE"
topic: "cmnd/pc_light/STATE"
payload: ""
- service: mqtt.publish
data:
topic: "cmnd/living_room_2/STATE"
payload: ""
- service: mqtt.publish
data:
topic: "cmnd/living_room_3/STATE"
payload: ""
- service: mqtt.publish
data:
topic: "cmnd/living_room_4/STATE"
payload: ""
homeassistant:
customize:
light.living_room_1:
friendly_name: Living room 1
light.living_room_2:
friendly_name: Living room 2
light.living_room_3:
friendly_name: Living room 3
light.living_room_4:
friendly_name: Living room 4
+2
View File
@@ -43,6 +43,8 @@ resources:
url: /hacsfiles/text-element/text-element.js
- type: module
url: /hacsfiles/lovelace-battery-entity/battery-entity.js
- type: module
url: /hacsfiles/lovelace-multiple-entity-row/multiple-entity-row.js
title: Sarah
views: