Device tracker with BSSID

I’m trying to combine my location tracking (mobile app GPS) with the BSSID entity.

What is the best way to do this? Ideally I would like to create 1 location tracking entity, this entity would consist of 2 location tracking entities

  • mobile app gps
  • bssid sensor

So, effectively when Person A is detected as “Away” and Person A BSSID is detected as “Not Connected” then the person is away.

And when Person A is detected as “Home” and BSSID is detected as “xx:xx:xx:xx:xx” then the person is Home.

What is the cleanest way of doing this using the least amount of automations etc. I tried to add the BSSID sensor to the user or person as a device tracker but it does not let me.

Thanks

Already creates a device tracker entity?

What provides this?

The EASIEST is for the bssid sensor to be presented as a device tracker as well (maybe have to template that but is why I asked where you get it)

Once these are both device trackers then assign them to your person object in settings.

Once this is done the state of zone.home will contain the number of persons present (count of persons where one or more device tracker reports home in zone)

So you can automate on numeric state of zone home > 0 = a tracked person is present.

the ha mobile app provides this if you turn it on. it’s off my default.

would need to wrap this into a device_tracker or use it with device_tracker.see to assignment an existing one

1 Like

No need then it will provide basically the same info the GPS sensor is already really.

Belt and suspender is great but you want the suspender to be a different source than the belt - what kind of router do you have? We might be able to see it connected there?

Sorry I already have both sensors,

I already have the GPS location sensor via the mobile app which I am currently using for location tracking however this does produce issues as it sometimes reports people as home when they are away,

So
I would like to add a backup layer using the BSSID which is another sensor I already have also provided by the mobile device, called BSSID

This sensor reports the current connected wifi network BSSID and reports “Not connected” when not connected to a wifi network.

I would just like to be able to assign the basid sensor to the user as a location tracker as well,

Ideally I would like a template sensor or something to convert the bssid sensor to a location tracker, allowing me to assign it to the user directly as a location tracker,

I’m not sure then if it combines with sensors to determine the location of the person?

Thanks

1 Like

It does. If the bssid sensor is reliably then go do exactly that

This should get you started using the device tracker see service.

You’ll create a tracker (it won’t do much by itself)
Then you’ll create an automation that triggers on change of that bssid - if the bssid is the one you want then pop that device tracker. See service for the tracker you created.
Add the tracker to person.
Trigger on status of state of Home zone

… Profit?

If your router can do what @NathanCu describes, that’s the better way of tracking if the device is seen on your network because it has a more reliable link to ha. if it does not have a device_tracker you could do what I posted in a other thread

trigger:
  - platform: state
    entity_id:
      - sensor.my_phone_wifi_connection
condition: []
action:
  - service: device_tracker.see
    data:
      dev_id: your_device_name
      location_name: >
        {{ 'home' if (states('sensor.my_phone_wifi_connection') ==
        'my_home_wifi_ssid') else 'not_home' }}

noted that I am using said, not bssid. if you have a multi ap setup, as I do, I think this is the better option… I believe bssid gives you the mac address of the ap, so you’d have to have all addresses, and you’d have to update if you need to replace a device.

this is not as good as Nathan’s solution because the mobile has to connect and report back to ha. so id recommend this only if you can’t get the router side reporting.

another approach would be to use bluetooth… the device only has to see the address, doesn’t need to connect to it .

2 Likes