Another question. What is the right input for the poePort portIdx value? I’ve tried “gi2”, as my USW-16-PoE is reporting, but I receive the message
2022-02-28 14:10:35.332 [WARN ] [penhab.core.config.core.ConfigParser] - Could not set field value for field 'portIdx': For input string: "gi2"
java.lang.NumberFormatException: For input string: "gi2"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
at java.lang.Integer.parseInt(Integer.java:652) ~[?:?]
at java.lang.Integer.valueOf(Integer.java:983) ~[?:?]
at org.openhab.core.config.core.ConfigParser.valueAs(ConfigParser.java:215) ~[bundleFile:?]
at org.openhab.core.config.core.ConfigParser.configurationAs(ConfigParser.java:128) [bundleFile:?]
at org.openhab.core.config.core.Configuration.as(Configuration.java:79) [bundleFile:?]
at org.openhab.core.thing.binding.BaseThingHandler.getConfigAs(BaseThingHandler.java:219) [bundleFile:?]
at org.openhab.binding.unifi.internal.handler.UniFiBaseThingHandler.initialize(UniFiBaseThingHandler.java:66) [bundleFile:?]
at org.openhab.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:153) [bundleFile:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.openhab.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:154) [bundleFile:?]
at org.openhab.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
For the device I have it’s a number. Can you use openHAB discovery to find the ports and if you add such a port does it work? or does it also give the same error? In the later case it could be the port_idx is sometimes a number and sometimes a string. If that would be the case the binding needs to be fixed to handle strings.
After first try, everything’s working as expected.
But unfortunately, enable/disable a ssid triggers also a reprovisioning, and that is not fitting my use case. I would like instead to find a way to trigger a firewall rule with a switch … not sure if this is possible via rest-api, investigating
edit: perhaps I can use the “blocked” field … after 2 hours eg I can block the clients in the wlan for kids, instead of disabling the entire wlan
there is a huge difference between USG and UDM Pro: UDM Pro doesn’t have the possibility to use the json file for extra configurations. But you can work around
I’ll receive my UDM Pro very shortly. I’ll let you know. Just ping me if you have questions about the “routing” side of the Moon
ciao
Andrea
there is an interesting bunch of info you can collect by “stat/health”; in particular I see
if your system overall is ok (meta/rc)
Subsystem “wlan”: num_user, num_guest (num_iot is not clear to me), status, num_ap, num_adopted (good to set an alarm if the num_ap is different from num_adopted ;))
Subsystem “wan”: status, num_gw, num_adopted (good to set an alarm if the num_gw is different from num_adopted ;)). There is also gw_system-stats/cpu and mem that should be interesting
Subsystem “www”: status, latency, speedtest_ping
Subsystem “lan”: status, num_user, num_guest, num_sw, num_adopted (good to set an alarm if the num_sw is different from num_adopted ;))
Subsystem “vpn”: status, remote_user_active also site_to_site_enabled should be interesting to add
Here you are: if there is a remote user connected via VPN, the remote_user_active is > 0. Otherwise is 0
Hi,
firstly, brilliant work with the beta binding! i’ve been trying it out the last couple of days and its working flawlessly.
Would it be possible to read out the number of wifi clients per wifi network? so for example i do have a separate iot network for all my smart devices and i want to know how many of them are connected, or if i have a separate network for guests but without using the “guest network” setting in the controller?
I finally just switched to the new beta binding. Great work thanks!
Is it planned to add access points as things in the future? I currently use the Art of Wifi PHP Library to activate/deactivate my access points at night time (or at least my wife does). This works great but I’m always trying to keep custom built stuff around OH to an absolute minimum and just stick with the regular bindings as much as possible.
@ariela Lot’s of feature requests It looks like these require new type of things and/or calling a different api on the controller. Because the forum here is not a convenient place to track larger change request. I’d like to suggest if you can please create an issue on the openhab-addons GitHub repository issue tracker. Add a list of the features, grouped by: openHAB thing - openHAB channel - UniFi data field - Description of the channel. The more clearer the requirements are the faster I can add them.
@ariela , @N20VSLS I’ll add 2 channels to the wlan thing: number of wirelessClients and number of guestClients.
@DrRSatzteil activating the access point itself is not possible currently. I also don’t know and would need to find out the api call needed to activate/deactive the ap. If you have more information on that please post it here. There are some possible alternative solutions, but I’m not sure if they do work for you: 1) If you power the AP via a PoE port you can disable the power to the port, effectively shutdown the AP. But this might be a bit of brute force method. 2) It’s possible to active/deactive a network via a wlan thing. This can disable the whole WiFi network, not specifically a AP. So that might be a bit to much.
public function disable_ap($ap_id, $disable)
{
if (!is_bool($disable)) {
return false;
}
$this->curl_method = 'PUT';
$payload = ['disabled' => $disable];
return $this->fetch_results_boolean('/api/s/' . $this->site . '/rest/device/' . trim($ap_id), $payload);
}
Oh and regarding you other suggestions: unfortunately my POE switch isn’t a UniFi one so this is not an option for me. And disabling the wifi networks does not disable the radio afaik. So disabling the device seems to be the way to go for me.
I see the WLAN thing has a channel for a QR code for joining the WLAN network. I’d love to be able to display a QR code for joining the guest network. Just wondering if anyone has already done the work to create the QR code.
If not, I’ll take a look at it. I seem to recall there’s a Linux command to create a QR code, so should be easy enough.