1
0
ansible-home-assistant/configuration/automations/brightness.yaml

95 lines
2.1 KiB
YAML

- id: brightness-dark
alias: '[Brightness] Dark'
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: '55'
for:
hours: 0
minutes: 1
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: '60'
for:
hours: 0
minutes: 1
seconds: 0
action:
- service: script.office_lights_off
- id: brightness-ok
alias: '[Brightness] OK'
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.office_blinds
- cover.dining_blinds
- id: brightness-bright
alias: '[Brightness] Bright'
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.office_illuminance
above: '1500'
for:
hours: 0
minutes: 1
seconds: 0
action:
- service: cover.close_cover
target:
entity_id:
- cover.office_blinds
- cover.dining_blinds