Home / Not Home / Work

Hello Again everyone!

I have another quick question. I have 2 zones: Home and Work. When I am at home my state is “home”, however when I am in the “work” zone, my state shows as “not_home”. Is that working as expected? Secondly, am I correct to assume that if I do want to change that I would need to use an automation to do that? Something like:

- alias: megan_work
  initial_state: 'off'
  trigger:
    - platform: zone
      entity_id: device_tracker.me
      zone: zone.work
      event: enter
  action:
    service: device_tracker.see
    data:
      dev_id: device_tracker.me
      location_name: 'work'

Is that right, or am I missing something? Thanks again for any help someone could provide.

If you have a properly defined “work” zone, and your device tracker properly identifies you as in that zone, the location will automatically change to indicate your presence in that zone.

The zone should appear on the map, and your icon should appear near or in that zone (except the home zone where your icon disappears). If it’s not working that way, try increasing the radius on the work zone.

Hmmm…yeah I tried that…not working. Here’s my config (maybe I have done something wrong).

From configuration.yaml

zone: !include_dir_list zones

From zones/megan_work.yaml

name: 'The Office'
latitude: [REDACTED]
longitude: [REDACTED]
icon: mdi:briefcase

Both “The Office” and Home are showing on the map. I see from the lat/lon that they are within the zone for work.

Thanks for replying and taking a look at this issue :slight_smile:

The individual devices will show the actual zone they’re in, or ‘away’ if the device is not in a predefined zone.

The group ‘device tracker’ will show ‘home’ if one device or more is home, or ‘not_home’ if all devices are elsewhere.

So, right now I’m using

device_tracker.my_iphone

what should I be using?

(appreciate the help, sorry I’m in total n00b mode)

What is your device tracker? Owntrack? I had similar issues when I had both nmap_tracker and owntrack configured. Now I am using only owntrack for the family member devices and only use nmap for guest devices. It is working properly for me. You do not need that automation.

If you use owntrack, are you sure that you can communicate with your mqtt server from outside of your home network?

I believe we need more information from you to solve this.

Again, it is working properly for me, you can check out my config here: https://github.com/tiszavolgyi/home-assistant

^what he said. If you are using multiple trackers on the same device it’ll behave like a group.

If you are just using owntracks, then that device id will be correct.

Just trying to think of the best way to illustrate this, and the best I can come up with is this screenshot…

Near the top are the two devices, I’m Home, Laura is at Laura’s House.

A few lines below is the group, it’s home because I am. If I drove to Laura’s house now, the two individual trackers would be Laura’s house, but the group would just be Not_home (because it’s only bothered about whether somebody is home or not). In the same way, I could be at my work place, Laura could be at hers. The individual trackers would say our individual work locations, the group will be Not_home.

Hope this helps.

Hi All,

Firstly, thank you all so much for your help!!!

Here’s more info, that I hope will help…

I’m using OwnTracks for presence. Here’s my groups.yaml config (relevant part)

chris:
  name: Chris
  entities:
    - device_tracker.chris_iphone

megan:
  name: Megan
  entities:
    - device_tracker.megan_iphone

family_info:
  name: Family Info
  entities:
    - group.megan
    - group.chris
    - sensor.megan_location_to_home
    - sensor.chris_location_to_home

Here’s a screenshot from the iOS app. You can see it is clearly finding that I’m at Stepping Stone (the zone), however if you look in the top area the panel is showing that I am “not_home”. How can I get the panel to show the zone?

Thoughts?

Chris

Yeah, as stated above, you’ve made a group called Chris and a group called Megan, groups only show home or not home. Try this instead…

Delete the two groups Chris and Megan completely, and set your family info group to:

family_info:
  name: Family Info
  entities:
    - device_tracker.megan_iphone
    - device_tracker.chris_iphone
    - sensor.megan_location_to_home
    - sensor.chris_location_to_home

Profit.

(then change the friendly names to Chris and Megan in customize)

I am not sure why do you need the sensor.megan… part there. What I did and works properly for me is:

1 - Create a group called family info in your case:

 family_info:
   name: Family Info
   entities:
    - device_tracker.megan_iphone
    - device_tracker.chris_iphone

2 - You can give the devices a nice name in known_devices.yaml, something like:

megan_iphone:
    hide_if_away: false
    name: Megan
    picture: /local/megan.jpg
    track: true

3 - setup your zones, I assume you know how to do and the end results would be something like this:

As you can see it knows that I am on a known location called “My Zone 2”, my wife is not in a zone so her state is “not home”. If I home it shows home… The default group.all_devices only has a “home” and “not home” state which is great for automations… Hope it makes sense.

He’s using the Google travel time sensor to show how long it will take to get from where they are to home.

1 Like

@anon43302295 you were right, that was the issue and your config suggestion worked.

Thanks again everyone for your help.