UniFi Network integration - official thread

I’ve noticed when I switch one of the ssid switches off it does knock out all the ssids briefly

1 Like

I’ve noticed the same thing.
The entity I use is only for one SSID, but it loooks like it’s resets the wifi radio so all go SSID’s go down for +/- 30 secons

I have described in bit more detail how I made this card, so that hopefully others can make this card as well. Not everyone is handy with this sort of thing.

Guest wifi card with QR code

87fec94f95070804088dd06378c1f4968bb40c82

Hey all!

Another month and another release so here comes the UniFi release notes for Home Assistant 2023.9.0.

Got some decent amount of new features with this release and some long awaited improvements. There is no longer any need to time switching PoE controls as the integration will queue them up and send new commands every 5 seconds. Added a restart device button, it is a soft restart so it will not break PoE if restarting a PoE switch. @Cisien came out from nowhere and developed some awaited extensions to PDU devices with both switching functionality for newer outlets as well as a lot of power sensor reporting. Also now its possible to control port forwarding.

Try these features out during the beta, feedback is appreciated.

Cheers!

/Robban


aiounifi library v53-v60 change log

For feature requests of the integration post an issue at aiounifi github

If you appreciate my work I’m on Github Sponsors.

5 Likes

I’m using the unifi integration to generate a QR code for the guest network. Trying to see if there is a way to “save” the qr image to a png (or other file) in www/local or something along those lines, or is it only generated run-time?

The end goal is to be able to generate the image out of HA (which works fine) but actually host it on a separate page on a LINX dashboard?

It’s generated at runtime so never written to file system. Not sure if there is any service you can use to copy it to file system.

so played around a bit with it and found a way to do this relatively easily, tested and looks good. The details to construct the link are actually in the entity state + attributes

this is the template i used to generate the link, where
image.guestnet_qr_code = qr entity from the unifi integration
entity_picture = link to the api with token embedded
state=timestamp that is used in the actual url

http://hassio.local:8123{{ state_attr('image.guestnet_qr_code', 'entity_picture') }}&state={{ states('image.guestnet_qr_code') }}

note - the token changes frequently, but using the template ensures im always pulling the current one being used by the integration

bit of a hack but it works :slight_smile:

New user here, thanks for the integration. I share the frustration with how 1 device can be utilized by multiple integrations.

I guess that this is a platform issue. In my case my Apple TVs show as using both Apple TV and Ubiquiti integrations. The major issue to me is that the icon HA has chosen is the Ubiquiti logo. There’s no way to prioritize which logo is chosen (that I can see). I don’t know if this is an issue that is being tracked at the platform level.

1 Like

There is work in progress which will improve this. The registry needs to know which is primary and which is secondary. The registry is not related to any platform so I don’t understand what you mean by that.

2 Likes

platform = Home Assistant. It’s a global Home Assistant issue. Not any particular integration issue.

2 Likes

Hey all!

Another month and another release so here comes the UniFi release notes for Home Assistant 2023.10.0.

I’ve continued to clean up the library with the current focus being splitting up websocket separating responsibilities between library and integration, this one definitely warrants some extra eyes on in beta.

Try these features out during the beta, feedback is appreciated.

Cheers!

/Robban


aiounifi library v62-v63 change log

For feature requests of the integration post an issue at aiounifi github

If you appreciate my work I’m on Github Sponsors.

5 Likes

Awesome work! I installed it and has been perfect since day 1!

I am wondering though… I know the PPSK (private PSK?) is in a pre release state as of today, that might change at any time, but…

I currently use the Unifi integration and place the QR code in a wall panel. I then use a script that changes the password of a certain SSID every 24 hours… Is there any way to achieve this with say, the third PPSK in the list of said SSID?

1 Like

I have no idea, do you have an example of the API output with the PPSK?

1 Like

I’m no programmer… :sweat_smile::sweat_smile::sweat_smile:

You can enable debug logging of the integration and look at the debug log, you should be able to find the ppsk on your wlan if it is provided.

Found them! Yes, they are exposed to HA.

This is what I think is relevant from the code… I’ve redacted some parts for privacy, others were already redacted by the log itself:

      "**REDACTED**6f8326d9b": {
        "setting_preference": "manual",
        "dtim_6e": 3,
        "wpa3_support": true,
        "minrate_na_advertising_rates": false,
        "wpa_mode": "wpa2",
        "minrate_setting_preference": "auto",
        "minrate_ng_advertising_rates": false,
        "b_supported": false,
        "radius_das_enabled": false,
        "group_rekey": 0,
        "radius_macacl_format": "none_lower",
        "pmf_mode": "optional",
        "wpa3_transition": true,
        "passphrase_autogenerated": true,
        "private_preshared_keys": [
          {
            "password": "**OBVIOUSLY REDACTED**",
            "networkconf_id": "<**REDACTED**8469dd7fd"
          },
          {
            "password": "**OBVIOUSLY REDACTED**",
            "networkconf_id": "**REDACTED**ed08efacdf2f"
          },
          {
            "password": "**OBVIOUSLY REDACTED**",
            "networkconf_id": "**REDACTED**0ed08eface00d"
          },
          {
            "password": "**OBVIOUSLY REDACTED**",
            "networkconf_id": "**REDACTED**3c7433f2a5"
          }
        ],
        "bc_filter_enabled": false,
        "tdls_prohibit": false,
        "mcastenhance_enabled": true,
        "usergroup_id": "**REDACTED**308469dd7fe",
        "schedule_enabled": false,
        "proxy_arp": false,
        "country_beacon": false,
        "sae_sync": 5,
        "uapsd_enabled": false,
        "iapp_enabled": true,
        "name": "Sojuelix",
        "site_id": "**REDACTED**308469dd7e8",
        "hide_ssid": false,
        "wlan_band": "both",
        "_id": "**REDACTED**506f8326d9b",
        "private_preshared_keys_enabled": true,
        "no2ghz_oui": true,
        "x_iapp_key": "**REDACTED**0f5d7ea5e57dd32d28",
        "auth_cache": false,
        "networkconf_id": "**REDACTED**ff308469dd7fd",
        "dtim_na": 3,
        "is_guest": false,
        "minrate_na_enabled": false,
        "sae_groups": [],
        "enabled": true,
        "sae_psk": [],
        "wlan_bands": [
          "2g",
          "5g"
        ],
        "mac_filter_policy": "allow",
        "p2p_cross_connect": false,
        "security": "wpapsk",
        "ap_group_ids": [
          "**REDACTED**8469dd807"
        ],
        "l2_isolation": true,
        "minrate_ng_enabled": true,
        "bss_transition": true,
        "minrate_ng_data_rate_kbps": 1000,
        "radius_mac_auth_enabled": false,
        "wpa3_fast_roaming": false,
        "schedule_with_duration": [],
        "pmf_cipher": "auto",
        "ap_group_mode": "all",
        "wpa3_enhanced_192": false,
        "vlan_enabled": false,
        "fast_roaming_enabled": false,
        "rrm_enabled": false,
        "wpa_enc": "ccmp",
        "x_passphrase": "**REDACTED**",
        "radius_macacl_empty_password": false,
        "mac_filter_list": [],
        "dtim_mode": "default",
        "p2p": false,
        "schedule": [],
        "element_adopt": false,
        "bc_filter_list": "**REDACTED**",
        "dpi_enabled": false,
        "minrate_na_data_rate_kbps": 6000,
        "mac_filter_enabled": false,
        "sae_anti_clogging": 5,
        "dtim_ng": 1
      },

I’ve checked the QR code of the PPSK network and the password that it leads to is the regular psk, even though it is disabled…

1 Like

hey danielccm, thank for this information.
I’m using the script here for our homeWIFI / guestWIFI (UPDATED: Automating Unifi WiFi SSID password changes and QR code generation - #62 by Robban)

with the private-preshared_keys I don’t know how to change the script to automate the password change, maybe you can help out a bit? Or is the password change possible now with the Unifi Integration?

1 Like

Unfortunately my dev skills stop right at copy and paste + “customise-my-private-data-into-fields” of others’ code…

I’m stuck right at that same step…

Hey all!

Another month and another release so here comes the UniFi release notes for Home Assistant 2023.11.0.

One major new thing is the new way to configure what clients should produce entities, it’s now just an opt in by selecting specific clients. The old options to configure clients will be removed down the line.

Starting this summer @herriejr worked hard to implement traffic rules support and got completed a few weeks back. He is now working on the integration side, keep a look out with future Home Assistant releases to use @herriejr work.

Try these features out during the beta, feedback is appreciated.

Cheers!

/Robban


Home Assistant 2023.11.1


Home Assistant 2023.11.0

aiounifi library v64 change log

For feature requests of the integration post an issue at aiounifi github

If you appreciate my work I’m on Github Sponsors.

2 Likes

I updated to HA 2023.11 and was very excited about the new feature to explicitly choose the clients. I have round about 150 active network devices and only need aprox. 10 of them in HA.

So i did the configuration again, but nothing happened. After i selected my 10 clients in the first config screen it added even more devices than i had before. I was hoping that my 150 devices would be replaced by the only 10 i wanted. But that did not happen. Am i doing something wrong?

Beside i have many devices that i cannot identify because their names are different from what the unifi controller shows. Does the integration took the names that i gave the client in my network configuration or does it rely on the device name itself? I suppose the latter because i also had some Apple devices that only showed up by its mac adress. As it turned out i had to disable the wifi privacy feature at this Apple devices for my home wifi to get the devices shown by its names.
However i still have problems with the naming of the devices. Only way to match them is by looking at the mac adresses. Also HA shows some very old devices which are no longer present at unifi controller. How can i do a full sync between HA and the unifi controller? I was hoping that the new explicit selecting feature handles this.

There is no automatic clean up yet. They will probably be “unavailable” or not initiated.

Only UniFi client entities from the new list should be created. Are you sure the devices are not just leftovers? According to my tests it works as expected (apart from no cleanup yet).

If the devices are created from other sources than UniFi that will not change, UniFi integration takes name from two sources either the assigned UniFi name (if set) else the hostname.

Before starting doing automatic clean up I’d like to get some more feedback to make sure Im on the right track with this new path.

/R