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