From 11d3512b2a65a687b8ab5216ffb1c07aaa06464e Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Sat, 23 Jan 2021 19:32:51 +0100 Subject: [PATCH] Housekeeping use light groups instead of multiple lights add prefix to some automations rename some files --- automations/files/bathroom-button.yaml | 6 +- automations/files/bathroom-mirror-button.yaml | 12 +-- automations/files/bathroom-motion.yaml | 5 +- automations/files/bathroom-shower-motion.yaml | 12 +-- automations/files/bedroom-button.yaml | 78 +++++++++---------- automations/files/bedroom-humidifier.yaml | 1 - .../files/{tv.yaml => behaviour-tv.yaml} | 2 +- automations/files/computer-button.yaml | 14 +--- automations/files/computer-lights.yaml | 3 +- automations/files/goto-sleep.yaml | 4 +- automations/files/hallway-doorbel.yaml | 41 ++++++++++ automations/files/kitchen-button.yaml | 32 +------- automations/files/modes.yaml | 2 - .../files/{daily.yaml => work-daily.yaml} | 20 ++--- ...{finished-work.yaml => work-finished.yaml} | 11 +-- 15 files changed, 98 insertions(+), 145 deletions(-) rename automations/files/{tv.yaml => behaviour-tv.yaml} (93%) create mode 100644 automations/files/hallway-doorbel.yaml rename automations/files/{daily.yaml => work-daily.yaml} (72%) rename automations/files/{finished-work.yaml => work-finished.yaml} (68%) diff --git a/automations/files/bathroom-button.yaml b/automations/files/bathroom-button.yaml index f2c1025..319e3c4 100644 --- a/automations/files/bathroom-button.yaml +++ b/automations/files/bathroom-button.yaml @@ -10,9 +10,5 @@ action: - service: light.toggle data: - entity_id: - - light.bathroom_1 - - light.bathroom_2 - - light.bathroom_3 - - light.bathroom_4 + entity_id: light.bathroom_lights mode: single \ No newline at end of file diff --git a/automations/files/bathroom-mirror-button.yaml b/automations/files/bathroom-mirror-button.yaml index 53ead55..f174aa7 100644 --- a/automations/files/bathroom-mirror-button.yaml +++ b/automations/files/bathroom-mirror-button.yaml @@ -6,14 +6,10 @@ platform: device type: remote_button_short_press subtype: turn_on - condition: [] action: - service: light.turn_on data: - entity_id: - - light.mirror_left - - light.mirror_middle - - light.mirror_right + entity_id: light.bathroom_mirror_lights mode: single - id: button-bathroom-mirror-off alias: '[Bathroom] Mirror Button Off' @@ -23,14 +19,10 @@ platform: device type: remote_button_short_press subtype: turn_off - condition: [] action: - service: light.turn_off data: - entity_id: - - light.mirror_left - - light.mirror_middle - - light.mirror_right + entity_id: light.bathroom_mirror_lights mode: single #- id: button-bathroom-hold-on # alias: Button Hold On computer cave diff --git a/automations/files/bathroom-motion.yaml b/automations/files/bathroom-motion.yaml index 6dfa8b5..b4f08f0 100644 --- a/automations/files/bathroom-motion.yaml +++ b/automations/files/bathroom-motion.yaml @@ -65,7 +65,4 @@ to: 'off' action: - service: light.turn_off - entity_id: - - light.bathroom_lights - - light.bathroom_mirror_lights - - light.bathroom_minor_lights + entity_id: light.bathroom_lights diff --git a/automations/files/bathroom-shower-motion.yaml b/automations/files/bathroom-shower-motion.yaml index ccfb6b8..7cd6194 100644 --- a/automations/files/bathroom-shower-motion.yaml +++ b/automations/files/bathroom-shower-motion.yaml @@ -8,11 +8,7 @@ to: 'on' action: - service: light.turn_on - entity_id: - - light.shower_1 - - light.shower_2 - - light.shower_3 - - light.shower_4 + entity_id: shower_lights - id: bathroom-shower-motion-off alias: '[Bathroom] Shower Motion Off' mode: restart @@ -24,8 +20,4 @@ to: 'off' action: - service: light.turn_off - entity_id: - - light.shower_1 - - light.shower_2 - - light.shower_3 - - light.shower_4 + entity_id: shower_lights diff --git a/automations/files/bedroom-button.yaml b/automations/files/bedroom-button.yaml index bfc4772..440753f 100644 --- a/automations/files/bedroom-button.yaml +++ b/automations/files/bedroom-button.yaml @@ -7,7 +7,7 @@ platform: device type: remote_button_short_press subtype: turn_on - condition: [] + condition: [ ] action: - service: light.turn_on data: @@ -18,12 +18,12 @@ - id: bedroom-button-turn-off alias: '[Bedroom] Button Turn Off' trigger: - - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f - domain: zha - platform: device - type: remote_button_short_press - subtype: turn_off - condition: [] + - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f + domain: zha + platform: device + type: remote_button_short_press + subtype: turn_off + condition: [ ] action: - service: light.turn_off data: @@ -34,71 +34,63 @@ - id: bedroom-button-dim-up alias: '[Bedroom] Button Dim Up' trigger: - - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f - domain: zha - platform: device - type: remote_button_short_press - subtype: dim_up - condition: [] + - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f + domain: zha + platform: device + type: remote_button_short_press + subtype: dim_up + condition: [ ] action: - service: light.turn_on data: brightness_step_pct: 10 - entity_id: - - light.bedroom_1 - - light.bedroom_2 + entity_id: light.bedroom_lights mode: single - id: bedroom-button-dim-down alias: '[Bedroom] Button Dim Up' trigger: - - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f - domain: zha - platform: device - type: remote_button_short_press - subtype: dim_down - condition: [] + - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f + domain: zha + platform: device + type: remote_button_short_press + subtype: dim_down + condition: [ ] action: - service: light.turn_on data: brightness_step_pct: -10 - entity_id: - - light.bedroom_1 - - light.bedroom_2 + entity_id: light.bedroom_lights mode: single # Double click - id: bedroom-button-dim-up-double alias: '[Bedroom] Button Dim Up' trigger: - - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f - domain: zha - platform: device - type: remote_button_double_press - subtype: dim_up - condition: [] + - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f + domain: zha + platform: device + type: remote_button_double_press + subtype: dim_up + condition: [ ] action: - service: light.turn_on data: brightness_pct: 90 kelvin: 3200 - entity_id: - - light.bedroom_1 - - light.bedroom_2 + entity_id: light.bedroom_lights mode: single - id: bedroom-button-dim-down-double alias: '[Bedroom] Button Dim Up' trigger: - - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f - domain: zha - platform: device - type: remote_button_double_press - subtype: dim_down - condition: [] + - device_id: 15b083b6b5e2acb5d37fbbfbfc76281f + domain: zha + platform: device + type: remote_button_double_press + subtype: dim_down + condition: [ ] action: - service: light.turn_on data: brightness_pct: 10 kelvin: 2000 - entity_id: - - light.bedroom_1 - - light.bedroom_2 + entity_id: light.bedroom_lights mode: single \ No newline at end of file diff --git a/automations/files/bedroom-humidifier.yaml b/automations/files/bedroom-humidifier.yaml index c9469d6..edd541f 100644 --- a/automations/files/bedroom-humidifier.yaml +++ b/automations/files/bedroom-humidifier.yaml @@ -28,7 +28,6 @@ - platform: state entity_id: binary_sensor.bedroom_window_open_close to: 'on' - condition: [] action: - service: switch.turn_off entity_id: switch.humidifier_plug diff --git a/automations/files/tv.yaml b/automations/files/behaviour-tv.yaml similarity index 93% rename from automations/files/tv.yaml rename to automations/files/behaviour-tv.yaml index b01ff78..980f2ca 100644 --- a/automations/files/tv.yaml +++ b/automations/files/behaviour-tv.yaml @@ -1,5 +1,5 @@ - id: tv_morning - alias: Morning TV turn off + alias: '[Behaviour] Morning TV turn off' description: '' trigger: - platform: state diff --git a/automations/files/computer-button.yaml b/automations/files/computer-button.yaml index 539ba0f..41cb539 100644 --- a/automations/files/computer-button.yaml +++ b/automations/files/computer-button.yaml @@ -6,7 +6,6 @@ platform: device type: remote_button_short_press subtype: turn_on - condition: [] action: - service: light.turn_on data: @@ -20,7 +19,6 @@ platform: device type: remote_button_short_press subtype: turn_off - condition: [] action: - service: light.turn_off data: @@ -34,14 +32,10 @@ event_data: device_id: 5b972523e427721ec88e095994f7cc16 command: move_with_on_off - condition: [] action: - service: light.turn_on data: - entity_id: - - light.tv_left - - light.tv_middle - - light.tv_right + entity_id: light.tv_lights mode: single - id: button-computer-cave-hold-off alias: '[Computer Cave] Button Hold Off' @@ -54,12 +48,8 @@ args: - 1 - 83 - condition: [] action: - service: light.turn_off data: - entity_id: - - light.tv_left - - light.tv_middle - - light.tv_right + entity_id: light.tv_lights mode: single \ No newline at end of file diff --git a/automations/files/computer-lights.yaml b/automations/files/computer-lights.yaml index 407a3bf..278e36d 100644 --- a/automations/files/computer-lights.yaml +++ b/automations/files/computer-lights.yaml @@ -12,7 +12,6 @@ - service: light.turn_off data: {} entity_id: - - light.computer_left - - light.computer_right + - light.computer_lights - light.desk_lamp mode: single \ No newline at end of file diff --git a/automations/files/goto-sleep.yaml b/automations/files/goto-sleep.yaml index 1c120b7..a4b8789 100644 --- a/automations/files/goto-sleep.yaml +++ b/automations/files/goto-sleep.yaml @@ -24,9 +24,7 @@ - 255 - 0 - 0 - entity_id: - - light.computer_left - - light.computer_right + entity_id: light.computer_lights - delay: '0:05:00' - condition: state entity_id: binary_sensor.desktop diff --git a/automations/files/hallway-doorbel.yaml b/automations/files/hallway-doorbel.yaml new file mode 100644 index 0000000..de1564f --- /dev/null +++ b/automations/files/hallway-doorbel.yaml @@ -0,0 +1,41 @@ +- id: hallway-doorbell + alias: '[Hallway] Doorbell' + mode: restart + trigger: + - platform: state + entity_id: switch.doorbell_switch + from: 'off' + to: 'on' + action: + - service: light.turn_on + data: + brightness: 200 + rgb_color: + - 49 + - 27 + - 146 + entity_id: light.computer_lights + - service: light.turn_on + data: + flash: long + brightness: 200 + rgb_color: + - 49 + - 27 + - 146 + entity_id: light.computer_lights + - delay: '30' + - service: light.turn_off + entity_id: light.computer_lights +- id: hallway-doorbell-burn-prevention + alias: '[Hallway] Doorbell burn prevention' + mode: restart + trigger: + - platform: state + entity_id: switch.doorbell_switch + from: 'off' + to: 'on' + action: + - delay: '2' + - service: switch.turn_off + entity_id: switch.doorbell_switch \ No newline at end of file diff --git a/automations/files/kitchen-button.yaml b/automations/files/kitchen-button.yaml index 4b8f870..f94a7df 100644 --- a/automations/files/kitchen-button.yaml +++ b/automations/files/kitchen-button.yaml @@ -38,21 +38,7 @@ action: - service: light.turn_on data: - entity_id: - - light.kitchen_01 - - light.kitchen_02 - - light.kitchen_03 - - light.kitchen_04 - - light.kitchen_05 - - light.kitchen_06 - - light.kitchen_07 - - light.kitchen_08 - - light.kitchen_09 - - light.kitchen_10 - - light.kitchen_11 - - light.kitchen_12 - - light.kitchen_13 - - light.kitchen_14 + entity_id: light.kitchen_lights mode: single - id: button-kitchen-hold-off alias: '[Kitchen] Button Hold Off' @@ -69,19 +55,5 @@ action: - service: light.turn_off data: - entity_id: - - light.kitchen_01 - - light.kitchen_02 - - light.kitchen_03 - - light.kitchen_04 - - light.kitchen_05 - - light.kitchen_06 - - light.kitchen_07 - - light.kitchen_08 - - light.kitchen_09 - - light.kitchen_10 - - light.kitchen_11 - - light.kitchen_12 - - light.kitchen_13 - - light.kitchen_14 + entity_id: light.kitchen_lights mode: single \ No newline at end of file diff --git a/automations/files/modes.yaml b/automations/files/modes.yaml index e13c456..6568eef 100644 --- a/automations/files/modes.yaml +++ b/automations/files/modes.yaml @@ -1,6 +1,5 @@ - id: sleep_on alias: Turn on sleep time - description: '' trigger: - platform: time at: input_datetime.sleep_mode @@ -12,7 +11,6 @@ mode: single - id: sleep_off alias: Turn off sleep time - description: '' trigger: - platform: time at: input_datetime.day_mode diff --git a/automations/files/daily.yaml b/automations/files/work-daily.yaml similarity index 72% rename from automations/files/daily.yaml rename to automations/files/work-daily.yaml index c483b64..061fab8 100644 --- a/automations/files/daily.yaml +++ b/automations/files/work-daily.yaml @@ -1,5 +1,5 @@ - id: daily - alias: Daily notificaion + alias: '[Work] Daily notification' trigger: - platform: time at: '10:55' @@ -19,9 +19,7 @@ - 0 - 0 - 255 - entity_id: - - light.computer_left - - light.computer_right + entity_id: light.computer_lights - service: light.turn_on data: flash: long @@ -30,13 +28,11 @@ - 0 - 0 - 255 - entity_id: - - light.computer_left - - light.computer_right + entity_id: light.computer_lights mode: single - id: daily_off - alias: Daily notificaion off + alias: '[Work] Daily notification off' trigger: - platform: time at: '11:25' @@ -58,13 +54,9 @@ - service: light.turn_on data: kelvin: 3200 - entity_id: - - light.computer_left - - light.computer_right + entity_id: light.computer_lights - delay: 5 - service: light.turn_off - entity_id: - - light.computer_left - - light.computer_right + entity_id: light.computer_lights mode: single diff --git a/automations/files/finished-work.yaml b/automations/files/work-finished.yaml similarity index 68% rename from automations/files/finished-work.yaml rename to automations/files/work-finished.yaml index 9b2aa49..cbd5e4a 100644 --- a/automations/files/finished-work.yaml +++ b/automations/files/work-finished.yaml @@ -1,5 +1,5 @@ - id: work_finished - alias: Notify when finished work + alias: '[Work] Notify when finished work' description: '' trigger: - platform: state @@ -7,7 +7,6 @@ to: 'on' for: hours: 8 - condition: [] action: - service: light.turn_on data: @@ -16,9 +15,7 @@ - 0 - 200 - 83 - entity_id: - - light.computer_left - - light.computer_right + entity_id: light.computer_lights - service: light.turn_on data: flash: long @@ -27,7 +24,5 @@ - 0 - 200 - 83 - entity_id: - - light.computer_left - - light.computer_right + entity_id: light.computer_lights mode: single