Meraki Presence Detection Filling known_devices

Hi there,
Is anyone else using Meraki for their presence detection?

I just looked at my logs and I have over 2000 entries for known devices. All unique Mac addresses.
Thankfully I’ve set track to false by default so don’t see them in HA. Has anyone else noticed this?

I’m guessing it is displaying every device who has detected my network even if they have not connected to it. Is it possible to change it so only connected devices are displayed in known_devices.yml?

Hey - I’m getting the Meraki component set up and running into the same issue. Did you happen to develop a solution by chance?

Unfortunately no. I started using different APs recently so have scrapped meraki presence detection all together. Ubiquiti does a really nice job with it.

Same problem here. :S

Was forced to try detection through Meraki as the Asus component seem broken but Meraki is not doing a solid job.

Has this plugin worked for anyone?
Meraki seems to be announcing any BT / Wifi MAC address that it detects on air regardless of their actual connection to AP,

our known_devices.yaml has 57424 lines (and still growing at fast pace)
Is there a way to turn off BT?
And for Wifi, is there a way to restrict to actually connected devices?

For the MAC addresses that we want tracked, their presence detection is so random, probably because of sheer volume of data Meraki is sending, this is how they appear, even though they’re all Home

Lastly, HA often responds with http 500, this is from HA logs

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/ban.py", line 68, in ban_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/http/view.py", line 115, in handle
    result = await result
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/meraki/device_tracker.py", line 85, in post
    self._handle(request.app['hass'], data)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/meraki/device_tracker.py", line 92, in _handle
    lat = i["location"]["lat"]
TypeError: 'NoneType' object is not subscriptable

Thanks

I too have the same issue with the Meraki module - Whilst it does work to identify everything it sees (as this is based on retail analytics use case) I think the implementation for HA needs tweaking to only identify connected devices. Where would this be logged for improvement?

how did you guys get this to work? I am unable to get this working at all because the response is not in the correct format. I have been considering rewriting the component. Did you guys have to make changes to the component in order to get the post url to validate. When I validate I get an incorrect response and when I hit the url with a browser it returns a file not a correctly formatted json response.

@darkstar939

What do you mean by the response is not in the correct format?
What format is it in?

To get component working, first we needed to make the following changes to meraki/device_tracker.py
to get around the object is not subscriptable errors mentioned above.
(not sure why, but location coordinates are always null)

87,92c86,94
<             lat = i["location"]["lat"]
<             lng = i["location"]["lng"]
<             try:
<                 accuracy = int(float(i["location"]["unc"]))
<             except ValueError:
<                 accuracy = 0
---
>             #lat = i["location"]["lat"]
>             lat = 0
>             #lng = i["location"]["lng"]
>             lng = 0
>             accuracy = 0
>             #try:
>             #    accuracy = int(float(i["location"]["unc"]))
>             #except ValueError:
>             #    accuracy = 0

Note: if you want to persist your changes, copy the modified meraki component into custom_components

That got it working for a while until api_password got deprecated.
You can read up here our temporary workaround for that.

What I mean is that when trying to validate my post URL I get the error: Response other than 200:

I am getting this error when I test the POST URL from within my Meraki dashboard:

Login attempt or request with invalid authentication from xxx.meraki.com (IP) (Apache-HttpClient/4.5.4 (Java/1.8.0_171))

Have any of you see this before?