172 lines
4.2 KiB
YAML
172 lines
4.2 KiB
YAML
- 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_illuminance
|
|
below: '70'
|
|
- condition: time
|
|
before: '21:30:00'
|
|
- condition: time
|
|
after: '06:30:00'
|
|
action:
|
|
- service: scene.turn_on
|
|
data:
|
|
entity_id: scene.gang_bright
|
|
# 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: 3
|
|
condition:
|
|
- condition: state
|
|
entity_id: binary_sensor.arbejdsdag
|
|
state: 'on'
|
|
- condition: time
|
|
after: '06:30:10'
|
|
- condition: time
|
|
before: '21:30:00'
|
|
action:
|
|
service: light.turn_off
|
|
data:
|
|
entity_id: light.gang_2
|
|
|
|
- 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_illuminance
|
|
below: 70
|
|
- condition: time
|
|
after: '08:00:00'
|
|
- condition: time
|
|
before: '22:00:00'
|
|
action:
|
|
- service: scene.turn_on
|
|
data:
|
|
entity_id: scene.gang_bright
|
|
# 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: 3
|
|
condition:
|
|
- condition: state
|
|
entity_id: binary_sensor.arbejdsdag
|
|
state: 'off'
|
|
- condition: time
|
|
after: '08:00:10'
|
|
- condition: time
|
|
before: '22:00:00'
|
|
action:
|
|
service: light.turn_off
|
|
data:
|
|
entity_id: light.gang_2
|
|
|
|
########## 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_illuminance
|
|
below: '70'
|
|
- condition: time
|
|
before: '06:30:00'
|
|
after: '21:30:00'
|
|
action:
|
|
- service: scene.turn_on
|
|
data:
|
|
entity_id: scene.gang_daempet_nat
|
|
# 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: '21:30:10'
|
|
before: '06:30:00'
|
|
action:
|
|
service: light.turn_off
|
|
data:
|
|
entity_id: light.gang_2
|
|
|
|
- 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: '22:00:00'
|
|
before: '08:00:00'
|
|
action:
|
|
- service: scene.turn_on
|
|
data:
|
|
entity_id: scene.gang_daempet_nat
|
|
# 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: '22:00:10'
|
|
before: '08:00:00'
|
|
action:
|
|
- service: light.turn_off
|
|
data:
|
|
entity_id: light.gang_2
|
|
|