From c5b230aa5099f685dd6f4b483f0f024137211422 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Thu, 12 Nov 2020 03:34:34 +0100 Subject: [PATCH] Update lights add couch lamp fix daily automation add finished work automation --- automations/files/daily.yaml | 23 ++++++++++++++++++- automations/files/finished-work.yaml | 33 ++++++++++++++++++++++++++++ automations/templates/lights.yaml.j2 | 2 +- automations/vars/main.yaml | 2 ++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 automations/files/finished-work.yaml diff --git a/automations/files/daily.yaml b/automations/files/daily.yaml index 6931904..38d8e77 100644 --- a/automations/files/daily.yaml +++ b/automations/files/daily.yaml @@ -5,6 +5,16 @@ at: '10:55' condition: [] action: + - service: light.turn_on + data: + brightness: 200 + rgb_color: + - 0 + - 0 + - 255 + entity_id: + - light.computer_left + - light.computer_right - service: light.turn_on data: flash: long @@ -23,7 +33,13 @@ trigger: - platform: time at: '11:25' - condition: [] + condition: + - condition: state + entity_id: light.computer_left + state: 'on' + - condition: state + entity_id: light.computer_right + state: 'on' action: - service: light.turn_on data: @@ -31,4 +47,9 @@ entity_id: - light.computer_left - light.computer_right + - delay: 5 + - service: light.turn_off + entity_id: + - light.computer_left + - light.computer_right mode: single diff --git a/automations/files/finished-work.yaml b/automations/files/finished-work.yaml new file mode 100644 index 0000000..4bea1d1 --- /dev/null +++ b/automations/files/finished-work.yaml @@ -0,0 +1,33 @@ +- id: work_finished + alias: Notify when finished work + description: '' + trigger: + - platform: state + entity_id: binary_sensor.luxoft + to: 'on' + for: + hours: 8 + condition: [] + action: + - service: light.turn_on + data: + brightness: 200 + rgb_color: + - 0 + - 255 + - 0 + entity_id: + - light.computer_left + - light.computer_right + - service: light.turn_on + data: + flash: long + brightness: 200 + rgb_color: + - 0 + - 0 + - 255 + entity_id: + - light.computer_left + - light.computer_right + mode: single diff --git a/automations/templates/lights.yaml.j2 b/automations/templates/lights.yaml.j2 index 41de985..fa6c0c0 100644 --- a/automations/templates/lights.yaml.j2 +++ b/automations/templates/lights.yaml.j2 @@ -39,7 +39,7 @@ condition: - condition: state entity_id: {{ light.entityId }} - state: 'off' + state: 'on' action: - service: light.turn_on data: diff --git a/automations/vars/main.yaml b/automations/vars/main.yaml index 899fb6f..7ffeea5 100644 --- a/automations/vars/main.yaml +++ b/automations/vars/main.yaml @@ -7,6 +7,8 @@ lights: name: TV Middle - entityId: light.tv_right name: TV Right + - entityId: light.couch_lamp + name: Couch lamp - entityId: light.kitchen_01 name: Kitchen 01 - entityId: light.kitchen_02