From c43c1251c98eb91b811cc631e5bd58dd1fe541f6 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 6 Jun 2024 06:00:05 +0400 Subject: office power management optimization and some fixes --- automations.yaml | 77 +++++++++++++++++++++++++++++++------- custom/scripts/sleep-and-wake.yaml | 7 +++- scripts.yaml | 4 +- 3 files changed, 72 insertions(+), 16 deletions(-) diff --git a/automations.yaml b/automations.yaml index 66cfe12..f661b33 100644 --- a/automations.yaml +++ b/automations.yaml @@ -80,11 +80,11 @@ id: Long sequence: - type: turn_off - device_id: 04c6f563c006599ed7754aba652654ae + device_id: ad2aac96e3377b6e1f336d194b7ba792 entity_id: switch.bathroom_lights_left domain: switch - type: turn_off - device_id: 04c6f563c006599ed7754aba652654ae + device_id: ad2aac96e3377b6e1f336d194b7ba792 entity_id: switch.bathroom_lights_center domain: switch - if: @@ -874,9 +874,14 @@ entity_id: switch.living_tablelampsocket else: - if: - - condition: state - entity_id: switch.smart_power_strip_pro_socket_2 - state: 'off' + - condition: or + conditions: + - condition: state + entity_id: switch.smart_power_strip_pro_socket_2 + state: 'off' + - condition: state + entity_id: switch.office_table + state: unavailable then: - parallel: - service: script.sleep_and_wake @@ -890,10 +895,12 @@ below: '5' then: - service: script.turn_on_office_lights - data: {} + data: + temperature: 4000 else: - service: script.turn_on_office_lights - data: {} + data: + temperature: 4000 off_click: - service: switch.turn_on data: {} @@ -908,6 +915,7 @@ - service: switch.turn_off target: entity_id: switch.living_tablelampsocket + data: {} - service: homeassistant.toggle data: {} target: @@ -916,9 +924,14 @@ hold: [] longclick: - if: - - condition: state - entity_id: switch.smart_power_strip_pro_socket_2 - state: 'off' + - condition: or + conditions: + - condition: state + entity_id: switch.smart_power_strip_pro_socket_2 + state: 'off' + - condition: state + entity_id: switch.office_table + state: unavailable then: - service: script.sleep_and_wake data: @@ -950,7 +963,7 @@ target: entity_id: input_button.button_confirm data: {} - temperature: 4500 + temperature: 4000 on_light: 'no' - id: '1672991247298' alias: 'Living: Light Sync' @@ -980,7 +993,7 @@ motion_entity: binary_sensor.motions_kitchen illumination_test: sensor illuminance_entity: sensor.kitchen_motions_illuminance_lux - lux_threshold: 60 + lux_threshold: 80 - id: '1673037015865' alias: 'Motions: Night Light' description: '' @@ -1308,7 +1321,7 @@ occupancy: input_boolean.occupancy_bathroom on_action: - type: turn_on - device_id: 04c6f563c006599ed7754aba652654ae + device_id: ad2aac96e3377b6e1f336d194b7ba792 entity_id: switch.bathroom_lights_left domain: switch reentry_wait: 5 @@ -1359,6 +1372,7 @@ entity_id: switch.living_tablelampsocket data: {} default: [] + sven_volume: true - id: '1674510035217' alias: 'Network: Backup' description: '' @@ -2066,3 +2080,40 @@ entity_id: switch.plugs_infrastructure default: [] mode: single +- id: '1692504962359' + alias: Alarm/Power + description: '' + trigger: + - platform: state + entity_id: + - switch.smart_power_strip_pro_socket_1 + to: unavailable + for: + hours: 0 + minutes: 10 + seconds: 0 + - platform: state + entity_id: + - switch.smart_power_strip_pro_socket_1 + to: 'off' + for: + hours: 0 + minutes: 5 + seconds: 0 + - platform: state + entity_id: + - switch.office_smartpi + to: 'off' + for: + hours: 0 + minutes: 5 + seconds: 0 + condition: [] + action: + - service: notify.mobile_app_lm_g810 + data: + message: SmartPI out of power + - service: notify.smartpi + data: + message: SmartPI out of power + mode: single diff --git a/custom/scripts/sleep-and-wake.yaml b/custom/scripts/sleep-and-wake.yaml index 0fe478d..a430515 100644 --- a/custom/scripts/sleep-and-wake.yaml +++ b/custom/scripts/sleep-and-wake.yaml @@ -61,6 +61,9 @@ sleep_and_wake: # - service: switch.turn_off # target: # entity_id: switch.plugs_office + - service: scene.turn_on + target: + entity_id: scene.lg_aircon_power_off - service: switch.turn_off target: entity_id: switch.smart_power_strip_pro_socket_2 @@ -81,7 +84,9 @@ sleep_and_wake: - parallel: - service: switch.turn_on target: - entity_id: switch.plugs_office + entity_id: + - switch.plugs_office + - switch.smart_power_strip_pro_socket_2 - service: wake_on_lan.send_magic_packet data: mac: "e8:6a:64:7b:5d:0a" diff --git a/scripts.yaml b/scripts.yaml index e43517d..8011f96 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -95,8 +95,8 @@ kodi_sleep: target: entity_id: media_player.smartpi mode: single -turn_on_office_lights: - alias: turn_on_office_lights +turn_on_office_lights_v1: + alias: turn_on_office_lights_v1 sequence: - parallel: - service: light.turn_on -- cgit v1.2.3