From ce2c151ae9eca5d6efba5e17dc94cc62fe2b4f25 Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Mon, 28 Aug 2023 23:04:16 +0200 Subject: [PATCH] Add sleep notifications for cube --- .../automations/behaviour-goto-sleep.yaml | 37 +++++++++++++++++++ configuration/automations/work.yaml | 26 ++----------- 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/configuration/automations/behaviour-goto-sleep.yaml b/configuration/automations/behaviour-goto-sleep.yaml index e70c2cf..bc0448e 100644 --- a/configuration/automations/behaviour-goto-sleep.yaml +++ b/configuration/automations/behaviour-goto-sleep.yaml @@ -1,3 +1,19 @@ +- id: behaviour_pc_caffeine + alias: '[Behaviour] PC caffeine' + mode: single + trigger: + - platform: state + entity_id: + - input_boolean.pc_caffeine + to: "on" + condition: [ ] + action: + - service: light.turn_on + data: + color_name: green + target: + entity_id: light.notification_cube_light + - id: goto_sleep alias: '[Behaviour] Go to sleep' mode: single @@ -28,6 +44,11 @@ data: title: "Sleep notifier" message: "Go to sleep, computer will turn off in 5 minutes" + - service: light.turn_on + data: + color_name: orange + target: + entity_id: light.notification_cube_light - delay: '0:05:00' - choose: - conditions: @@ -58,6 +79,17 @@ - service: input_boolean.turn_off target: entity_id: input_boolean.pc_caffeine + - choose: + - conditions: + - condition: state + entity_id: input_boolean.pc_caffeine + state: 'off' + sequence: + - service: light.turn_on + data: + color_name: yellow + target: + entity_id: light.notification_cube_light - service: light.turn_off target: entity_id: light.office_light_up @@ -88,6 +120,11 @@ - 0 target: entity_id: light.office_light_up + - service: light.turn_on + data: + color_name: red + target: + entity_id: light.notification_cube_light - service: light.turn_on data: rgb_color: diff --git a/configuration/automations/work.yaml b/configuration/automations/work.yaml index 2fe3803..676eb15 100644 --- a/configuration/automations/work.yaml +++ b/configuration/automations/work.yaml @@ -77,7 +77,7 @@ mode: single - id: work_daily_minus_30m - alias: '[Work] Daily 30m' + alias: '[Work] Daily -30m' trigger: - platform: time at: '10:30' @@ -98,7 +98,7 @@ entity_id: light.notification_cube_light - id: work_daily_minus_15m - alias: '[Work] Daily 15m' + alias: '[Work] Daily -15m' trigger: - platform: time at: '10:45' @@ -119,7 +119,7 @@ entity_id: light.notification_cube_light - id: work_daily_minus_5m - alias: '[Work] Daily 5m' + alias: '[Work] Daily -5m' trigger: - platform: time at: '10:55' @@ -162,7 +162,7 @@ alias: '[Work] Daily end' trigger: - platform: time - at: '10:30' + at: '11:30' condition: - condition: time weekday: @@ -198,24 +198,6 @@ entity_id: light.notification_cube_light mode: single -- id: work_daily_off - alias: '[Work] Daily notification off' - trigger: - - platform: time - at: '10:00' - condition: - - condition: time - weekday: - - mon - - tue - - wed - - thu - - fri - action: - - service: light.turn_off - entity_id: light.notification_cube_light - mode: single - - id: work_cool_down_home alias: '[Work] Cool down home after leaving work' mode: single