From f9fb460fb68946c068652a5358ac4163440630e2 Mon Sep 17 00:00:00 2001 From: 31c0fe9c6dbd74bcdde92e1d2aaa03e1d272f75f Date: Fri, 20 May 2022 08:25:54 +1000 Subject: [PATCH] Home Assistant Git Exporter --- config/packages/offices.yaml | 2 +- config/packages/presence.yaml | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/config/packages/offices.yaml b/config/packages/offices.yaml index 2fc81e2..8caf2f7 100644 --- a/config/packages/offices.yaml +++ b/config/packages/offices.yaml @@ -28,7 +28,7 @@ automation: area_id: bo_s_office - service: switch.turn_on target: - entity_id: switch.bo_s_office_plug + area_id: bo_s_office - id: 2804db52f34458004191f589ed3453dd6f9e1f45 alias: Warm up Bo's office heater diff --git a/config/packages/presence.yaml b/config/packages/presence.yaml index dc19eb6..9a6fea6 100644 --- a/config/packages/presence.yaml +++ b/config/packages/presence.yaml @@ -114,11 +114,30 @@ template: - unknown for: seconds: 5 + - platform: state + entity_id: + - binary_sensor.bo_s_office_pir_2_occupancy + - binary_sensor.bo_s_office_motion + - binary_sensor.ri_s_office_occupancy + to: "on" + - platform: state + entity_id: + - binary_sensor.bo_s_office_pir_2_occupancy + - binary_sensor.bo_s_office_motion + - binary_sensor.ri_s_office_occupancy + to: "off" + for: + minutes: 1 binary_sensor: - unique_id: bos_office_is_occupied name: Bo's Office Is Occupied state: | - {{ is_state('sensor.template_room_bo_phone', 'bo_s_office') or is_state('sensor.template_room_ri_phone', 'bo_s_office') }} + {{ + is_state('sensor.template_room_bo_phone', 'bo_s_office') + or is_state('sensor.template_room_ri_phone', 'bo_s_office') + or is_state('binary_sensor.bo_s_office_pir_2_occupancy', 'on') + or is_state('binary_sensor.bo_s_office_motion', 'on') + }} icon: | {% if is_state("binary_sensor.bo_s_office_is_occupied", "on") %} mdi:account @@ -130,7 +149,10 @@ template: - unique_id: ris_office_is_occupied name: Ri's Office Is Occupied state: | - {{ is_state('sensor.template_room_bo_phone', 'ri_s_office') or is_state('sensor.template_room_ri_phone', 'ri_s_office') }} + {{ is_state('sensor.template_room_bo_phone', 'ri_s_office') + or is_state('sensor.template_room_ri_phone', 'ri_s_office') + or is_state('binary_sensor.ri_s_office_occupancy', 'on') + }} icon: | {% if is_state("binary_sensor.ri_s_office_is_occupied", "on") %} mdi:account