Multiple state with multiple known_devices using device_tracker and iOS app

hi,
I have a idea to implement tracking myself with Homeassistant.
I deploy Homeassistant at home and installed IOS app on my iPhone.
I have a Asus router.
This is what I want to implement:
using device_tracker: asuswrt and IOS app to track my state with HOME and WORK.
I have two known_devices to represent me. If I set both device to track: true. I get two Icons on my Homepage. AFAIK, if I group those two devices, I only get HOME and NOT_HOME.
Is it possible to track my location with multiple devices?

this is what I’ve done, I have an automation that publishes a state to MQTT whenever one of my device tracker changes.
And my “grouped” device is the topic on MQTT that I publish to.
I don’t have access to my code here (at work) but can send tonight if you’re interested…

1 Like

many thanks! It would be a great help! I think this may be helpful to others too.

The state of the group will only be home or not, but the state of the individual tracker will be the zone it is in (when it is in a zone, of course).

No workarounds are required.

If an automation requires to know which zone you are in, use the state of the tracker. If an automation requires only to know if someone is home, use the state of the group.

If one didn’t use MQTT, couldn’t they do the same with an input_select?

Yes I suppose it’s possible, though I probably would use a text input instead. I’m not sure how a select input would react at an attempt to set it to an option that didn’t exist…

You could do it with a template sensor.

This is what I do to combine wifi and gps location.

platform: template
  sensors:
    mike_home:
      value_template: |
        {% if is_state("device_tracker.phone_mike", "home") or is_state("device_tracker.wifi_mike", "home" ) %}home{% else %}away{% endif %}

You’d just need to change the {% if %} to have other conditions and write out home/work/away. Then you don’t need to deal with other automations to change an input_select

{% if is_state('device_tracker.asus_phone', 'work') %}Work{% elif is_state('device_tracker.asus_phone', 'home') and is_state('device_tracker.gps_phone', 'home') %}Home{% endif %}

Just expand it out to meet all your conditions.