Browse Source

Added custom room lights (to replace tplink)

master
Teknikode 2 years ago
parent
commit
4eb46afd21
  1. 28
      components/groups/lights.yaml
  2. 16
      components/input_booleans/lights.yaml
  3. 21
      components/input_numbers/lights.yaml
  4. 57
      components/lights/dimmer.yaml
  5. 65
      components/lights/switch.yaml
  6. 10
      configuration.yaml

28
components/groups/lights.yaml

@ -8,17 +8,17 @@ living_room_lights: @@ -8,17 +8,17 @@ living_room_lights:
front_porch_lights:
name: Front Porch Lights
entities:
- switch.front_porch_light
- light.front_porch_light
back_porch_lights:
name: Back Porch Lights
entities:
- switch.back_porch_light
- light.back_porch_light
back_patio_lights:
name: Back Patio Lights
entities:
- switch.back_patio_lights
- light.back_patio_lights
backyard_lights:
name: Backyard Lights
@ -29,22 +29,22 @@ backyard_lights: @@ -29,22 +29,22 @@ backyard_lights:
bedroom_lights:
name: Bedroom Lights
entities:
- switch.bedroom_ceiling_light
- light.bedroom_ceiling_light
kitchen_lights:
name: Kitchen Lights
entities:
- light.kitchen_lights
- light.kitchen_ceiling_lights
entry_way_lights:
name: Entry Way Lights
entities:
- light.entry_light
- light.entry_way_light
hallway_lights:
name: Hallway Lights
entities:
- switch.hallway_light
- light.hallway_light
all_lights:
name: All Lights
@ -52,10 +52,10 @@ all_lights: @@ -52,10 +52,10 @@ all_lights:
- light.living_room_lamp_large
- light.living_room_lamp_small
- light.living_room_ceiling_lights
- switch.hallway_light
- switch.bedroom_ceiling_light
- switch.back_porch_light
- switch.back_patio_lights
- light.entry_light
- switch.front_porch_lights
- light.kitchen_lights
- light.hallway_light
- light.bedroom_ceiling_light
- light.back_porch_light
- light.back_patio_lights
- light.entry_way_light
- light.front_porch_light
- light.kitchen_ceiling_lights

16
components/input_booleans/lights.yaml

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
kitchen_light_switch:
name: Kitchen Light Switch
living_room_light_switch:
name: Living Room Light Switch
hallway_light_switch:
name: Hallway Light Switch
bedroom_light_switch:
name: Bedroom Light Switch
entry_way_light_switch:
name: Entry Way Light Switch
front_porch_light_switch:
name: Front Porch Light Switch
back_porch_light_switch:
name: Back Porch Light Switch
back_patio_light_switch:
name: Back Patio Light Switch

21
components/input_numbers/lights.yaml

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
living_room_ceiling_light_brightness:
name: Living Room Ceiling Light Brightness
initial: 255
min: 0
max: 255
step: 1
unit_of_measurement: lux
kitchen_ceiling_light_brightness:
name: Kitchen Ceiling Light Brightness
initial: 255
min: 0
max: 255
step: 1
unit_of_measurement: lux
entry_way_light_brightness:
name: Entry Way Light Brightness
initial: 255
min: 0
max: 255
step: 1
unit_of_measurement: lux

57
components/lights/dimmer.yaml

@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
- platform: template
lights:
living_room_ceiling_lights:
friendly_name: "Living Room Ceiling Lights"
level_template: "{{ states('input_number.living_room_ceiling_lights_brightness') | int }}"
value_template: "{{ states('input_number.living_room_ceiling_lights_brightness') | int > 0 and is_state('input_boolean.living_room_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.living_room_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.living_room_light_switch
set_level:
- service: input_number.set_value
data_template:
value: "{{ brightness }}"
entity_id: input_number.living_room_ceiling_lights_brightness
- platform: template
lights:
kitchen_ceiling_lights:
friendly_name: "Kitchen Ceiling Lights"
level_template: "{{ states('input_number.kitchen_ceiling_light_brightness') | int }}"
value_template: "{{ states('input_number.kitchen_ceiling_light_brightness') | int > 0 and is_state('input_boolean.kitchen_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.kitchen_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.kitchen_light_switch
set_level:
- service: input_number.set_value
data_template:
value: "{{ brightness }}"
entity_id: input_number.kitchen_ceiling_light_brightness
- platform: template
lights:
entry_way_light:
friendly_name: "Entry Way Light"
level_template: "{{ states('input_number.entry_way_light_brightness') | int }}"
value_template: "{{ states('input_number.entry_way_light_brightness') | int > 0 and is_state('input_boolean.entry_way_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.entry_way_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.entry_way_light_switch
set_level:
- service: input_number.set_value
data_template:
value: "{{ brightness }}"
entity_id: input_number.entry_way_light_brightness

65
components/lights/switch.yaml

@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
- platform: template
lights:
hallway_light:
friendly_name: "Hallway Light"
value_template: "{{ is_state('input_boolean.hallway_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.hallway_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.hallway_light_switch
- platform: template
lights:
bedroom_ceiling_light:
friendly_name: "Bedroom Ceiling Light"
value_template: "{{ is_state('input_boolean.bedroom_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.bedroom_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.bedroom_light_switch
- platform: template
lights:
front_porch_light:
friendly_name: "Front Porch Light"
value_template: "{{ is_state('input_boolean.front_porch_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.front_porch_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.front_porch_light_switch
- platform: template
lights:
back_porch_light:
friendly_name: "Back Porch Light"
value_template: "{{ is_state('input_boolean.back_porch_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.back_porch_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.back_porch_light_switch
- platform: template
lights:
back_patio_lights:
friendly_name: "Back Patio Lights"
value_template: "{{ is_state('input_boolean.back_patio_light_switch', 'on') }}"
turn_on:
- service: input_boolean.turn_on
data:
entity_id: input_boolean.back_patio_light_switch
turn_off:
- service: input_boolean.turn_off
data:
entity_id: input_boolean.back_patio_light_switch

10
configuration.yaml

@ -138,8 +138,8 @@ hue: @@ -138,8 +138,8 @@ hue:
- host: !secret hue_bridge_host
allow_unreachable: true
# TP-Link
tplink: !include components/tplink.yaml
# TP-Link - not working, handled in Node RED
# tplink: !include components/tplink.yaml
# Amcrest Cameras
amcrest: !include components/amcrest.yaml
@ -156,9 +156,15 @@ input_boolean: !include_dir_merge_named components/input_booleans @@ -156,9 +156,15 @@ input_boolean: !include_dir_merge_named components/input_booleans
# Input Selects
input_select: !include_dir_merge_named components/input_selects
# Input Numbers
input_number: !include_dir_merge_named components/input_numbers
# Input DateTimes
input_datetime: !include_dir_merge_named components/input_datetimes
# Light Templates
light: !include_dir_merge_list components/lights
# Switches
switch: !include_dir_merge_list components/switches

Loading…
Cancel
Save