Hi, I use several methods for device_tracker (room-assistant tracking phone, HA mobile app on phone and tablet).
If I leave house with only my phone, it will not flip to Away as tablet is At Home. Similarly if I leave with all devices, even though some of them flip to Away fairly quickly (ie bluetooth/nmap/openwrt trackers), the whole HA status will only flip to Away after the last one of them (mobile app tracking) flips to Away.
Is there a way to invert this behaviour? I.e. as soon as one of the configured trackers goes Away + consider_home duration the whole system will flip to Away. I get the default is probably so that if one device runs out of battery or goes to sleep for a bit it doesn’t set the whole system to Away, but I thought I could play with the consider_home to work around this.
Reason why I’d like this is my work is 10minutes from my home and sometimes the status flips to Work (via mobile app gps tracking) before it flips to Away, despite some trackers being Away as soon as I leave front door.
I think this might be what you’re asking for: Group - Home Assistant (home-assistant.io)
Note the “all” option. Set that to true and it should invert the behavior.
Hmm, that would give me a group that would behave as I’d want, but how would I go about using the group as a “sensor” for presence tracking? Because in configuration / people / my user it only lets me pick entities from device_tracker domain.
Here’s an automation I’m using that tells me if there’s motion upstairs when we’re not home. (My “family sensor” operates the usual way, not the “all” way yours would, but this is how I use it.)
Here’s the config for my “family_sensor” on Lovelace.
It shows me whether no one is at home, someone is at home, or we’re all home.
You can use the status of this sensor in automations, etc.
- platform: template
sensors:
family_sensor:
value_template: >-
{% set items = states.person %}
{% set all = items|length %}
{% set home = items|map(attribute="state")|select("equalto","home")|list|length %}
{{ "none home" if home == 0 else "all home" if home == all else "some home" }}
icon_template: >-
{% if is_state('family_sensor', 'none') %}
mdi:home-circle-outline
{% else %}
mdi:home-circle
{% endif %}