From ac24a3b7c068f9088ce93cd37129c251a77fc172 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Fri, 12 Aug 2022 20:30:47 +0200 Subject: [PATCH] Auto turn lights when it's dark --- configuration/automations/brightness.yaml | 32 ++++++++++++++++++++++- configuration/configuration.yaml | 3 +++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/configuration/automations/brightness.yaml b/configuration/automations/brightness.yaml index 7734cb2..cf07efa 100644 --- a/configuration/automations/brightness.yaml +++ b/configuration/automations/brightness.yaml @@ -4,7 +4,7 @@ trigger: - platform: numeric_state entity_id: sensor.office_illuminance - below: '20' + below: '25' for: hours: 0 minutes: 1 @@ -16,6 +16,36 @@ - 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: '50' + 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: cover.close_cover + target: + entity_id: + - cover.office_blinds + - cover.dining_blinds + - id: brightness-ok alias: '[Brightness] OK' mode: single diff --git a/configuration/configuration.yaml b/configuration/configuration.yaml index aad8e88..598ed0a 100644 --- a/configuration/configuration.yaml +++ b/configuration/configuration.yaml @@ -493,6 +493,9 @@ binary_sensor: - name: Banner Ping platform: ping host: 192.168.50.22 + - name: Hawkeye Ping + platform: ping + host: 192.168.50.23 switch: # - platform: zoneminder