More lights!

This commit is contained in:
2020-04-25 12:27:15 +03:00
parent ef37014d1a
commit e6ca9150e1
14 changed files with 220 additions and 81 deletions
+5 -5
View File
@@ -8,8 +8,8 @@ alexa:
- light.master_bedroom_main_lights
- light.bedside_light
- light.tuya_kitchen_all_lights
- light.tuya_hallway_entrance_lights
- light.tuya_hallway_all_lights
- light.hallway_entrance_lights
- light.hallway_all_lights
- light.tuya_hallway_main_lights
- switch.camera
@@ -51,10 +51,10 @@ alexa:
name: "Bedroom"
light.tuya_kitchen_all_lights:
name: "Kitchen"
light.tuya_hallway_entrance_lights:
name: "Entrance"
light.tuya_hallway_all_lights:
light.hallway_all_lights:
name: "Hallway"
light.hallway_entrance_lights:
name: "Entrance"
light.tuya_hallway_main_lights:
name: "Hallway main"
media_player.master_bedroom:
+8 -12
View File
@@ -38,6 +38,8 @@ light:
- platform: group
name: Kitchen secondary lights
entities:
- light.light_le_5
- light.light_le_6
- light.light_le_9
- light.light_le_10
@@ -50,8 +52,8 @@ light:
- platform: group
name: Hallway entrance lights
entities:
- light.light_le_5
- light.light_le_6
- light.light_lohas_5
- light.light_lohas_6
- platform: group
name: Hallway main lights
@@ -63,12 +65,6 @@ light:
name: Hallway all lights
entities:
- light.hallway_entrance_lights
- light.hallway_main_lights
- platform: group
name: Tuya Hallway all lights
entities:
- light.tuya_hallway_entrance_lights
- light.tuya_hallway_main_lights
- platform: group
@@ -77,7 +73,7 @@ light:
- light.living_room_all_lights
- light.master_bedroom_main_lights
- light.tuya_kitchen_all_lights
- light.tuya_hallway_all_lights
- light.hallway_all_lights
- platform: group
name: All lights
@@ -85,7 +81,7 @@ light:
- light.living_room_all_lights
- light.master_bedroom_all_lights
- light.tuya_kitchen_all_lights
- light.tuya_hallway_all_lights
- light.hallway_all_lights
homeassistant:
customize:
@@ -97,6 +93,8 @@ homeassistant:
icon: bha:ceiling-lamp-plafond
light.kitchen_main_lights:
icon: bha:ceiling-lamp-plafond
light.kitchen_secondary_lights:
icon: bha:ceiling-lamp-plafond
light.tuya_kitchen_all_lights:
icon: bha:ceiling-lamp-plafond
light.hallway_entrance_lights:
@@ -105,8 +103,6 @@ homeassistant:
icon: bha:ceiling-lamp-plafond
light.hallway_all_lights:
icon: bha:ceiling-lamp-plafond
light.tuya_hallway_all_lights:
icon: bha:ceiling-lamp-plafond
light.ceiling_lights:
icon: mdi:ceiling-light
light.pc:
@@ -218,6 +218,60 @@ light:
qos: 1
retain: false
- platform: mqtt
name: "light_lohas_5"
availability_topic: "tele/light_lohas_5/LWT"
command_topic: "cmnd/light_lohas_5/POWER"
state_topic: "tele/light_lohas_5/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/light_lohas_5/Dimmer"
brightness_state_topic: "tele/light_lohas_5/STATE"
brightness_scale: 100
on_command_type: "brightness"
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(',') }}"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
retain: false
- platform: mqtt
name: "light_lohas_6"
availability_topic: "tele/light_lohas_6/LWT"
command_topic: "cmnd/light_lohas_6/POWER"
state_topic: "tele/light_lohas_6/STATE"
state_value_template: "{{ value_json.POWER }}"
brightness_command_topic: "cmnd/light_lohas_6/Dimmer"
brightness_state_topic: "tele/light_lohas_6/STATE"
brightness_scale: 100
on_command_type: "brightness"
brightness_value_template: "{{ value_json.Dimmer }}"
hs_command_topic: "cmnd/light_lohas_6/HSBColor"
hs_state_topic: "tele/light_lohas_6/STATE"
hs_value_template: "{{ value_json.HSBColor.split(',')[0:2]|join(',') }}"
color_temp_command_topic: "cmnd/light_lohas_6/CT"
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_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:
- platform: mqtt
name: "PC light WiFi"
@@ -309,6 +363,26 @@ 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_6_wifi"
availability_topic: "tele/light_lohas_6/LWT"
device_class: signal_strength
payload_available: "Online"
payload_not_available: "Offline"
state_topic: "tele/light_lohas_6/STATE"
unit_of_measurement: "%"
value_template: "{{ value_json.Wifi.RSSI }}"
switch:
- platform: mqtt
name: "PC Light Fade"
@@ -409,6 +483,28 @@ 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_6_fade"
availability_topic: "tele/light_lohas_6/LWT"
command_topic: "cmnd/light_lohas_6/FADE"
icon: mdi:gradient
payload_available: "Online"
payload_not_available: "Offline"
qos: 1
state_topic: "stat/light_lohas_6/RESULT"
value_template: "{{ value_json.Fade }}"
automation:
- alias: Lighting · Sync Tasmota states on start-up
initial_state: true
+3 -6
View File
@@ -132,8 +132,7 @@ automation:
action:
- service: light.turn_on
entity_id:
- light.light_le_6
- light.light_le_8
- light.light_lohas_6
data:
brightness_pct: 13 # this is the lowest it'll go ¯\_(ツ)_/¯
@@ -150,11 +149,9 @@ automation:
action:
- service: light.turn_on
entity_id:
- light.light_le_6
- light.light_le_8
- light.light_lohas_6
data:
brightness_pct: 100
- service: light.turn_off
entity_id:
- light.light_le_6
- light.light_le_8
- light.light_lohas_6
@@ -12,7 +12,6 @@ input_boolean:
tuya_kitchen_main_lights_state:
tuya_kitchen_secondary_lights_state:
tuya_hallway_main_lights_state:
tuya_hallway_entrance_lights_state:
light:
- platform: template
@@ -50,17 +49,6 @@ light:
service: input_boolean.turn_off
entity_id: input_boolean.tuya_hallway_main_lights_state
tuya_hallway_entrance_lights:
friendly_name: Entrance lights (scene)
value_template: "{{ is_state('input_boolean.tuya_hallway_entrance_lights_state', 'on') }}"
icon_template: bha:ceiling-lamp-plafond
turn_on:
service: input_boolean.turn_on
entity_id: input_boolean.tuya_hallway_entrance_lights_state
turn_off:
service: input_boolean.turn_off
entity_id: input_boolean.tuya_hallway_entrance_lights_state
# Try to keep input_booleans consistent.
automation:
- alias: Lighting · Tuya · Update kitchen lights
@@ -70,7 +58,6 @@ automation:
- 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_entrance_lights_state
action:
- service: scene.turn_on
data_template:
@@ -95,6 +82,3 @@ automation:
- service_template: "input_boolean.turn_{{ states('light.hallway_main_lights') }}"
entity_id: input_boolean.tuya_hallway_main_lights_state
- service_template: "input_boolean.turn_{{ states('light.hallway_entrance_lights') }}"
entity_id: input_boolean.tuya_hallway_entrance_lights_state
+4 -3
View File
@@ -31,17 +31,18 @@ automation:
- light.living_room_main_lights
- light.pc
- light.master_bedroom_main_lights
- light.tuya_hallway_entrance_lights
- light.hallway_entrance_lights
- light.tuya_hallway_main_lights
- light.tuya_kitchen_main_lights
- light.tuya_kitchen_secondary_lights
- service: light.turn_off
entity_id:
- light.living_room_main_lights
- light.pc
- light.master_bedroom_main_lights
- light.tuya_hallway_entrance_lights
- light.hallway_entrance_lights
- light.tuya_hallway_main_lights
- light.tuya_kitchen_main_lights
- light.tuya_kitchen_secondary_lights
- alias: TV · Plex · Restore house after Plex
trigger: