Ios tracking not showing up in group

Currently I have tracking via bluetooth and nmap. I take my devices and have two groups, one for my wife and one for myself. I’ve now installed the home assistant app and I’m trying to add the tracking that it offers to that group as well to improve presence detection.

The problem I’m having is that despite each phone getting a new known_device in the known_devices file and me adding that device to the group that I have in place, it’s never showing in that group.

Based on what I’m seeing, I THINK that the new known device is getting grouped in with my current nmap tracking, but I have no way to be sure (I suspect this because nmap is now refusing to be marked as away when this wasn’t an issue before I started setting this up). Can anyone help with what I’m missing? Below are some examples using just my phone (not my wife’s settings which are just identical to what I’m doing for my phone).

Thanks in advance for the help!

ios config entry (autofilled):

"ChrisiPhone": {
            "app": {
                "buildNumber": 10,
                "bundleIdentifer": "io.robbie.HomeAssistant",
                "versionNumber": "1.1.1"
            },
            "battery": {
                "level": 98,
                "state": "Unplugged"
            },
            "device": {
                "localizedModel": "iPhone",
                "model": "iPhone",
                "name": "iPhone",
                "permanentID": "710B1C6B-A4FA-4F7F-9551-B6B27F0A2E68",
                "systemName": "iOS",
                "systemVersion": "11.4.1",
                "type": "iPhone 7"
            },
            "deviceId": "ChrisiPhone",
            "lastSeenAt": "2018-08-31T09:24:47.867672",
            "permissions": [
                "notifications",
                "location"
            ],
            "pushId": "ccbc0c9c-5bde-3534-b3f0-b1df2f80a530",
            "pushSounds": [],
            "pushToken": "This space intentionally left blank"
        }

known_devices entry (this was auto-detected. The third entry is the new one, other two were pre-existing):

#Chris
78886d46fdf9:
  hide_if_away: false
  icon:
  mac: 78:88:6D:46:FD:F9
  name: Chris_nmap
  picture:
  track: true

Christopher_bluetoothTracking:
  hide_if_away: false
  icon:
  mac: BT_78:88:6D:46:FD:FA
  name: Chris_Bluetooth
  picture:
  track: true
  
chrisiphone:
  hide_if_away: false
  icon:
  mac:
  name: chrisiphone
  picture:
  track: true

groups entry (existing, just added the third tracker):

Christopher: 
  name: Christopher
  entities:
    - device_tracker.Christopher_bluetoothTracking
    - device_tracker.78886d46fdf9
    - device_tracker.chrisiphonee

What do you mean by, “it’s never showing in that group”? If you look at the group on the States page, does it list all three device_tracker entities?

And does device_tracker.chrisiphone show up on the States page? Does its state change as you’d expect?

I guess it would help if you were a little more explicit about what you’re seeing, any errors, etc., and what exactly it’s doing or not doing vs what you expect.

Hey, thanks for the reply. The issue is that the new entity is not showing up in the group. The two pre-existing entities do, the third does not.

That being said, the nmap entity now no longer goes to away if I turn off WiFi. My suspicion is that home asssistant is being included with it since it uses geofencing it never goes away unless you physically leave. The problem is I don’t know why this happens or why it would group the two. If you physically leave the house it will go away.

I think I just noticed a typo in your group:

    - device_tracker.chrisiphonee

should probably be:

    - device_tracker.chrisiphone

Right?

Any reason for Chrisiphone not having a mac address?

I actually fixed the typo earlier today, no change.

There is no Mac because autodiscovery didn’t add one.

So, please go to the States page and find group.Christopher. What does it show for its entity_id attribute?

Also, do you see device_tracker.chrisiphone listed, as well as the two other device_tracker entities that existed before?

And for all four entities, what are each of their current states?

Lastly, do you see group.all_devices? What is its state, and what is the value of its entity_id attribute?

I had the same thing happen to me once. Trust me, manually punch in the MAC address of that phone.

I just went and tried and it didn’t change anything :confused:

on the states page, interestingly it does show three entries:

“entity_id: device_tracker.christopher_bluetoothtracking,device_tracker.78886d46fdf9,device_tracker.chrisiphone
order: 0
friendly_name: Christopher”

However, on the home page it only shows two.

I do see device_tracker.chrisiphone listed, as well as the other two devices.

Interestingly, the two pre-existing devices have state of home. the new device has a state of not_home despite having the same longitude/latitude of the nmap device.

I do see a group.all_devices. here are the entity_attribute values:
entity_id: device_tracker.c8855076b011,device_tracker.amy_bluetoothtracking,device_tracker.amyiphone,device_tracker.78886d46fdf9,device_tracker.christopher_bluetoothtracking,device_tracker.chrisiphone,device_tracker.ccc07940fb4c,device_tracker.ta0159686_2
order: 8
auto: true
friendly_name: all devices
hidden: true

If the chrisiphone is on your WAN right now, try turning WAN off and see if the cell network will find and display it. I know that sounds weird but I’m just relating what I discovered when I had the same issue,

can you clarify what you mean? Are you suggesting I turn the wan connection for home assistant off (turn off my house internet) or are you suggesting I disconnect my cell phone from my wireless network?

Sorry. I mean, on the chrisiphone, if it has the option of switching from the cell network to your home wifi, try turning the wifi off on the chrisiphone forcing it to connect to the cell network without your home router.

Gotcha, Thanks for the clarification!

so, I gave that a shot, and everything went haywire. I’m not even sure what to make of this, but all of my groups disappeared and a whole bunch of new devices showed up being tracked up top. I have no idea what happened now.

Edit: I’m suddenly getting a lot of errors on the entities config that weren’t there before. This is so weird.

I’m going to sleep on that one.

fair enough.

It looks like it’s the adding of the mac address that did it, but it didn’t trigger anything until I turned off the wifi on my phone.

What happened:
Added mac address to entity
restart HA (no change)
disconnect cell from wifi network
restart HA (all hell breaks loose)

Edit: I can confirm that when I remove the mac address things go back to how they were (two entities showing up rather than 3).

Do you mean that only two of the device_tracker entities are shown on the home page, or in group.Christopher shown on the home page only two of the device_tracker entities are displayed?

Ok, that is really weird. As I understand it, the nmap device, of course, doesn’t know GPS coordinates by itself, so when it sees the device on the network it just uses the coordinates configured for your home. So it’s very weird that the new device shows those coordinates, but yet is not_home.

Regarding your home’s GPS coordinates, there’s two places those can go. In the basic homeassistant configuration, and you can also define a home zone. Do you have both defined, and do they use the exact same latitude and longitude?

Regarding adding the MAC address to your iphone known_devices.yaml entry…

I don’t use that feature, but after extensive reading of the code, I think this is the idea…

So, let’s simplify to two devices: nmap and iphone. And let’s say they’ve both been found and added to known_devices.yaml. I think what you’re supposed to do, if you want, is to add the MAC of the nmap entry to the iphone entry, and then remove the nmap entry, and then restart HA. Now, there will only be one device_tracker entry (the “iphone” one), but when either “device” updates, it will update the same device_tracker entry. So, whichever one updates last, that will be the status of that device_tracker entity. At least this is what the docs seem to suggest (although don’t come right out and say), and what the code seems to be written to do. But, “take this with a grain of salt”, because, like I said, this is not based on experience, just on reading the docs and the code.

After sleeping on it, I concur with your analysis. I recall now having to delete the known_devices.yaml AND the entities file, reboot and re-enter any missing data on the newly created files.

I mean that there are 3 entities in the group in configuration and only 2 entities are showing on the UI (the bluetooth and nmap entity).

I tried adding the mac address to the homeAssistant app entity, it did not resolve the problem. the nmap entity already had it out of necessity.

Sorry to keep harping on this, but the two entities can appear in the UI two different ways. That’s why I’m trying to ask very specific questions. They can show as icons themselves, or they can show as entities within the group “card”. Either way, though, it’s weird that all three device_trackers show on the States page, and show in the entity_id attribute of the group, but the one doesn’t show up in the UI (either itself or in the group I’m guessing based on what you’ve said.) Do you use any sort of UI customization? And, if so, is it possible you need to add the new device_tracker to the UI customization to get it to appear? Or could it be hidden via customize.yaml?

If you add the MAC address to the homeAssistant app entry in known_devices.yaml, I think you need to remove the nmap entry. By adding the MAC address to the homeAssistant app entry, you’re basically telling the device tracker component to show both as one device_tracker entity. But if you leave the nmap entry in the file, then that’s contradictory and may cause unexpected results and/or warnings/errors. Again, at least the way I read the code.

Until you figure out what’s going on, I would suggest not adding the MAC address to the homeAssistant entry in known_devices.yaml. But maybe since I’m just reading code and don’t have any direct experience with this, I should let others help you…

EDIT: I did try one experiment. Not sure it helps, but the results were a little unexpected. So I have three device_trackers that are in a group (i.e., a group I created that is different from group.all_devices, similar to what you have.) I usually just show the group in the UI, and all three device_tracker entities are always displayed in that group “card.” I just added one of the device_tracker entities to the UI page as a separate entry, but it did not appear separately. It did not appear until I removed the group from that page. So it would appear that if an entity is in a group, and the entity and the group are both displayed on a page in the UI, that the entity will only be displayed as part of the group and not on its own. Not a bad thing; I just didn’t expect that.