Multiple 'home' zones

I wanted to suggest the option to include the possibility to have multiple home zones instead of just one. The current limitation of being in one zone only causes issues for which workarounds are possible but could be easily solved.

Concretely:

  • optional parameter in the zone definition (e.g. something like homezone: true
  • for those zones, the state is ‘home’ when a device is detected in it. An attribute value indicates which zone exactly.
  • for zones who don’t have this parameter, the current behavior remains.

The above is backwards compatible and allows the continued use of a group that combines the state of all devices, allowing easy home / not_home automations.

The attribute of the specific device then allows automations for the specific zone.

Obviously, I am thinking of creating beacon zones in my home.

Currently, the ibeacon with low range broadcast next to my bed that is supposed to indicate that I am sleeping makes that I am no longer in zone ‘home’ for owntracks. Which means that as soon as something goes wrong with my NMAP device tracker (after the consider_home delay), the group in which both belong goes into status not_home.

Right now, when

I guess we can consider this another vote for multiple home zones although my use case and my request are different than above.

I am part of a distributed family. My Home Assistant instance uses Owntracks for device tracking of myself, my father, my ex-wife and my son. My father, my ex-wife and I live at 3 different locations. My son sometimes lives with me and sometimes with his mother. I would like to see a capability added such that for each zone I define in zones.yaml - I can also add a ‘home’ attribute and specify (multiple) entity_id’s that should consider that zone to be ‘Home’. Suspend the disbelief for a minute that my ex-wife allows me to track her and consider a zones.yaml that looks like the following. The concept of a single “home” zone would be eliminated and more real world scenarios could be addressed with this change. Automations that use an “is home” function would need to use this new information in zones.yaml to determine where “home” is for any given device_tracker entity.

I’m sure that I’m not the only one who is tracking friends or family that live elsewhere - and although this enhancement doesn’t seem to be something that lots of people are asking for - once created, I think it would be widely used. Even if not used in automations - the badges in the main UI could correctly display ‘Home’ for each person who IS actually at their respective homes - and that alone is enough reason to do this!

- name: tenly's house
  latitude: !secret tenlys_latitude
  longitude: !secret tenlys_longitude
  radius: 100
  friendly_name: Tenly's
  icon: mdi:home-variant
  home:
    - entity_id: device_tracker.tenly
    - entity_id: device_tracker.tenlys_son

- name: tenly's exwife
  latitude: !secret tenlys_exwife_latitude
  longitude: !secret tenlys_exwife_longitude
  radius: 100
  friendly_name: Ex Wife's
  icon: mdi:home-variant
  home:
    - entity_id: device_tracker.tenlys_exwife
    - entity_id: device_tracker.tenlys_son

- name: Tenly's Dad
  latitude: !secret tenlys_dad_latitude
  longitude: !secret tenlys_dad_longitude
  radius: 150
  friendly_name: Dad's
  icon: mdi:mdi-hotel
  home:
    - entity_id: device_tracker.tenlys_dad

Thanks in advance for any consideration the developers give to this request.

Look on the forums for the python script set state,
Here is the latest version from the author
https://raw.githubusercontent.com/rodpayne/home-assistant/main/.homeassistant/python_scripts/set_state.py

Create an automation on your phone device tracker that says when state is zone Home2, run set state to update person.you to ‘home’
Personally i think using one ha for multiple buildings is not ideal unless you are tracking area occupancy

I just use this because i run a cloud HA for all cloud connected integrations and just want my phone updating one HA, i then sync each entity that’s relevent at each physical building with remote home assistant.
This will still do what you want


description: ""
trigger:
  - platform: state
    entity_id:
      - device_tracker.phone
condition:
  - condition: state
    entity_id: device_tracker.phone
    state: Home2
action:
  - service: python_script.set_state
    data:
      entity_id: person.you
      state: home
mode: single