1
0
ansible-home-assistant/configuration/automations/brightness.yaml
2022-09-26 21:33:44 +02:00

95 lines
2.1 KiB
YAML

- id: brightness-dark
alias: '[Brightness] Dark - close covers'
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.office_illuminance
below: '25'
for:
hours: 0
minutes: 1
seconds: 0
action:
- service: cover.close_cover
target:
entity_id:
- cover.office_blinds
- cover.dining_blinds
- id: brightness-dark-lights-on
alias: '[Brightness] Dark - turn on lights'
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.office_illuminance
below: '160'
for:
hours: 0
minutes: 2
seconds: 0
condition:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.hulk_ping
state: 'on'
- condition: state
entity_id: binary_sensor.hawkeye_ping
state: 'on'
- condition: state
entity_id: device_tracker.amdn4684
state: 'home'
action:
- service: script.office_lights_on
- id: brightness-ok-lights-off
alias: '[Brightness] Dark - turn off lights'
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.office_illuminance
above: '250'
for:
hours: 0
minutes: 1
seconds: 0
action:
- service: script.office_lights_off
- id: brightness-ok
alias: '[Brightness] OK - open covers'
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.office_illuminance
above: '30'
below: '150'
for:
hours: 0
minutes: 1
seconds: 0
action:
- service: cover.open_cover
target:
entity_id:
- cover.dining_blinds
- service: script.office_blinds_up
- id: brightness-bright
alias: '[Brightness] Bright - close covers'
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.office_illuminance
above: '1300'
for:
hours: 0
minutes: 1
seconds: 0
action:
- service: cover.close_cover
target:
entity_id:
- cover.dining_blinds
- service: script.office_blinds_down