Cleanup
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
- alias: 'Der er nogen i indkørslen'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.indkorsel_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
action:
|
||||||
|
- service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: "Der er nogen i indkørslen"
|
||||||
|
# - service: script.sonos_say
|
||||||
|
# data:
|
||||||
|
# sonos_entity: media_player.alrum
|
||||||
|
# volume: 0.4
|
||||||
|
# delay: '00:00:05'
|
||||||
|
# message: 'Der er nogen i indkørslen'
|
||||||
|
- service: scene.create
|
||||||
|
data:
|
||||||
|
scene_id: before
|
||||||
|
snapshot_entities:
|
||||||
|
- light.stol
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.stol
|
||||||
|
brightness: 255
|
||||||
|
rgb_color: [255, 0, 0]
|
||||||
|
flash: long
|
||||||
|
- delay: 2
|
||||||
|
- service: scene.turn_on
|
||||||
|
entity_id: scene.before
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# - service: script.sonos_say
|
||||||
|
# data:
|
||||||
|
# sonos_entity: media_player.kontor
|
||||||
|
# volume: 0.7
|
||||||
|
# message: 'Hej Claus er det dig der går i gangen?'
|
||||||
|
# delay: '00:00:05'
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
######################################################################
|
||||||
|
## Weekday Morning Routines for the Wife and Kiddos.
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
- alias: 'Godmorgen start igen'
|
||||||
|
trigger:
|
||||||
|
platform: sun
|
||||||
|
event: sunset
|
||||||
|
action:
|
||||||
|
- service: input_boolean.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: input_boolean.first_run
|
||||||
|
|
||||||
|
- alias: 'Godmorgen'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.stue_motion_sensor
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
after: '06:00:00'
|
||||||
|
before: '10:00:00'
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.first_run
|
||||||
|
state: 'off'
|
||||||
|
action:
|
||||||
|
# - service: scene.turn_on
|
||||||
|
# entity_id: scene.34900
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: input_boolean.first_run
|
||||||
|
- service: script.monthly_color_scene
|
||||||
|
|
||||||
|
- alias: 'Godmorgen Children arbejdsdag'
|
||||||
|
trigger:
|
||||||
|
platform: time
|
||||||
|
at: '06:00:00'
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
action:
|
||||||
|
- service: script.andreas_color_scene
|
||||||
|
- service: script.daniel_color_scene
|
||||||
|
|
||||||
|
- alias: 'Godmorgen Children ikke arbejdsdag'
|
||||||
|
trigger:
|
||||||
|
platform: time
|
||||||
|
at: '08:00:00'
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'off'
|
||||||
|
action:
|
||||||
|
- service: script.andreas_color_scene
|
||||||
|
- service: script.daniel_color_scene
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
######################################################################
|
||||||
|
## Good night Routine
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
- alias: 'Godnat start igen'
|
||||||
|
trigger:
|
||||||
|
platform: sun
|
||||||
|
event: sunrise
|
||||||
|
action:
|
||||||
|
- service: input_boolean.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: input_boolean.first_run_eve
|
||||||
|
|
||||||
|
- alias: 'Godnat'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
after: '19:00:00'
|
||||||
|
before: '19:40:00'
|
||||||
|
- condition: state
|
||||||
|
entity_id: input_boolean.first_run_eve
|
||||||
|
state: 'off'
|
||||||
|
action:
|
||||||
|
# - service: scene.turn_on
|
||||||
|
# entity_id: scene.34900
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: input_boolean.first_run_eve
|
||||||
|
# - service: script.bed_color_scene
|
||||||
|
# - service: script.monthly_color_scene
|
||||||
|
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# on "workdays" and "no guests"
|
||||||
|
- alias: 'Gruppe køkken, stue, alrum, bad'
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: "00:05:30"
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
action:
|
||||||
|
- service: sonos.join
|
||||||
|
data:
|
||||||
|
master: media_player.kokken
|
||||||
|
entity_id:
|
||||||
|
- media_player.badevaerelse
|
||||||
|
# - media_player.sovevaerelse
|
||||||
|
- media_player.stue
|
||||||
|
- media_player.alrum
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
## Skal være tændt fra solnedgang og til kl 22
|
||||||
|
## og fra 6-solopgang
|
||||||
|
## derudover: hvis solen er under horisonten, så tænd i 5 minutter ved bevægelse
|
||||||
|
- alias: 'Julelys tænd morgen'
|
||||||
|
trigger:
|
||||||
|
platform: time
|
||||||
|
at: "06:00:00"
|
||||||
|
condition:
|
||||||
|
- condition: state # from sunset until sunrise
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: 'below_horizon'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.julelys
|
||||||
|
|
||||||
|
- alias: 'Julelys sluk morgen'
|
||||||
|
trigger:
|
||||||
|
platform: sun
|
||||||
|
event: sunrise
|
||||||
|
action:
|
||||||
|
- service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.julelys
|
||||||
|
|
||||||
|
- alias: 'Julelys tænd aften'
|
||||||
|
trigger:
|
||||||
|
platform: sun
|
||||||
|
event: sunset
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
before: '22:00:00'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.julelys
|
||||||
|
|
||||||
|
- alias: 'Julelys sluk aften'
|
||||||
|
trigger:
|
||||||
|
platform: time
|
||||||
|
at: "21:00:00"
|
||||||
|
action:
|
||||||
|
- service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.julelys
|
||||||
|
|
||||||
|
|
||||||
|
# - alias: 'Julelys tænd ved bevægelse'
|
||||||
|
# trigger:
|
||||||
|
# platform: state
|
||||||
|
# entity_id: binary_sensor.indkorsel_sensor_motion
|
||||||
|
# to: 'on'
|
||||||
|
# condition:
|
||||||
|
# - condition: time
|
||||||
|
# after: '22:00:10'
|
||||||
|
# before: '05:54:00'
|
||||||
|
# - condition: state
|
||||||
|
# entity_id: sun.sun
|
||||||
|
# state: below_horizon
|
||||||
|
# action:
|
||||||
|
# - service: light.turn_on
|
||||||
|
# data:
|
||||||
|
# entity_id: light.julelys
|
||||||
|
|
||||||
|
# - alias: 'Julelys sluk 15 min efter bevægelse'
|
||||||
|
# trigger:
|
||||||
|
# platform: state
|
||||||
|
# entity_id: binary_sensor.indkorsel_sensor_motion
|
||||||
|
# to: 'off'
|
||||||
|
# for:
|
||||||
|
# minutes: 15
|
||||||
|
# condition:
|
||||||
|
# - condition: time
|
||||||
|
# after: '22:00:10'
|
||||||
|
# before: '05:54:00'
|
||||||
|
# - condition: state
|
||||||
|
# entity_id: sun.sun
|
||||||
|
# state: below_horizon
|
||||||
|
# action:
|
||||||
|
# service: light.turn_off
|
||||||
|
# data:
|
||||||
|
# entity_id: light.julelys
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
- alias: 'Mor kommer hjem'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.annes_iphone_xs
|
||||||
|
to: 'home'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: 'Mor kommer hjem'
|
||||||
|
|
||||||
|
- alias: 'Daniel kommer hjem (mor)'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.daniels_iphone_7
|
||||||
|
to: 'home'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_annes_iphone_xs
|
||||||
|
data:
|
||||||
|
message: 'Daniel kommer hjem'
|
||||||
|
|
||||||
|
- alias: 'Daniel kommer hjem'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.daniels_iphone_7
|
||||||
|
to: 'home'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: 'Daniel kommer hjem'
|
||||||
|
|
||||||
|
- alias: 'Andreas kommer hjem (mor)'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.andreas_iphone_12
|
||||||
|
to: 'home'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_annes_iphone_xs
|
||||||
|
data:
|
||||||
|
message: 'Andreas kommer hjem'
|
||||||
|
|
||||||
|
|
||||||
|
- alias: 'Andreas kommer hjem'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.andreas_iphone_12
|
||||||
|
to: 'home'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: 'Andreas kommer hjem'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- alias: 'Andreas ankommer til skole (mor)'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.andreas_iphone_12
|
||||||
|
to: 'Skole'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_annes_iphone_xs
|
||||||
|
data:
|
||||||
|
message: 'Andreas ankommer til skole'
|
||||||
|
|
||||||
|
- alias: 'Andreas ankommer til skole'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.andreas_iphone_12
|
||||||
|
to: 'Skole'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: 'Andreas ankommer til skole'
|
||||||
|
|
||||||
|
- alias: 'Andreas tager fra skole'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.andreas_iphone_12
|
||||||
|
from: 'Skole'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: 'Andreas tager fra skole'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
- alias: 'Daniel ankommer til skole (mor)'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.daniels_iphone_7
|
||||||
|
to: 'Skole'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_annes_iphone_xs
|
||||||
|
data:
|
||||||
|
message: 'Daniel ankommer til skole'
|
||||||
|
|
||||||
|
|
||||||
|
- alias: 'Daniel ankommer til skole'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.daniels_iphone_7
|
||||||
|
to: 'Skole'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: 'Daniel ankommer til skole'
|
||||||
|
|
||||||
|
- alias: 'Daniel tager fra skole'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: device_tracker.daniels_iphone_7
|
||||||
|
from: 'Skole'
|
||||||
|
|
||||||
|
action:
|
||||||
|
service: notify.mobile_app_claus_iphone8
|
||||||
|
data:
|
||||||
|
message: 'Daniel tager fra skole'
|
||||||
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
# Turns on lights at sunset
|
||||||
|
- alias: 'Lys i glasskab i forgang'
|
||||||
|
trigger:
|
||||||
|
- platform: sun
|
||||||
|
event: sunset
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
before: '21:30:00'
|
||||||
|
action:
|
||||||
|
service: homeassistant.turn_on
|
||||||
|
entity_id: light.sonoff_100069a6cc
|
||||||
|
|
||||||
|
# Turns off lights
|
||||||
|
- alias: 'Sluk lys i glasskab i forgang'
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: '22:00:00'
|
||||||
|
action:
|
||||||
|
service: homeassistant.turn_off
|
||||||
|
entity_id: light.sonoff_100069a6cc
|
||||||
|
|
||||||
|
# Turns on lights at 06:00
|
||||||
|
- alias: 'Lys i glasskab i forgang morgen'
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: '06:00:00'
|
||||||
|
condition:
|
||||||
|
- condition: state # from sunset until sunrise
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: 'below_horizon'
|
||||||
|
action:
|
||||||
|
service: homeassistant.turn_on
|
||||||
|
entity_id: light.sonoff_100069a6cc
|
||||||
|
|
||||||
|
# Turns off lights at sunrise
|
||||||
|
- alias: 'Sluk lys i glasskab i forgang morgen'
|
||||||
|
trigger:
|
||||||
|
- platform: sun
|
||||||
|
event: sunrise
|
||||||
|
action:
|
||||||
|
service: homeassistant.turn_off
|
||||||
|
entity_id: light.sonoff_100069a6cc
|
||||||
|
|
||||||
@@ -0,0 +1,171 @@
|
|||||||
|
- alias: 'Lys i gang - arbejdsdag - dag'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
- condition: numeric_state
|
||||||
|
entity_id: sensor.gang_sensor_light_level
|
||||||
|
below: '70'
|
||||||
|
- condition: time
|
||||||
|
before: '19:30:00'
|
||||||
|
- condition: time
|
||||||
|
after: '06:15:00'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.gang
|
||||||
|
brightness: 255
|
||||||
|
color_temp: 396
|
||||||
|
|
||||||
|
- alias: 'Sluk Lys i gang - arbejdsdag - dag'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'off'
|
||||||
|
for:
|
||||||
|
minutes: 2
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
- condition: time
|
||||||
|
after: '06:15:10'
|
||||||
|
- condition: time
|
||||||
|
before: '19:30:00'
|
||||||
|
action:
|
||||||
|
service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.gang
|
||||||
|
|
||||||
|
- alias: 'Lys i gang - ikke arbejdsdag - dag'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'off'
|
||||||
|
- condition: numeric_state
|
||||||
|
entity_id: sensor.gang_sensor_light_level
|
||||||
|
below: 70
|
||||||
|
- condition: time
|
||||||
|
after: '08:00:00'
|
||||||
|
- condition: time
|
||||||
|
before: '20:30:00'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.gang
|
||||||
|
brightness: 255
|
||||||
|
color_temp: 396
|
||||||
|
|
||||||
|
- alias: 'Sluk Lys i gang - ikke arbejdsdag - dag'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'off'
|
||||||
|
for:
|
||||||
|
minutes: 2
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'off'
|
||||||
|
- condition: time
|
||||||
|
after: '08:00:10'
|
||||||
|
- condition: time
|
||||||
|
before: '20:30:00'
|
||||||
|
action:
|
||||||
|
service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.gang
|
||||||
|
|
||||||
|
########## NIGHT
|
||||||
|
|
||||||
|
- alias: 'Lys i gang - arbejdsdag - nat'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
- condition: numeric_state
|
||||||
|
entity_id: sensor.gang_sensor_light_level
|
||||||
|
below: '70'
|
||||||
|
- condition: time
|
||||||
|
before: '06:15:00'
|
||||||
|
after: '19:30:00'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.gang_syd
|
||||||
|
brightness_pct: 1
|
||||||
|
color_temp: 396
|
||||||
|
|
||||||
|
- alias: 'Sluk Lys i gang - arbejdsdag - nat'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'off'
|
||||||
|
for:
|
||||||
|
minutes: 1
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
- condition: time
|
||||||
|
after: '19:30:10'
|
||||||
|
before: '06:15:00'
|
||||||
|
action:
|
||||||
|
service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.gang_syd
|
||||||
|
|
||||||
|
- alias: 'Lys i gang - ikke arbejdsdag - nat'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'off'
|
||||||
|
# - condition: numeric_state
|
||||||
|
# entity_id: sensor.gang_sensor_light_level
|
||||||
|
# below: '70'
|
||||||
|
- condition: time
|
||||||
|
after: '20:30:00'
|
||||||
|
before: '08:00:00'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.gang_syd
|
||||||
|
brightness_pct: 1
|
||||||
|
color_temp: 396
|
||||||
|
|
||||||
|
|
||||||
|
- alias: 'Sluk Lys i gang - ikke arbejdsdag - nat'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.gang_sensor_motion
|
||||||
|
to: 'off'
|
||||||
|
for:
|
||||||
|
minutes: 1
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'off'
|
||||||
|
- condition: time
|
||||||
|
after: '20:30:10'
|
||||||
|
before: '08:00:00'
|
||||||
|
action:
|
||||||
|
- service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.gang_syd
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
###################################
|
||||||
|
## Turn on garden lights
|
||||||
|
#
|
||||||
|
#
|
||||||
|
###################################
|
||||||
|
|
||||||
|
- alias: 'Lys have, aften'
|
||||||
|
trigger:
|
||||||
|
- platform: sun
|
||||||
|
event: sunset
|
||||||
|
# offset: "00:10:00"
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
before: '22:00:00'
|
||||||
|
action:
|
||||||
|
# - delay: '00:{{ (range(1, 20)|random|int) }}:00'
|
||||||
|
- service: script.have_color_scene
|
||||||
|
# - service: light.turn_on
|
||||||
|
# entity_id:
|
||||||
|
# - light.havelys
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
## Skal være tændt fra solnedgang og til kl 22
|
||||||
|
## og fra 6-solopgang
|
||||||
|
## derudover: hvis solen er under horisonten, så tænd i 5 minutter ved bevægelse
|
||||||
|
- alias: 'Tænd lys indkørsel morgen'
|
||||||
|
trigger:
|
||||||
|
platform: time
|
||||||
|
at: "06:00:00"
|
||||||
|
condition:
|
||||||
|
- condition: state # from sunset until sunrise
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: 'below_horizon'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.indkorsel
|
||||||
|
|
||||||
|
- alias: 'Sluk lys indkørsel morgen'
|
||||||
|
trigger:
|
||||||
|
platform: sun
|
||||||
|
event: sunrise
|
||||||
|
action:
|
||||||
|
- service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.indkorsel
|
||||||
|
|
||||||
|
- alias: 'Tænd lys indkørsel aften'
|
||||||
|
trigger:
|
||||||
|
platform: sun
|
||||||
|
event: sunset
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
before: '22:00:00'
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.indkorsel
|
||||||
|
|
||||||
|
- alias: 'Sluk lys indkørsel aften'
|
||||||
|
trigger:
|
||||||
|
platform: time
|
||||||
|
at: "22:00:00"
|
||||||
|
action:
|
||||||
|
- service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.indkorsel
|
||||||
|
|
||||||
|
|
||||||
|
- alias: 'Tænd lys indkørsel ved bevægelse'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.indkorsel_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
after: '22:00:10'
|
||||||
|
before: '05:54:00'
|
||||||
|
- condition: state
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: below_horizon
|
||||||
|
action:
|
||||||
|
- service: light.turn_on
|
||||||
|
data:
|
||||||
|
entity_id: light.indkorsel
|
||||||
|
|
||||||
|
- alias: 'Sluk lys indkørsel 15 min efter bevægelse'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.indkorsel_sensor_motion
|
||||||
|
to: 'off'
|
||||||
|
for:
|
||||||
|
minutes: 15
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
after: '22:00:10'
|
||||||
|
before: '05:54:00'
|
||||||
|
- condition: state
|
||||||
|
entity_id: sun.sun
|
||||||
|
state: below_horizon
|
||||||
|
action:
|
||||||
|
service: light.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.indkorsel
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
- alias: 'Lys ved garage'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.indkorsel_sensor_motion
|
||||||
|
to: 'on'
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
before: '23:00:00'
|
||||||
|
# - condition: state
|
||||||
|
# entity_id: sun.sun
|
||||||
|
# state: below_horizon
|
||||||
|
action:
|
||||||
|
- service: homeassistant.turn_on
|
||||||
|
entity_id: light.drivhus
|
||||||
|
|
||||||
|
- alias: 'Sluk lys ved garage'
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: binary_sensor.indkorsel_sensor_motion
|
||||||
|
to: 'off'
|
||||||
|
for:
|
||||||
|
minutes: 10
|
||||||
|
action:
|
||||||
|
service: homeassistant.turn_off
|
||||||
|
data:
|
||||||
|
entity_id: light.drivhus
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# restart HA to keep it fresh
|
||||||
|
- alias: Restart HA
|
||||||
|
trigger:
|
||||||
|
platform: time
|
||||||
|
at: "02:00:00"
|
||||||
|
condition:
|
||||||
|
condition: time
|
||||||
|
weekday:
|
||||||
|
- sun
|
||||||
|
- mon
|
||||||
|
- tue
|
||||||
|
- wed
|
||||||
|
- thu
|
||||||
|
- fri
|
||||||
|
- sat
|
||||||
|
action:
|
||||||
|
- service: homeassistant.restart
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
###################################
|
||||||
|
## Sunrise and Sunset stuff
|
||||||
|
# @CCOSTAN
|
||||||
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||||
|
###################################
|
||||||
|
|
||||||
|
- alias: 'Sunset Stuff on'
|
||||||
|
trigger:
|
||||||
|
- platform: sun
|
||||||
|
event: sunset
|
||||||
|
# offset: "-00:20:00"
|
||||||
|
condition:
|
||||||
|
- condition: time
|
||||||
|
before: '22:00:00'
|
||||||
|
action:
|
||||||
|
# - delay: '00:{{ (range(1, 20)|random|int) }}:00'
|
||||||
|
- service: script.monthly_color_scene
|
||||||
|
- service: light.turn_on
|
||||||
|
entity_id:
|
||||||
|
- light.stue
|
||||||
|
- light.raket
|
||||||
|
- light.stol
|
||||||
|
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# on "workdays" and "no guests"
|
||||||
|
- alias: 'Gruppe køkken, stue, alrum'
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: "08:30:00"
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
action:
|
||||||
|
- service: sonos.unjoin
|
||||||
|
entity_id: media_player.badevaerelse
|
||||||
|
- service: sonos.unjoin
|
||||||
|
entity_id: media_player.sovevaerelse
|
||||||
|
|
||||||
|
- alias: 'Gruppe køkken uden stue, alrum'
|
||||||
|
trigger:
|
||||||
|
- platform: time
|
||||||
|
at: "17:00:00"
|
||||||
|
condition:
|
||||||
|
- condition: state
|
||||||
|
entity_id: binary_sensor.arbejdsdag
|
||||||
|
state: 'on'
|
||||||
|
action:
|
||||||
|
- service: sonos.unjoin
|
||||||
|
entity_id: media_player.kokken
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# - platform: tile
|
||||||
|
# username: !secret tile_username
|
||||||
|
# password: !secret tile_password
|
||||||
|
|
||||||
|
# - platform: huesensor
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
today = datetime.datetime.now().date()
|
||||||
|
|
||||||
|
name = data.get('name')
|
||||||
|
type = data.get('type')
|
||||||
|
sensorName = "sensor.{}_{}".format(type , name.replace(" " , "_"))
|
||||||
|
|
||||||
|
dateStr = data.get('date')
|
||||||
|
dateSplit = dateStr.split("/")
|
||||||
|
|
||||||
|
dateDay = int(dateSplit[0])
|
||||||
|
dateMonth = int(dateSplit[1])
|
||||||
|
dateYear = int(dateSplit[2])
|
||||||
|
date = datetime.date(dateYear , dateMonth , dateDay)
|
||||||
|
|
||||||
|
thisYear = today.year
|
||||||
|
nextOccur = datetime.date(thisYear , dateMonth , dateDay)
|
||||||
|
|
||||||
|
numberOfDays = 0
|
||||||
|
years = int(thisYear) - dateYear
|
||||||
|
|
||||||
|
if today < nextOccur:
|
||||||
|
numberOfDays = (nextOccur - today).days
|
||||||
|
|
||||||
|
elif today > nextOccur:
|
||||||
|
if thisYear > dateYear + 1:
|
||||||
|
nextOccur = datetime.date(thisYear + 1 , dateMonth , dateDay)
|
||||||
|
numberOfDays = (nextOccur - today).days
|
||||||
|
years = years + 1
|
||||||
|
else:
|
||||||
|
nextOccur = datetime.date(dateYear , dateMonth , dateDay)
|
||||||
|
numberOfDays = (nextOccur - today).days
|
||||||
|
years = years + 1
|
||||||
|
|
||||||
|
friendly_name = ''
|
||||||
|
|
||||||
|
if type.lower() == 'birthday':
|
||||||
|
friendly_name = "{}'s {}".format(name , type)
|
||||||
|
else:
|
||||||
|
friendly_name = "{} {}".format(name , type)
|
||||||
|
|
||||||
|
hass.states.set(sensorName , numberOfDays ,
|
||||||
|
{
|
||||||
|
"icon" : "mdi:calendar-star" ,
|
||||||
|
"unit_of_measurement" : "days" ,
|
||||||
|
"friendly_name" : friendly_name,
|
||||||
|
"nextoccur" : "{}/{}/{}".format(nextOccur.day , nextOccur.month , nextOccur.year) ,
|
||||||
|
"years" : years
|
||||||
|
}
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user