-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Implement whitelist #44
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
base: master
Are you sure you want to change the base?
Conversation
There's the case that my home Wi-Fi contains many devices of different purposes, e.g. guest phone, TV stream box, IoT sensors and such. Those Wi-Fi clients shouldn't be reported as a device tracker, because we don't care about their connection status. So a whitelist function is implemented.
In the whitelist, It would be better to specify the MAC Address instead of the hostname. If you have multiple AP running OpenWrt plus 802.11r fast roaming, the hostname is irrelevant for the AP, only the MAC is used: Fri Jan 31 11:37:09 2020 daemon.notice hostapd: wlan1: AP-STA-DISCONNECTED fc:18:3c:xx:xx:xx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As i said, i would substitute hostname for mac, to build the payload and only send the whitelisted devices. I've forked your repo @ttimasdf and made the modifications. It works nicely with 2 APs. Thanks to you and mueslo for the code :-D
Is this still a relevant feature with newer versions of HomeAssistant? (I no longer see |
Actually this is still an issue (at least for me). I did not check my known_devices.yml for some time and now it contains more than 12000 lines. (Probably due to 5 android devices that use random MACs each time they connect) Since I did not find a way to not track devices by default for solutions that directly use device_tracker.see service calls, I would really appreciate a whitelist feature as I only want to track 2 of my wifi devices, which I told to use static MACs. Is there anything I could to to merge this? I'd strongly prefer an upstream solution instead of maintaining my own repo. PS: thanks for creating this package :-) |
if [ -n "$hass_whitelist_devices" ] && ! array_contains "$hostname" $hass_whitelist_devices; then | ||
logger -t $0 -p warning "push_event ignored, $hostname not in whitelist." | ||
elif [ -z "$hostname" ]; then | ||
logger -t $0 -p warning "sync_state ignored, hostname for $mac is empty." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as far as I can tell, this is unrelated to the whitelist feature and should be removed (also, it is buggy, since it can suppress events from devices before they have gone through DHCP)
elif [ -z "$hostname" ]; then | ||
logger -t $0 -p warning "sync_state ignored, hostname for $mac is empty." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There's the case that my home Wi-Fi contains many devices of different purposes, e.g. guest phone, TV stream box, IoT sensors and such. Those Wi-Fi clients shouldn't be reported as a device tracker, because we don't care about their connection status. So a whitelist function is implemented.