Issues with presence detection. Zones and HomeAssistant APP

I’m currently using/combining 2 types of presence detection for my family to automate stuff.

Unifi integration to detect if devices are connected to my network (Playstation, PC, Laptop, Phone, Tablet)
HomeAssistant (iOS) installed on mobile phones.

When none of these devices are connected to the home network and the app is not in the home zone, devices and lights get switched off. And when one of these come online or are home, the devices get switched back on for use.

There are 2 issues:
1.
When a person is in a zone other than home, the state is not “not_home” and the automation isn’t triggered. The delay between leaving the (huge) home zone and arriving at school isn’t large enough to firstly become “not_home” and the state switches from home to school.

I also use this same automation to trigger a power down at night. Since the phones get switched off they dropped of the network and hence not_home got triggered. Since adding the app, the state of the person isn’t changed to say: unavailable but it remains at home since that’s the last location and it hasn’t changed.

What is the best route to take…
Remove the device tracker generated by the app from the person and don’t use that anymore for these kinds of automations?
Or are there smarter ways to do this?

- id: '1631697673089'
  alias: When Kid1 is away turn off PC
  description: ''
  trigger:
  - platform: state
    entity_id: person.kid1
    from: home
    to: not_home
  condition:
  - condition: numeric_state
    entity_id: sensor.pc_kid_current_consumption
    below: '3'
  - condition: device
    type: is_on
    device_id: cbf6769469a1c25b9902d52581e8a9c8
    entity_id: switch.pc_kid
    domain: switch
  action:
  - type: turn_off
    device_id: cbf6769469a1c25b9902d52581e8a9c8
    entity_id: switch.pc_kid
    domain: switch
  mode: single

Could you maybe modify your trigger as follows so that it fires whenever the state changes from home to something else i.e. not_home, school, or whatever?

image

Issue 1: I think I would make my “Home” zone smaller and continue to use not_home as a trigger or state etc.

Issue 2: Personally I would use something else as the trigger for the nightly power down, any device being shut down, motion sensor, door sensor, smart speaker command etc

I’ve tried this… does not fire :frowning:

  1. Home zone cannot be made smaller (yet), or did I miss a memo?
  2. The issue is, that I have kids and a wife. They don’t follow the rules :slight_smile:
    So the best option imho is to shut things down when their most used devices are all down from the network e.g. away.
    The issue is more that the Home Assistant app does not do anything with the location when it’s powered off. And it shows the last known location.

I think I’m just going to remove the APP presence from the person.

The radius of the home zone can be changed in customisations if it helps :wink:

1 Like