android icon indicating copy to clipboard operation
android copied to clipboard

Check for BSSID when enabling Internal URL

Open cvroque opened this issue 3 years ago • 5 comments

Is your feature request related to a problem? Please describe.

I have three places where they all share a common SSID/Password, this was done to easily change wifi devices between locations, but then the internal URL only works in one of these locations and requiring me to change settings every time (add/remove SSID) in order for HA app to work properly.

PS: This screen recently got a nice interface, thanks! Describe the solution you'd like

Allow me to include a combination of SSID and/or BSSID (AP mac address) to check if it should connect locally or not. This information is already available in the app sensors. The BSSID is different between any access point (even in mesh systems) so that should be pretty much enough. Describe alternatives you've considered, if any

Maybe a toggle to enable and disable internal URL through HA automations? Additional context

Thanks in advance!

cvroque avatar Sep 14 '22 18:09 cvroque

Thanks for filing this again looks like the original issue #451 was closed as being stale

This will be a tough one to figure out properly because it will probably result in a breaking change for users, unless we add a specify BSSID option for the user to enter that but even then it feels like too many options.

Ideally the users would reselect their connected WiFi address at home so the app can pick up the BSSID so they don't need to manually enter it. However the app would still need to pick up the additional BSSIDs in case of multiple APs.

but then the internal URL only works in one of these locations and requiring me to change settings every time (add/remove SSID) in order for HA app to work properly.

You actually don't need to do that, when it comes to API calls the app will first try the internal URL if it thinks you are at home then if the call fails the app will try the other URLs. On the home screen you probably need to hit the refresh button once or twice to get the correct external URL to load. Its a workaround but at least you are not changing settings that often.

dshokouhi avatar Sep 14 '22 18:09 dshokouhi

A bit of a hacky workaround, but could we perhaps detect if the 'SSID' that was entered is actually a BSSID using regex or something similar and switch detection in that case? That would allow you to use a regular SSID or BSSID without cluttering the interface up. (You'd be out of luck if your SSID is in a BSSID format but doesn't match the BSSID, which seems very unlikely to happen.) 🤔

PS: This screen recently got a nice interface, thanks!

As the person who implemented that change, nice to hear!

jpelgrom avatar Sep 14 '22 18:09 jpelgrom

A bit of a hacky workaround, but could we perhaps detect if the 'SSID' that was entered is actually a BSSID using regex or something similar and switch detection in that case?

Thats actually a great idea and will prevent a breaking change. We could probably specify a prefix in the field for easier detection in our internal checks? Similar to app://<package_name>

dshokouhi avatar Sep 14 '22 18:09 dshokouhi

Thats actually a great idea and will prevent a breaking change. We could probably specify a prefix in the field for easier detection in our internal checks? Similar to app://<package_name>

So something like bssid:00:00:00:00:00:00?

jpelgrom avatar Sep 14 '22 18:09 jpelgrom

yup just to keep it simple?

dshokouhi avatar Sep 14 '22 18:09 dshokouhi