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

135 lines
3.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: '150'
for:
hours: 0
minutes: 5
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'
- condition: state
entity_id: input_select.home_mode
state: Day
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: 0
seconds: 30
- platform: numeric_state
entity_id: sensor.office_illuminance
above: '30'
below: '150'
for:
hours: 0
minutes: 1
seconds: 0
- platform: numeric_state
entity_id: sensor.office_illuminance
above: '30'
below: '150'
for:
hours: 0
minutes: 2
seconds: 0
- platform: numeric_state
entity_id: sensor.office_illuminance
above: '30'
below: '150'
for:
hours: 0
minutes: 3
seconds: 0
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: cover.office_blinds
attribute: current_position
below: 51
sequence:
- service: cover.set_cover_position
data:
position: 50
target:
entity_id: cover.office_blinds
default:
- 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