From 285e901087eb48cb7436b8c88d5f2f756f69665f Mon Sep 17 00:00:00 2001 From: pgrondek Date: Sun, 8 Nov 2020 15:55:26 +0100 Subject: [PATCH] Lights update add missing condition for lights automations add computer lights --- automations/templates/lights.yaml.j2 | 8 ++++++++ automations/vars/main.yaml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/automations/templates/lights.yaml.j2 b/automations/templates/lights.yaml.j2 index b6cdd9b..41de985 100644 --- a/automations/templates/lights.yaml.j2 +++ b/automations/templates/lights.yaml.j2 @@ -21,6 +21,10 @@ trigger: - platform: time at: input_datetime.sleep_mode + condition: + - condition: state + entity_id: {{ light.entityId }} + state: 'on' action: - service: light.turn_on data: @@ -32,6 +36,10 @@ trigger: - platform: time at: input_datetime.day_mode + condition: + - condition: state + entity_id: {{ light.entityId }} + state: 'off' action: - service: light.turn_on data: diff --git a/automations/vars/main.yaml b/automations/vars/main.yaml index 228c991..899fb6f 100644 --- a/automations/vars/main.yaml +++ b/automations/vars/main.yaml @@ -35,6 +35,10 @@ lights: name: Kitchen 13 - entityId: light.kitchen_14 name: Kitchen 14 + - entityId: light.computer_left + name: Computer left + - entityId: light.computer_right + name: Computer right airPurifiers: - entityId: fan.xiaomi_miio_device componentId: xiaomi_miio_device