From 05d306542dec6b14f1a39166e4c0b3aa4fb8ddf2 Mon Sep 17 00:00:00 2001 From: skdw Date: Fri, 24 Jan 2025 23:31:58 +0100 Subject: [PATCH] Document home presence inference --- README.md | 21 +++++++++++++------- automations/automations_enabled_counter.yaml | 18 +---------------- entities/home_presence.yaml | 16 +++++++++++++++ 3 files changed, 31 insertions(+), 24 deletions(-) create mode 100644 entities/home_presence.yaml diff --git a/README.md b/README.md index fb758d4..36bca36 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,14 @@ Dashboards are optimized for desktop browser, mobile app and wall panel display. ## Integrations - [Matter](https://www.home-assistant.io/integrations/matter) - - Zigbee lights (IKEA, Philips) via Dirigera Hub -- [HomeKit Device](https://www.home-assistant.io/integrations/homekit_controller) - - IKEA Dirigera + - IKEA Dirigera Hub + - Zigbee lights (IKEA, Philips) - Temperature, humidity sensors - - Motion sensors sensors - Door sensors + - Apple Home ([multi fabric](https://www.home-assistant.io/integrations/matter#multi-fabric-join-to-multiple-controllers) provides an independent Dirigera <-> iOS connection) +- [HomeKit Device](https://www.home-assistant.io/integrations/homekit_controller) + - IKEA Dirigera Hub (not yet Matter enabled) + - Motion sensors - Water leakage sensors - [Aqara FP2](https://www.aqara.com/eu/product/presence-sensor-fp2/) - Human presence sensor @@ -32,8 +34,11 @@ Dashboards are optimized for desktop browser, mobile app and wall panel display. - [Spotify](https://www.home-assistant.io/integrations/spotify/) - [Android TV](https://www.home-assistant.io/integrations/androidtv/) - [System Bridge](https://www.home-assistant.io/integrations/system_bridge/) - Windows PC +- [HomeKit Bridge](https://www.home-assistant.io/integrations/homekit/) - HASS entities exposed to Apple Home (complements the Matter service) + - Pioneer home cinema, as Apple media player accessory + - Curtains + - Air quality - [IPP](https://www.home-assistant.io/integrations/ipp/) - Printer -- [HomeKit Bridge](https://www.home-assistant.io/integrations/homekit/) - HASS entities accessible in HomeKit - [OpenAI Conversation](https://www.home-assistant.io/integrations/openai_conversation/) - [Strava](https://github.com/craibo/ha_strava) - exercises tracking - [Electricity Maps](https://www.home-assistant.io/integrations/co2signal/) - CO2 intensity of home energy @@ -56,18 +61,20 @@ The card is illustrated in the image: ![screenshot_card_scenes](image/screenshot Actions are designed to be triggered manually by the user upon entering or leaving the home as part of their daily routine. The system detects whether the user intends to enter or exit the apartment, consolidating both actions into a single button for convenience. - **Welcome Home** - - *Condition: no home devices are active (indicating the user is outside home)* + - *Condition: no home switches\* are active (indicating the user is outside home)* - Sets the lighting scene based on the time of day - Between 9 PM and 5 AM, activates the **Lights evening** scene - If the sun's elevation is below 5°, activates the **Lights dinner** scene - Otherwise, skips the lighting adjustment (daytime) - Transfers media playback to the home media player - **Leave Home** - - *Condition: one or more home devices are active (indicating the user is at home)* + - *Condition: one or more home switches\* are active (indicating the user is at home)* - Turns all the home lights off - Transfers media playback to the mobile device, allowing the continuation of the track outside the home - Turns the media player off +\* Enabled switches counter tracks states of the entities listed in [entities/home_presence.yaml](entities/home_presence.yaml). The list includes selected light switches and media players. If at least one entity is active, we infer home presence. Hall lights are intentionally excluded from the list as they are activated both upon entering and leaving the home. + #### Lights scenes The middle section of the card lists the available home lighting scenes, arranged from the brightest to the dimmest. These scenes can also be activated by **triple-clicking** the corresponding control on the physical six-button switch in the living room, ordered from left to right. diff --git a/automations/automations_enabled_counter.yaml b/automations/automations_enabled_counter.yaml index 15331b0..7594636 100644 --- a/automations/automations_enabled_counter.yaml +++ b/automations/automations_enabled_counter.yaml @@ -5,23 +5,7 @@ max: 50 trigger: - platform: state - entity_id: - #- switch.living_room_l1 - skip hall light - - switch.living_room_l2 - - switch.living_room_l3 - - switch.living_room_l4 - - switch.living_room_l5 - - switch.living_room_l6 - - switch.bathroom_l1 - - switch.bathroom_l2 - - switch.balcony_l1 - - switch.balcony_l2 - - switch.wardrobe - - switch.bedroom_ceiling - - switch.bedroom_reading_left - - switch.bedroom_reading_right - - media_player.pioneer_onkyo - - media_player.pioneer_onkyo_zone_2 + entity_id: !include ../entities/home_presence.yaml condition: "{{ trigger.from_state.state != trigger.to_state.state and trigger.from_state.state in ['off', 'on'] and trigger.to_state.state in ['off', 'on'] }}" action: - action: "{{ 'counter.decrement' if trigger.to_state.state == 'off' else 'counter.increment' }}" diff --git a/entities/home_presence.yaml b/entities/home_presence.yaml new file mode 100644 index 0000000..a752c0f --- /dev/null +++ b/entities/home_presence.yaml @@ -0,0 +1,16 @@ +#- switch.living_room_l1 - skip hall light +- switch.living_room_l2 +- switch.living_room_l3 +- switch.living_room_l4 +- switch.living_room_l5 +- switch.living_room_l6 +- switch.bathroom_l1 +- switch.bathroom_l2 +- switch.balcony_l1 +- switch.balcony_l2 +- switch.wardrobe +- switch.bedroom_ceiling +- switch.bedroom_reading_left +- switch.bedroom_reading_right +- media_player.pioneer_onkyo +- media_player.pioneer_onkyo_zone_2