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

[unifi] Add network thing #18335

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

DrRSatzteil
Copy link
Contributor

Add network thing to binding

The binding currently allows to disable WiFi networks which is handy when you want to stop certain wireless clients to use the network. However there are two cases where you actually might want to control the underlying network instead:

  1. Obviously by operating on the network level you can also control wired networks and thus the access of wired clients.
  2. Since a couple of UniFi network versions you can also tunnel WiFi clients to different networks based on different passwords. Therefore you might not want to completely disable a WiFi network but want more fine grained control over the underlying networks behind your WiFi network.

Description

This PR will add a new network thing to the binding which will be auto discovered. Networks can be disabled/enabled and offer channels for the site, the number of connected clients and the network purpose.

Known Issues:

  1. Network purpose channel: Currently I know of four network purposes: corporate (most local networks), guest (a network for guests), remote-user-vpn (a network that allows remote users to connect to the local network, e.g. a WireGuard network) and wan (Internet). It is very likely that there are other network purposes that I don't use in my setup (e.g. a voice network or a site-to-site vpn). I could not find a list of all possible values so far.
  2. Currently disabling/enabling of networks is working fine but is not correctly reflected in the official UniFi iPhone App or the web app. The GUI will not correctly display that the network was disabled but you can tell that it is because clients can no longer use the network. This is nothing we can fix though, the status in the official apps can be restored correctly by disabling and enabling the corresponding network there manually.

Thomas Lauterbach added 2 commits February 27, 2025 23:45
Signed-off-by: Thomas Lauterbach <[email protected]>
Signed-off-by: Thomas Lauterbach <[email protected]>
@DrRSatzteil
Copy link
Contributor Author

Oh, I forgot to mention that I haven't updated the README yet. I'd rather get some feedback on Know Issue 2. I would understand if you don't want to merge this PR because of that. Therefore I will just wait until I get some feedback here before I continue with documentation.

@jlaur jlaur added the enhancement An enhancement or new feature for an existing add-on label Feb 28, 2025
Signed-off-by: Thomas Lauterbach <[email protected]>
Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I plan to give this a test run and will then resume the review and try to provide some feedback to your concerns.

Signed-off-by: Thomas Lauterbach <[email protected]>
@jlaur
Copy link
Contributor

jlaur commented Mar 2, 2025

  1. Network purpose channel: Currently I know of four network purposes: corporate (most local networks), guest (a network for guests), remote-user-vpn (a network that allows remote users to connect to the local network, e.g. a WireGuard network) and wan (Internet). It is very likely that there are other network purposes that I don't use in my setup (e.g. a voice network or a site-to-site vpn). I could not find a list of all possible values so far.

In my setup I have corporate and vlan-only. I can't find in the app or web interface any descriptions, except the auto-generated and modifiable "Default", "Vlan only network - 4" and "Vlan only network - 3":

image

  1. Currently disabling/enabling of networks is working fine but is not correctly reflected in the official UniFi iPhone App or the web app. The GUI will not correctly display that the network was disabled but you can tell that it is because clients can no longer use the network. This is nothing we can fix though, the status in the official apps can be restored correctly by disabling and enabling the corresponding network there manually.

That's a bit strange. What happens if you disable a network from the web interface and check the app, or vice versa? Unfortunately I won't be popular if I start testing this right now. 😉

@DrRSatzteil
Copy link
Contributor Author

Actually for some reason I cannot pause the networks right now, neither from the web interface nor via API. I don't know why, maybe Ubiquiti broke this in the last release?

@DrRSatzteil
Copy link
Contributor Author

DrRSatzteil commented Mar 2, 2025

Aaah now I remember: there is a long open bug that prevents networks from being paused when DHCP guarding is activated (see: https://community.ui.com/questions/Failed-to-pause-network/e23ca7d2-36cf-495d-ae0e-a0677a24cbe3#answer/e71b475a-c869-45f0-8586-bfb7a0550445)

With DHCP guarding disabled I can stop the network in the UI and this is correctly reflected in OH.

@DrRSatzteil
Copy link
Contributor Author

Just checked again the other way round: I disabled a network via openHAB and checked the official apps:

In the iOS app everything is working as expected. The network is displayed as paused and can be enabled there. The web UI is however still broken: the network is shown as disabled (greyed out) but when you click manage there is still the "pause" button although there should be the "continue" button instead.

image

@DrRSatzteil
Copy link
Contributor Author

Enabling the network via openHAB is not reflected in the official apps at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants