Add new lights. Rearrange lights

This commit is contained in:
2020-04-17 17:59:08 +03:00
parent 2138d03ea7
commit 9091d6c6b8
10 changed files with 164 additions and 53 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ cards:
cards: cards:
- type: custom:button-card - type: custom:button-card
template: small template: small
entity: light.tuya_kitchen_main_lights entity: light.tuya_kitchen_all_lights
name: Kitchen name: Kitchen
- type: custom:button-card - type: custom:button-card
template: small template: small
@@ -46,8 +46,16 @@ cards:
variables: variables:
- light: light.light_lohas_2 - light: light.light_lohas_2
- fade: switch.light_lohas_2_fade - fade: switch.light_lohas_2_fade
- light.light_le_9 - type: custom:decluttering-card
- light.light_le_10 template: light_with_fade_and_switch
variables:
- light: light.light_lohas_3
- fade: switch.light_lohas_3_fade
- type: custom:decluttering-card
template: light_with_fade_and_switch
variables:
- light: light.light_lohas_4
- fade: switch.light_lohas_4_fade
- type: custom:fold-entity-row - type: custom:fold-entity-row
head: head:
type: custom:decluttering-card type: custom:decluttering-card
@@ -14,7 +14,9 @@ cards:
title: Lights title: Lights
show_header_toggle: false show_header_toggle: false
entities: entities:
- light.tuya_kitchen_all_lights
- light.tuya_kitchen_main_lights - light.tuya_kitchen_main_lights
- light.tuya_kitchen_secondary_lights
- type: divider - type: divider
- type: custom:fold-entity-row - type: custom:fold-entity-row
entity: light.kitchen_main_lights entity: light.kitchen_main_lights
@@ -9,14 +9,12 @@ cards:
icon: mdi:sofa icon: mdi:sofa
show_header_toggle: false show_header_toggle: false
entities: entities:
- light.tuya_living_room_main_lights
- type: divider
- light.living_room_all_lights - light.living_room_all_lights
- light.living_room_main_lights - light.living_room_main_lights
- light.light_lohas_1 - light.light_lohas_1
- light.light_lohas_2 - light.light_lohas_2
- light.light_le_9 - light.light_lohas_3
- light.light_le_10 - light.light_lohas_4
- light.pc - light.pc
- type: entities - type: entities
@@ -37,12 +35,17 @@ cards:
icon: mdi:chef-hat icon: mdi:chef-hat
show_header_toggle: false show_header_toggle: false
entities: entities:
- light.tuya_kitchen_all_lights
- light.tuya_kitchen_main_lights - light.tuya_kitchen_main_lights
- light.tuya_kitchen_secondary_lights
- type: divider - type: divider
- light.kitchen_main_lights - light.kitchen_main_lights
- light.light_le_11 - light.light_le_11
- light.light_le_12 - light.light_le_12
- light.light_orbecco_1 - light.light_orbecco_1
- light.kitchen_secondary_lights
- light.light_le_9
- light.light_le_10
- type: entities - type: entities
title: Hallway title: Hallway
@@ -60,5 +63,3 @@ cards:
- light.light_le_6 - light.light_le_6
- light.light_le_7 - light.light_le_7
- light.light_le_8 - light.light_le_8
+18 -11
View File
@@ -1,17 +1,11 @@
light: light:
# Used only to set correct initial state of tuya_living_room_main_lights
- platform: group
name: Living room tuya lights
entities:
- light.light_le_9
- light.light_le_10
- platform: group - platform: group
name: Living room main lights name: Living room main lights
entities: entities:
- light.light_lohas_1 - light.light_lohas_1
- light.light_lohas_2 - light.light_lohas_2
- light.tuya_living_room_main_lights - light.light_lohas_3
- light.light_lohas_4
- platform: group - platform: group
name: Living room all lights name: Living room all lights
@@ -40,6 +34,18 @@ light:
- light.light_le_12 - light.light_le_12
- light.light_orbecco_1 - light.light_orbecco_1
- platform: group
name: Kitchen secondary lights
entities:
- light.light_le_9
- light.light_le_10
- platform: group
name: Tuya Kitchen all lights
entities:
- light.tuya_kitchen_main_lights
- light.tuya_kitchen_secondary_lights
- platform: group - platform: group
name: Hallway entrance lights name: Hallway entrance lights
entities: entities:
@@ -69,7 +75,7 @@ light:
entities: entities:
- light.living_room_all_lights - light.living_room_all_lights
- light.master_bedroom_main_lights - light.master_bedroom_main_lights
- light.tuya_kitchen_main_lights - light.tuya_kitchen_all_lights
- light.tuya_hallway_all_lights - light.tuya_hallway_all_lights
- platform: group - platform: group
@@ -77,10 +83,9 @@ light:
entities: entities:
- light.living_room_all_lights - light.living_room_all_lights
- light.master_bedroom_all_lights - light.master_bedroom_all_lights
- light.tuya_kitchen_main_lights - light.tuya_kitchen_all_lights
- light.tuya_hallway_all_lights - light.tuya_hallway_all_lights
homeassistant: homeassistant:
customize: customize:
light.living_room_main_lights: light.living_room_main_lights:
@@ -91,6 +96,8 @@ homeassistant:
icon: bha:ceiling-lamp-plafond icon: bha:ceiling-lamp-plafond
light.kitchen_main_lights: light.kitchen_main_lights:
icon: bha:ceiling-lamp-plafond icon: bha:ceiling-lamp-plafond
light.tuya_kitchen_all_lights:
icon: bha:ceiling-lamp-plafond
light.hallway_entrance_lights: light.hallway_entrance_lights:
icon: bha:ceiling-lamp-plafond icon: bha:ceiling-lamp-plafond
light.hallway_main_lights: light.hallway_main_lights:
@@ -164,6 +164,60 @@ light:
qos: 1 qos: 1
retain: false retain: false
- platform: mqtt
name: "light_lohas_3"
availability_topic: "tele/light_lohas_3/LWT"
command_topic: "cmnd/light_lohas_3/POWER"
state_topic: "tele/light_lohas_3/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/light_lohas_3/Dimmer"
brightness_state_topic: "tele/light_lohas_3/STATE"
brightness_scale: 100
on_command_type: "brightness"
brightness_value_template: "{{ value_json.Dimmer }}"
hs_command_topic: "cmnd/light_lohas_3/HSBColor"
hs_state_topic: "tele/light_lohas_3/STATE"
hs_value_template: "{{ value_json.HSBColor.split(',')[0:2]|join(',') }}"
color_temp_command_topic: "cmnd/light_lohas_3/CT"
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_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: false
- platform: mqtt
name: "light_lohas_4"
availability_topic: "tele/light_lohas_4/LWT"
command_topic: "cmnd/light_lohas_4/POWER"
state_topic: "tele/light_lohas_4/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/light_lohas_4/Dimmer"
brightness_state_topic: "tele/light_lohas_4/STATE"
brightness_scale: 100
on_command_type: "brightness"
brightness_value_template: "{{ value_json.Dimmer }}"
hs_command_topic: "cmnd/light_lohas_4/HSBColor"
hs_state_topic: "tele/light_lohas_4/STATE"
hs_value_template: "{{ value_json.HSBColor.split(',')[0:2]|join(',') }}"
color_temp_command_topic: "cmnd/light_lohas_4/CT"
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_value_template: "{{ value_json.Color.split(',')[0:3]|join(',') }}"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: false
sensor: sensor:
- platform: mqtt - platform: mqtt
name: "PC light WiFi" name: "PC light WiFi"
@@ -235,6 +289,26 @@ sensor:
unit_of_measurement: "%" unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}" value_template: "{{ value_json['Wifi'].RSSI }}"
- platform: mqtt
name: "light_lohas_3_wifi"
availability_topic: "tele/light_lohas_3/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/light_lohas_3/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}"
- platform: mqtt
name: "light_lohas_4_wifi"
availability_topic: "tele/light_lohas_4/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/light_lohas_4/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json['Wifi'].RSSI }}"
switch: switch:
- platform: mqtt - platform: mqtt
name: "PC Light Fade" name: "PC Light Fade"
@@ -313,6 +387,28 @@ switch:
state_topic: "stat/light_lohas_2/RESULT" state_topic: "stat/light_lohas_2/RESULT"
value_template: "{{ value_json.Fade }}" value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "light_lohas_3_fade"
availability_topic: "tele/light_lohas_3/LWT"
command_topic: "cmnd/light_lohas_3/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/light_lohas_3/RESULT"
value_template: "{{ value_json.Fade }}"
- platform: mqtt
name: "light_lohas_4_fade"
availability_topic: "tele/light_lohas_4/LWT"
command_topic: "cmnd/light_lohas_4/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/light_lohas_4/RESULT"
value_template: "{{ value_json.Fade }}"
automation: automation:
- alias: Lighting · Sync Tasmota states on start-up - alias: Lighting · Sync Tasmota states on start-up
initial_state: true initial_state: true
+19 -19
View File
@@ -9,27 +9,14 @@
# Light groups in Tuya. Name: "tuya_{{scene_name}}_lights_state" # Light groups in Tuya. Name: "tuya_{{scene_name}}_lights_state"
input_boolean: input_boolean:
tuya_living_room_main_lights_state:
tuya_kitchen_main_lights_state: tuya_kitchen_main_lights_state:
tuya_kitchen_secondary_lights_state:
tuya_hallway_main_lights_state: tuya_hallway_main_lights_state:
tuya_hallway_entrance_lights_state: tuya_hallway_entrance_lights_state:
light: light:
- platform: template - platform: template
lights: lights:
tuya_living_room_main_lights:
friendly_name: Living room main lights (scene)
value_template: "{{ is_state('input_boolean.tuya_living_room_main_lights_state', 'on') }}"
icon_template: bha:ceiling-lamp-plafond
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.tuya_living_room_main_lights_state
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.tuya_living_room_main_lights_state
tuya_kitchen_main_lights: tuya_kitchen_main_lights:
friendly_name: Kitchen main lights (scene) friendly_name: Kitchen main lights (scene)
value_template: "{{ is_state('input_boolean.tuya_kitchen_main_lights_state', 'on') }}" value_template: "{{ is_state('input_boolean.tuya_kitchen_main_lights_state', 'on') }}"
@@ -43,6 +30,19 @@ light:
data: data:
entity_id: input_boolean.tuya_kitchen_main_lights_state entity_id: input_boolean.tuya_kitchen_main_lights_state
tuya_kitchen_secondary_lights:
friendly_name: Kitchen secondary lights (scene)
value_template: "{{ is_state('input_boolean.tuya_kitchen_secondary_lights_state', 'on') }}"
icon_template: bha:ceiling-lamp-plafond
turn_on:
service: input_boolean.turn_on
data:
entity_id: input_boolean.tuya_kitchen_secondary_lights_state
turn_off:
service: input_boolean.turn_off
data:
entity_id: input_boolean.tuya_kitchen_secondary_lights_state
tuya_hallway_main_lights: tuya_hallway_main_lights:
friendly_name: Hallway main lights (scene) friendly_name: Hallway main lights (scene)
value_template: "{{ is_state('input_boolean.tuya_hallway_main_lights_state', 'on') }}" value_template: "{{ is_state('input_boolean.tuya_hallway_main_lights_state', 'on') }}"
@@ -69,15 +69,14 @@ light:
data: data:
entity_id: input_boolean.tuya_hallway_entrance_lights_state entity_id: input_boolean.tuya_hallway_entrance_lights_state
# Try to keep input_booleans consistent. # Try to keep input_booleans consistent.
automation: automation:
- alias: Lighting · Tuya · Update kitchen lights - alias: Lighting · Tuya · Update kitchen lights
trigger: trigger:
platform: state platform: state
entity_id: entity_id:
- input_boolean.tuya_living_room_main_lights_state
- input_boolean.tuya_kitchen_main_lights_state - input_boolean.tuya_kitchen_main_lights_state
- input_boolean.tuya_kitchen_secondary_lights_state
- input_boolean.tuya_hallway_main_lights_state - input_boolean.tuya_hallway_main_lights_state
- input_boolean.tuya_hallway_entrance_lights_state - input_boolean.tuya_hallway_entrance_lights_state
action: action:
@@ -95,14 +94,15 @@ automation:
event: start event: start
action: action:
- delay: 00:00:03 - delay: 00:00:03
- service_template: "input_boolean.turn_{{ states('light.living_room_tuya_lights') }}"
data:
entity_id: input_boolean.tuya_living_room_main_lights_state
- service_template: "input_boolean.turn_{{ states('light.kitchen_main_lights') }}" - service_template: "input_boolean.turn_{{ states('light.kitchen_main_lights') }}"
data: data:
entity_id: input_boolean.tuya_kitchen_main_lights_state entity_id: input_boolean.tuya_kitchen_main_lights_state
- service_template: "input_boolean.turn_{{ states('light.living_room_tuya_lights') }}"
data:
entity_id: input_boolean.tuya_kitchen_secondary_lights_state
- service_template: "input_boolean.turn_{{ states('light.hallway_main_lights') }}" - service_template: "input_boolean.turn_{{ states('light.hallway_main_lights') }}"
data: data:
entity_id: input_boolean.tuya_hallway_main_lights_state entity_id: input_boolean.tuya_hallway_main_lights_state
+1 -1
View File
@@ -69,7 +69,7 @@ automation:
Lights: Lights:
Living room: {{ states('light.living_room_all_lights') }} Living room: {{ states('light.living_room_all_lights') }}
Master bedroom: {{ states('light.master_bedroom_all_lights') }} Master bedroom: {{ states('light.master_bedroom_all_lights') }}
Kitchen: {{ states('light.kitchen_main_lights') }} Kitchen: {{ states('light.kitchen_all_lights') }}
Hallway: {{ states('light.hallway_all_lights') }} Hallway: {{ states('light.hallway_all_lights') }}
- alias: IFTTT · Call service - alias: IFTTT · Call service
+1 -4
View File
@@ -30,10 +30,7 @@ script:
- media_player.nvidia_shield - media_player.nvidia_shield
- media_player.living_room_tv - media_player.living_room_tv
- service: light.turn_off - service: light.turn_off
entity_id: entity_id: light.ceiling_lights
- light.living_room_all_lights
- light.tuya_hallway_all_lights
- light.tuya_kitchen_main_lights
automation: automation:
- alias: Routine · Bedtime · Toggle on bedside switch hold - alias: Routine · Bedtime · Toggle on bedside switch hold
+1 -1
View File
@@ -58,7 +58,7 @@ views:
cards: cards:
- type: custom:button-card - type: custom:button-card
template: small template: small
entity: light.tuya_kitchen_main_lights entity: light.tuya_kitchen_all_lights
name: Kitchen name: Kitchen
- type: custom:button-card - type: custom:button-card
template: small template: small