Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device_tracker.ubus tracks unauthenticated and unassociated devices #8475

Closed
grote opened this issue Jul 14, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@grote
Copy link

commented Jul 14, 2017

Home Assistant release: 0.48.1

Python release: Python 3.4.2 (on Raspian)

Component/platform: device_tracker.ubus

Description of problem: Frequently new devices are tracked (to be home) and added to the known devices file even though these devices don't have the WiFi password and don't show up in OpenWRT's or LEDE's list of associated clients.

Expected: Only devices that are properly associated and authenticated with the WiFi router should be tracked.

Problem-relevant configuration.yaml entries and steps to reproduce:

device_tracker:
  platform: ubus
  host: 192.168.1.1
  username: root
  password: secret
  track_new_devices: yes
  interval_seconds: 12
  consider_home: 90
  1. Add ubus device tracker to configuration
  2. Be in an area with many wifis and devices
  3. Wait for unassociated clients being tracked

Additional info:
Here's an example of the ubus traffic that shows one properly tracked device and one that should not be tracked.

{
    "data": {
        "clients": {
            "xx:xx:xx:xx:xx:xx": {
                "aid": 1,
                "assoc": true,
                "auth": true,
                "authorized": true,
                "ht": false,
                "mfp": false,
                "preauth": false,
                "vht": false,
                "wds": false,
                "wmm": false,
                "wps": false
            },
            "yy:yy:yy:yy:yy:yy": {
                "aid": 2,
                "assoc": false,
                "auth": false,
                "authorized": false,
                "ht": false,
                "mfp": false,
                "preauth": false,
                "vht": false,
                "wds": false,
                "wmm": false,
                "wps": false
            }
        },
        "freq": 2437
    },
    "objid": 2001901283
}

A simple solution should be to check if authorized and assoc are true.

@grote

This comment has been minimized.

Copy link
Author

commented Jul 14, 2017

Looking at the responsible code it seems that it just takes result['clients'].keys() without bothering to check the information per client first.

@fanthos

This comment has been minimized.

Copy link
Contributor

commented Jul 31, 2017

I haven't read the code from LEDE, not sure what does "assoc", "auth" and "authorized" means.
I am trying to add HTTPS support for LEDE/Openwrt ubus(maybe also on openwrt.luci).

@grote

This comment has been minimized.

Copy link
Author

commented Jul 31, 2017

They represent different levels of a client "being" in the WiFi. Home-assistant should check that they are true before adding the device to the list of clients. Otherwise, it will show also devices that just attempt to get into the WiFi.

@balloobbot

This comment has been minimized.

Copy link
Contributor

commented Oct 20, 2017

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@grote

This comment has been minimized.

Copy link
Author

commented Oct 20, 2017

This issue hasn't been fixed, yet. Or @fanthos have you been doing something?

@aarnaud

This comment has been minimized.

Copy link
Contributor

commented Feb 2, 2018

Not fixed.

	"clients": {
		"xx:xx:xx:xx:xx:xx": {
			"auth": true,
			"assoc": true,
			"authorized": false,
			"preauth": false,
			"wds": false,
			"wmm": true,
			"ht": true,
			"vht": false,
			"wps": false,
			"mfp": false,
			"aid": 2
		},
		"yy:yy:yy:yy:yy:yy": {
			"auth": true,
			"assoc": true,
			"authorized": true,
			"preauth": false,
			"wds": false,
			"wmm": true,
			"ht": true,
			"vht": false,
			"wps": false,
			"mfp": false,
			"aid": 1
		}
	}

Only yy:yy:yy:yy:yy:yy has wpa key. We need to add the check of authorized or the tree value auth, assoc, authorized

aarnaud added a commit to aarnaud/home-assistant that referenced this issue Feb 2, 2018

balloob added a commit that referenced this issue Feb 3, 2018

@balloob balloob referenced this issue Feb 9, 2018

Merged

0.63 #12267

@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.