This commit is contained in:
darthsandmann
2022-08-30 18:42:25 +02:00
parent 79919e5857
commit 853c1d1716
73 changed files with 3902 additions and 1210 deletions

View File

@ -1,16 +0,0 @@
## -------------------------------------------------------------------------------------------------##
## Circadian Lighting / Flux
## -------------------------------------------------------------------------------------------------##
circadian_lighting:
min_colortemp: 2700
max_colortemp: 6500
interval: 450
transition: 8
switch:
- platform: circadian_lighting
lights_ct:
- light.stripe
- light.direct
max_brightness: 80

View File

@ -0,0 +1,18 @@
adaptive_lighting:
- name: "default"
lights:
- light.stripe
- light.direct
prefer_rgb_color: false
transition: 45
initial_transition: 1
interval: 90
min_brightness: 1
max_brightness: 80
min_color_temp: 2500
max_color_temp: 6500
sleep_brightness: 1
sleep_color_temp: 1000
take_over_control: true
detect_non_ha_changes: false
only_once: false

View File

@ -0,0 +1,31 @@
input_boolean:
lights_needed:
name: Lights needed
initial: false
automation:
- alias: lights_needed
mode: single
trigger:
- platform: time_pattern
minutes: "10"
action:
- if:
# Resets at midnight -> OR instead of AND
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: "-01:00"
- condition: sun
before: sunrise
before_offset: "+01:00"
then:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.lights_needed
else:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.lights_needed

View File

@ -0,0 +1,66 @@
automation:
- alias: light_still_on_still_needed_notify
mode: single
trigger:
- platform: state
entity_id:
- light.all_lights
to: "on"
for:
hours: 0
minutes: 15
seconds: 0
condition:
- condition: state
entity_id: input_boolean.lights_needed
state: "off"
for:
hours: 0
minutes: 15
seconds: 0
action:
- service: notify.mobile_app_iphone
data:
message: "Lights are still on."
data:
actions:
- action: "LIGHTTURNOFF"
title: Turn them off
icon: "sfsymbols:lightbulb"
- alias: light_still_on_iphone_offline_notify
mode: single
trigger:
- platform: state
entity_id:
- device_tracker.pfsense_kais_iphone_wnsrt_de
to: not_home
for:
hours: 0
minutes: 2
seconds: 0
condition:
- condition: state
entity_id: light.all_lights
state: "on"
action:
- service: notify.mobile_app_iphone
data:
message: "Lights are still on."
data:
actions:
- action: "LIGHTTURNOFF"
title: Turn them off
icon: "sfsymbols:lightbulb"
- alias: light_still_on_notification_event
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "LIGHTTURNOFF"
action:
- service: light.turn_off
target:
entity_id: light.all_lights

View File

@ -0,0 +1,34 @@
scene:
- name: light_adaptive
entities:
light.all_direct: false
light.all_indirect: true
switch.adaptive_lighting_default: on
switch.adaptive_lighting_sleep_mode_default: off
- name: light_blue
entities:
switch.adaptive_lighting_default: off
switch.adaptive_lighting_sleep_mode_default: off
light.all_direct: false
light.all_indirect:
rgb_color: [0, 0, 255]
state: true
brightness: 20
- name: light_night
entities:
switch.adaptive_lighting_default: on
light.all_direct: false
light.all_indirect:
rgb_color: [255, 139, 21]
state: true
brightness: 1
switch.adaptive_lighting_sleep_mode_default: on
- name: light_bright
entities:
switch.adaptive_lighting_default: off
light.all_direct: false
light.all_lights:
color_temp: 238
state: true
brightness: 255
switch.adaptive_lighting_sleep_mode_default: off

View File

@ -0,0 +1,20 @@
automation:
- alias: light_all_snapshot
mode: single
trigger:
- platform: time_pattern
seconds: "30"
condition:
- condition: state
entity_id: light.all_lights
state: "on"
action:
- service: scene.create
data:
scene_id: snapshot_all
snapshot_entities:
- light.all_indirect
- light.bed_ceiling
- light.ceiling
- switch.adaptive_lighting_sleep_mode_default
- switch.adaptive_lighting_default

View File

@ -1,25 +0,0 @@
scene:
- name: light_alloff
entities:
light.all_lights: false
- name: light_flux
entities:
light.all_direct: false
light.all_indirect: true
switch.circadian_lighting_circadian_lighting: on
- name: light_blue
entities:
switch.circadian_lighting_circadian_lighting: off
light.all_direct: false
light.all_indirect:
rgb_color: [0, 0, 255]
state: true
brightness: 20
- name: light_night
entities:
switch.circadian_lighting_circadian_lighting: off
light.all_direct: false
light.all_indirect:
rgb_color: [255, 139, 21]
state: true
brightness: 1

View File

@ -1,28 +0,0 @@
## -------------------------------------------------------------------------------------------------##
## Light_Store
## https://github.com/pnbruckner/homeassistant-config/blob/master/python_scripts/light_store.py
## -------------------------------------------------------------------------------------------------##
script:
light_store_save:
sequence:
- service: python_script.light_store
data:
store_name: flash_store
entity_id:
- light.bed
- light.closet
- light.desk
- light.direct
- light.tv
light_store_off:
sequence:
- service: script.light_store_save
- service: light.turn_off
entity_id: light.all_lights
light_store_restore:
sequence:
- service: python_script.light_store
data:
store_name: flash_store
operation: restore

25
packages/light/yeelight.yaml Normal file → Executable file
View File

@ -1,8 +1,3 @@
## -------------------------------------------------------------------------------------------------##
## Yeelight
## -------------------------------------------------------------------------------------------------##
## -------------------------------------------------------------------------------------------------##
## Discovery disable
## -------------------------------------------------------------------------------------------------##
@ -12,40 +7,40 @@ discovery:
## -------------------------------------------------------------------------------------------------##
## Lampen-Konfig
## Lights
## -------------------------------------------------------------------------------------------------##
yeelight:
devices:
10.10.10.82:
name: ceiling1
save_on_change: False
transition: 2500
transition: 500
10.10.10.83:
name: ceiling2
save_on_change: False
transition: 2500
transition: 500
10.10.10.80:
name: ceiling3
save_on_change: False
transition: 2500
transition: 500
10.10.10.81:
name: bed_ceiling
save_on_change: False
transition: 2500
transition: 500
10.10.10.84:
name: bed
save_on_change: False
transition: 2500
transition: 500
model: strip1
10.10.10.85:
name: desk
save_on_change: False
transition: 2500
transition: 500
model: strip1
## -------------------------------------------------------------------------------------------------##
## Lampengruppen
## Light Groups
## -------------------------------------------------------------------------------------------------##
light:
- platform: group
@ -78,6 +73,4 @@ light:
name: all_lights
entities:
- light.all_direct
- light.all_indirect
- light.all_indirect