Git Product home page Git Product logo

aiounifi's Introduction

aiounifi

Asynchronous library to communicate with Unifi Controller

Acknowledgements

  • Paulus Schoutsen (balloob) creator of aiohue which most of this code repository is modeled after.

aiounifi's People

Contributors

ahutchings avatar bdraco avatar cameronr avatar cezarsa avatar cisien avatar cometmth avatar dependabot[bot] avatar herriejr avatar hunterjm avatar j3173 avatar jasperslits avatar jghaanstra avatar josephblock avatar kane610 avatar kimdv avatar layertwo avatar mkmer avatar n3rdix avatar owenvoke avatar rfleming71 avatar sairon avatar shaunpearsondev avatar stonith avatar ufozone avatar vanveele avatar vividboarder avatar xconverge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aiounifi's Issues

Depreciated core modules (Add-on config 'snapshot_exclude' is deprecated, 'backup_exclude' should be used instead)

The problem

21-09-15 10:26:40 WARNING (MainThread) [supervisor.addons.validate] Add-on config 'snapshot' is deprecated, 'backup' should be used instead. Please report this to the maintainer of UniFi Controller

What is version of Home Assistant Core has the issue?

core-2021.9.6

What was the last working version of Home Assistant Core?

core-2021.9.6

What type of installation are you running?

Home Assistant OS

Integration causing the issue

UniFi Controller

Additional information

home-assistant/core#56249

Unifi stats to mqtt

https://community.home-assistant.io/t/unifi-stats-to-mqtt/308458

The official Unifi integration is perfect to get all clients as device trackers, but is missing a lot of useful information which is provided by the Unifi API. For example access point status, score, cpu usage, uptime etc.
So I created a small docker image which acts as a bridge between the Unifi API and MQTT.
You can start this docker container and it will poll the Unifi API each 30 seconds (this is configurable) for the latest statistics and will publish this to MQTT. I have also included a configuration example how to get the sensors in Home Assistant.
Maybe this could also help others so I published it on my github https://github.com/bramstroker/UnifiMqttPublisher

UDM Pro issue when using main function

As suggested in this issue I used python3 -m aiounifi 127.0.0.1 username password to try the main function -- here's the output:

127.0.0.1 username password 8443 default
Using selector: KqueueSelector
Starting aioUniFi
Exception ignored in: <function ClientSession.__del__ at 0x1025bac20>
Traceback (most recent call last):
  File "/Users/messerschmidt/homebrew/lib/python3.7/site-packages/aiohttp-4.0.0a1-py3.7-macosx-10.14-x86_64.egg/aiohttp/client.py", line 269, in __del__
    if not self.closed:
  File "/Users/messerschmidt/homebrew/lib/python3.7/site-packages/aiohttp-4.0.0a1-py3.7-macosx-10.14-x86_64.egg/aiohttp/client.py", line 894, in closed
    return self._connector is None or self._connector.closed
AttributeError: _connector
Traceback (most recent call last):
  File "/Users/messerschmidt/homebrew/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/Users/messerschmidt/homebrew/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/messerschmidt/Desktop/aiounifi/aiounifi/__main__.py", line 105, in <module>
    site=args.site,
  File "/Users/messerschmidt/homebrew/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/Users/messerschmidt/homebrew/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 583, in run_until_complete
    return future.result()
  File "/Users/messerschmidt/Desktop/aiounifi/aiounifi/__main__.py", line 53, in main
    loop=loop, cookie_jar=aiohttp.CookieJar(unsafe=True)
TypeError: __init__() got an unexpected keyword argument 'loop'

Let me know if I can help somehow.

Ubiquiti clients have extra data fields

    "00:00:00:00:00:00": {
        "site_id": "5ddfb6dc2664520220877cf8",
        "assoc_time": 1651021450,
        "latest_assoc_time": 1651021450,
        "oui": "Ubiquiti Inc.",
        "user_id": "5f5cece71d464f073af2f483",
        "_id": "5f5cece71d464f073af2f483",
        "mac": "00:00:00:00:00:00",
        "is_guest": false,
        "first_seen": 1599925479,
        "last_seen": 1651066314,
        "is_wired": false,
        "hostname": "04---Upper-Stairs",
        "fingerprint_source": 4,
        "dev_cat": 57,
        "dev_family": 35,
        "os_name": 1,
        "dev_vendor": 234,
        "dev_id": 2641,
        "confidence": 100,
        "blocked": false,
        "fingerprint_engine_version": "0.0.0",
        "use_fixedip": true,
        "network_id": "5e496f4ef583e6034c04f2f9",
        "fixed_ip": "10.0.250.104",
        "noted": false,
        "fw_version": "UVC.S2LM.v4.49.9.67.8366a5d.220323.1110",
        "product_line": "unifi-protect",
        "product_model": "Camera G3 Micro",
        "icon_filename": "aea0b2dd-53a7-4a01-9057-d4278f7430bc",
        "icon_resolutions": [
          [
            101,
            101
          ],
          [
            129,
            129
          ],
          [
            25,
            25
          ],
          [
            257,
            257
          ],
          [
            51,
            51
          ]
        ],
        "disconnect_timestamp": 1651065881,
        "unifi_device_info_from_ucore": {
          "name": "04---Upper-Stairs",
          "computed_model": "G3 Micro",
          "device_state": "CONNECTED",
          "product_line": "PROTECT",
          "product_model": "G3 Micro",
          "product_shortname": "UVC G3 Micro",
          "icon_filename": "aea0b2dd-53a7-4a01-9057-d4278f7430bc",
          "icon_resolutions": [
            [
              25,
              25
            ],
            [
              51,
              51
            ],
            [
              101,
              101
            ],
            [
              129,
              129
            ],
            [
              257,
              257
            ]
          ],
          "icons": [
            {
              "width": 25,
              "height": 25,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_25x25.png"
            },
            {
              "width": 51,
              "height": 51,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_51x51.png"
            },
            {
              "width": 101,
              "height": 101,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_101x101.png"
            },
            {
              "width": 129,
              "height": 129,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_129x129.png"
            },
            {
              "width": 257,
              "height": 257,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_257x257.png"
            }
          ],
          "fw_version": "UVC.S2LM.v4.49.9.67.8366a5d.220323.1110",
          "fw_status": "UP_TO_DATE",
          "managed": true
        },
        "name": "",
        "usergroup_id": "",
        "fixed_ap_enabled": true,
        "fixed_ap_mac": "00:00:00:00:01:04",
        "wlanconf_id": "5e9b9b46fbc902033e812ed9",
        "_uptime_by_uap": 44865,
        "_last_seen_by_uap": 1651066314,
        "_is_guest_by_uap": false,
        "ap_mac": "00:00:00:00:01:04",
        "channel": 40,
        "radio": "na",
        "radio_name": "wifi1",
        "essid": "**REDACTED**",
        "bssid": "**REDACTED**",
        "powersave_enabled": false,
        "is_11r": false,
        "user_group_id_computed": "5ddfb6e02664520220877d0a",
        "anomalies": -1,
        "anon_client_id": "3ef32b685432410918709412d23721",
        "ccq": 545,
        "dhcpend_time": 400,
        "idletime": 2,
        "ip": "10.0.250.104",
        "noise": -108,
        "nss": 1,
        "rx_rate": 65000,
        "rssi": 31,
        "satisfaction": 96,
        "satisfaction_now": 96,
        "satisfaction_real": 96,
        "satisfaction_reason": 2,
        "signal": -65,
        "tx_mcs": -1,
        "tx_power": 42,
        "tx_rate": 72200,
        "hostname_source": "ubios",
        "vlan": 0,
        "radio_proto": "na",
        "satisfaction_avg": {
          "total": 75840,
          "count": 790
        },
        "uptime": 44864,
        "tx_retries": 0,
        "wifi_tx_attempts": 0,
        "qos_policy_applied": true,
        "_uptime_by_ugw": 155970,
        "_last_seen_by_ugw": 1651066316,
        "_is_guest_by_ugw": false,
        "gw_mac": "00:00:00:00:01:13",
        "network": "Cameras",
        "tx_bytes": 0,
        "rx_bytes": 0,
        "tx_packets": 0,
        "rx_packets": 0,
        "bytes-r": 0,
        "tx_bytes-r": 0,
        "rx_bytes-r": 0,
        "_uptime_by_usw": 155970,
        "_last_seen_by_usw": 1651066316,
        "_is_guest_by_usw": false,
        "sw_mac": "00:00:00:00:01:13",
        "sw_depth": 0,
        "sw_port": 11,
        "wired_rate_mbps": 10000
      },
      "00:00:00:00:00:01": {
        "site_id": "5ddfb6dc2664520220877cf8",
        "assoc_time": 1650910347,
        "latest_assoc_time": 1651005197,
        "oui": "Ubiquiti",
        "user_id": "5e48b10ff583e6034c04c87a",
        "_id": "5e48b10ff583e6034c04c87a",
        "mac": "00:00:00:00:00:01",
        "is_guest": false,
        "first_seen": 1581822223,
        "last_seen": 1651066316,
        "is_wired": true,
        "hostname": "08---Living-Room",
        "fingerprint_source": 4,
        "dev_cat": 57,
        "dev_family": 35,
        "os_name": 1,
        "dev_vendor": 234,
        "dev_id": 2636,
        "fw_version": "UVC.S2L.v4.49.9.67.8366a5d.220323.1040",
        "confidence": 100,
        "use_fixedip": true,
        "network_id": "5e496f4ef583e6034c04f2f9",
        "fixed_ip": "10.0.250.108",
        "noted": false,
        "blocked": false,
        "fingerprint_engine_version": "0.0.0",
        "product_line": "unifi-protect",
        "product_model": "Camera G3 Flex",
        "icon_filename": "6bfdcbc0-4ed5-47af-a840-4d7003017aee",
        "icon_resolutions": [
          [
            129,
            129
          ],
          [
            257,
            257
          ],
          [
            25,
            25
          ],
          [
            51,
            51
          ],
          [
            101,
            101
          ]
        ],
        "disconnect_timestamp": 1650305245,
        "unifi_device_info_from_ucore": {
          "name": "08---Living-Room",
          "computed_model": "G3 Flex",
          "device_state": "CONNECTED",
          "product_line": "PROTECT",
          "product_model": "G3 Flex",
          "product_shortname": "UVC G3 Flex",
          "icon_filename": "6bfdcbc0-4ed5-47af-a840-4d7003017aee",
          "icon_resolutions": [
            [
              25,
              25
            ],
            [
              51,
              51
            ],
            [
              101,
              101
            ],
            [
              129,
              129
            ],
            [
              257,
              257
            ]
          ],
          "icons": [
            {
              "width": 25,
              "height": 25,
              "url": "https://static.ui.com/fingerprint/ui/icons/6bfdcbc0-4ed5-47af-a840-4d7003017aee_25x25.png"
            },
            {
              "width": 51,
              "height": 51,
              "url": "https://static.ui.com/fingerprint/ui/icons/6bfdcbc0-4ed5-47af-a840-4d7003017aee_51x51.png"
            },
            {
              "width": 101,
              "height": 101,
              "url": "https://static.ui.com/fingerprint/ui/icons/6bfdcbc0-4ed5-47af-a840-4d7003017aee_101x101.png"
            },
            {
              "width": 129,
              "height": 129,
              "url": "https://static.ui.com/fingerprint/ui/icons/6bfdcbc0-4ed5-47af-a840-4d7003017aee_129x129.png"
            },
            {
              "width": 257,
              "height": 257,
              "url": "https://static.ui.com/fingerprint/ui/icons/6bfdcbc0-4ed5-47af-a840-4d7003017aee_257x257.png"
            }
          ],
          "fw_version": "UVC.S2L.v4.49.9.67.8366a5d.220323.1040",
          "fw_status": "UP_TO_DATE",
          "managed": true
        },
        "_uptime_by_ugw": 155969,
        "_last_seen_by_ugw": 1651066316,
        "_is_guest_by_ugw": false,
        "gw_mac": "00:00:00:00:01:13",
        "network": "Cameras",
        "satisfaction_avg": {
          "total": 4009100,
          "count": 40137
        },
        "uptime": 155969,
        "wired-tx_bytes": 0,
        "wired-rx_bytes": 0,
        "wired-tx_packets": 0,
        "wired-rx_packets": 0,
        "wired-tx_bytes-r": 0,
        "wired-rx_bytes-r": 0,
        "tx_retries": 0,
        "wifi_tx_attempts": 0,
        "qos_policy_applied": true,
        "_uptime_by_usw": 155969,
        "_last_seen_by_usw": 1651066316,
        "_is_guest_by_usw": false,
        "sw_mac": "00:00:00:00:01:08",
        "sw_depth": 1,
        "sw_port": 2,
        "wired_rate_mbps": 10000,
        "hostname_source": "ubios",
        "anomalies": -1,
        "ip": "10.0.250.108",
        "satisfaction": 100,
        "eagerly_discovered": null
      },
    "00:00:00:00:00:05": {
        "site_id": "5ddfb6dc2664520220877cf8",
        "assoc_time": 1650910344,
        "latest_assoc_time": 1650963784,
        "oui": "Ubiquiti Inc.",
        "user_id": "6116842bb61f5d0bef37c0f5",
        "_id": "6116842bb61f5d0bef37c0f5",
        "mac": "00:00:00:00:00:05",
        "is_guest": false,
        "first_seen": 1628865567,
        "last_seen": 1651066316,
        "is_wired": true,
        "usergroup_id": "",
        "hostname": "",
        "fingerprint_source": 4,
        "fw_version": "2.4.8",
        "fingerprint_engine_version": "0.0.0",
        "product_line": "unifi-protect",
        "product_model": "Network Video Recorder Pro",
        "icon_filename": "3c1a4721-cf28-43d9-9cd6-b612622b7788",
        "icon_resolutions": [
          [
            129,
            129
          ],
          [
            101,
            101
          ],
          [
            25,
            25
          ],
          [
            51,
            51
          ],
          [
            257,
            257
          ]
        ],
        "disconnect_timestamp": 1649444833,
        "name": "00---UNVR-Pro",
        "noted": true,
        "use_fixedip": true,
        "network_id": "5e496f4ef583e6034c04f2f9",
        "fixed_ip": "10.0.250.250",
        "blocked": false,
        "unifi_device_info_from_ucore": {
          "name": "Hallhousehold-UNVR-Pro-Cathay",
          "computed_model": "UNVR Pro",
          "device_state": "CONNECTED",
          "product_line": "UNKNOWN",
          "product_model": "UNVR Pro",
          "product_shortname": "UNVR-PRO",
          "icon_filename": "3c1a4721-cf28-43d9-9cd6-b612622b7788",
          "icon_resolutions": [
            [
              25,
              25
            ],
            [
              51,
              51
            ],
            [
              101,
              101
            ],
            [
              129,
              129
            ],
            [
              257,
              257
            ]
          ],
          "icons": [
            {
              "width": 25,
              "height": 25,
              "url": "https://static.ui.com/fingerprint/ui/icons/3c1a4721-cf28-43d9-9cd6-b612622b7788_25x25.png"
            },
            {
              "width": 51,
              "height": 51,
              "url": "https://static.ui.com/fingerprint/ui/icons/3c1a4721-cf28-43d9-9cd6-b612622b7788_51x51.png"
            },
            {
              "width": 101,
              "height": 101,
              "url": "https://static.ui.com/fingerprint/ui/icons/3c1a4721-cf28-43d9-9cd6-b612622b7788_101x101.png"
            },
            {
              "width": 129,
              "height": 129,
              "url": "https://static.ui.com/fingerprint/ui/icons/3c1a4721-cf28-43d9-9cd6-b612622b7788_129x129.png"
            },
            {
              "width": 257,
              "height": 257,
              "url": "https://static.ui.com/fingerprint/ui/icons/3c1a4721-cf28-43d9-9cd6-b612622b7788_257x257.png"
            }
          ],
          "fw_version": "2.3.16",
          "fw_status": "UP_TO_DATE",
          "managed": true
        },
        "_uptime_by_ugw": 155971,
        "_last_seen_by_ugw": 1651066316,
        "_is_guest_by_ugw": false,
        "gw_mac": "00:00:00:00:01:13",
        "network": "Cameras",
        "satisfaction_avg": {
          "total": 3967400,
          "count": 39720
        },
        "uptime": 155972,
        "wired-tx_bytes": 432978,
        "wired-rx_bytes": 180945,
        "wired-tx_packets": 1375,
        "wired-rx_packets": 2197,
        "wired-tx_bytes-r": 83,
        "wired-rx_bytes-r": 135,
        "tx_retries": 0,
        "wifi_tx_attempts": 0,
        "qos_policy_applied": true,
        "_uptime_by_usw": 155971,
        "_last_seen_by_usw": 1651066316,
        "_is_guest_by_usw": false,
        "sw_mac": "00:00:00:00:01:08",
        "sw_depth": 1,
        "sw_port": 8,
        "wired_rate_mbps": 10000,
        "hostname_source": "ubios",
        "ip": "10.0.250.250",
        "anomalies": -1,
        "satisfaction": 100,
        "eagerly_discovered": null
      },
    "00:00:00:00:00:09": {
        "site_id": "5ddfb6dc2664520220877cf8",
        "assoc_time": 1650910349,
        "latest_assoc_time": 1651005196,
        "oui": "Ubiquiti",
        "user_id": "6096bf7f1c69a30ba8223aed",
        "_id": "6096bf7f1c69a30ba8223aed",
        "mac": "00:00:00:00:00:09",
        "is_guest": false,
        "first_seen": 1620492159,
        "last_seen": 1651066316,
        "is_wired": true,
        "fingerprint_source": 4,
        "dev_cat": 57,
        "dev_family": 35,
        "os_name": 1,
        "dev_vendor": 234,
        "dev_id": 4206,
        "confidence": 100,
        "fingerprint_engine_version": "0.0.0",
        "hostname": "21---BBQ-Grills",
        "use_fixedip": true,
        "network_id": "5e496f4ef583e6034c04f2f9",
        "fixed_ip": "10.0.250.121",
        "noted": false,
        "usergroup_id": "",
        "blocked": false,
        "fw_version": "UVC.S5L.v4.49.9.67.8366a5d.220323.1203",
        "product_line": "unifi-protect",
        "product_model": "Camera G4 Bullet",
        "icon_filename": "f7d8d4e4-243c-45c0-996d-9d6244cde198",
        "icon_resolutions": [
          [
            101,
            101
          ],
          [
            51,
            51
          ],
          [
            25,
            25
          ],
          [
            257,
            257
          ],
          [
            129,
            129
          ]
        ],
        "disconnect_timestamp": 1644416650,
        "unifi_device_info_from_ucore": {
          "name": "21---BBQ-Grills",
          "computed_model": "G4 Bullet",
          "device_state": "CONNECTED",
          "product_line": "PROTECT",
          "product_model": "G4 Bullet",
          "product_shortname": "UVC G4 Bullet",
          "icon_filename": "f7d8d4e4-243c-45c0-996d-9d6244cde198",
          "icon_resolutions": [
            [
              25,
              25
            ],
            [
              51,
              51
            ],
            [
              101,
              101
            ],
            [
              129,
              129
            ],
            [
              257,
              257
            ]
          ],
          "icons": [
            {
              "width": 25,
              "height": 25,
              "url": "https://static.ui.com/fingerprint/ui/icons/f7d8d4e4-243c-45c0-996d-9d6244cde198_25x25.png"
            },
            {
              "width": 51,
              "height": 51,
              "url": "https://static.ui.com/fingerprint/ui/icons/f7d8d4e4-243c-45c0-996d-9d6244cde198_51x51.png"
            },
            {
              "width": 101,
              "height": 101,
              "url": "https://static.ui.com/fingerprint/ui/icons/f7d8d4e4-243c-45c0-996d-9d6244cde198_101x101.png"
            },
            {
              "width": 129,
              "height": 129,
              "url": "https://static.ui.com/fingerprint/ui/icons/f7d8d4e4-243c-45c0-996d-9d6244cde198_129x129.png"
            },
            {
              "width": 257,
              "height": 257,
              "url": "https://static.ui.com/fingerprint/ui/icons/f7d8d4e4-243c-45c0-996d-9d6244cde198_257x257.png"
            }
          ],
          "fw_version": "UVC.S5L.v4.49.9.67.8366a5d.220323.1203",
          "fw_status": "UP_TO_DATE",
          "managed": true
        },
        "_uptime_by_ugw": 155967,
        "_last_seen_by_ugw": 1651066316,
        "_is_guest_by_ugw": false,
        "gw_mac": "00:00:00:00:01:13",
        "network": "Cameras",
        "satisfaction_avg": {
          "total": 4010600,
          "count": 40142
        },
        "uptime": 155967,
        "wired-tx_bytes": 0,
        "wired-rx_bytes": 0,
        "wired-tx_packets": 0,
        "wired-rx_packets": 0,
        "wired-tx_bytes-r": 0,
        "wired-rx_bytes-r": 0,
        "tx_retries": 0,
        "wifi_tx_attempts": 0,
        "qos_policy_applied": true,
        "_uptime_by_usw": 155967,
        "_last_seen_by_usw": 1651066316,
        "_is_guest_by_usw": false,
        "sw_mac": "00:00:00:00:01:09",
        "sw_depth": 2,
        "sw_port": 4,
        "wired_rate_mbps": 1000,
        "hostname_source": "ubios",
        "anomalies": -1,
        "ip": "10.0.250.121",
        "satisfaction": 100,
        "eagerly_discovered": null
      },
      "00:00:00:00:00:10": {
        "site_id": "5ddfb6dc2664520220877cf8",
        "assoc_time": 1650910346,
        "latest_assoc_time": 1650963783,
        "oui": "Ubiquiti Inc.",
        "user_id": "5f57a52c4dde44068d3a0250",
        "_id": "5f57a52c4dde44068d3a0250",
        "mac": "00:00:00:00:00:10",
        "is_guest": false,
        "first_seen": 1599579436,
        "last_seen": 1651066313,
        "is_wired": false,
        "hostname": "15---Garage-Back-Yard-Door",
        "fingerprint_override": true,
        "dev_id_override": 2641,
        "fingerprint_source": 4,
        "dev_cat": 57,
        "dev_family": 35,
        "os_name": 1,
        "dev_vendor": 234,
        "dev_id": 2641,
        "confidence": 100,
        "blocked": false,
        "fingerprint_engine_version": "0.0.0",
        "use_fixedip": true,
        "network_id": "5e496f4ef583e6034c04f2f9",
        "fixed_ip": "10.0.250.115",
        "noted": false,
        "fw_version": "UVC.S2LM.v4.49.9.67.8366a5d.220323.1110",
        "product_line": "unifi-protect",
        "product_model": "Camera G3 Micro",
        "icon_filename": "aea0b2dd-53a7-4a01-9057-d4278f7430bc",
        "icon_resolutions": [
          [
            101,
            101
          ],
          [
            129,
            129
          ],
          [
            25,
            25
          ],
          [
            257,
            257
          ],
          [
            51,
            51
          ]
        ],
        "disconnect_timestamp": 1650963685,
        "unifi_device_info_from_ucore": {
          "name": "15---Garage-Back-Yard-Door",
          "computed_model": "G3 Micro",
          "device_state": "CONNECTED",
          "product_line": "PROTECT",
          "product_model": "G3 Micro",
          "product_shortname": "UVC G3 Micro",
          "icon_filename": "aea0b2dd-53a7-4a01-9057-d4278f7430bc",
          "icon_resolutions": [
            [
              25,
              25
            ],
            [
              51,
              51
            ],
            [
              101,
              101
            ],
            [
              129,
              129
            ],
            [
              257,
              257
            ]
          ],
          "icons": [
            {
              "width": 25,
              "height": 25,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_25x25.png"
            },
            {
              "width": 51,
              "height": 51,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_51x51.png"
            },
            {
              "width": 101,
              "height": 101,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_101x101.png"
            },
            {
              "width": 129,
              "height": 129,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_129x129.png"
            },
            {
              "width": 257,
              "height": 257,
              "url": "https://static.ui.com/fingerprint/ui/icons/aea0b2dd-53a7-4a01-9057-d4278f7430bc_257x257.png"
            }
          ],
          "fw_version": "UVC.S2LM.v4.49.9.67.8366a5d.220323.1110",
          "fw_status": "UP_TO_DATE",
          "managed": true
        },
        "name": "",
        "usergroup_id": "",
        "fixed_ap_enabled": false,
        "fixed_ap_mac": "00:00:00:00:01:07",
        "_uptime_by_usw": 155969,
        "_last_seen_by_usw": 1651066316,
        "_is_guest_by_usw": false,
        "sw_mac": "00:00:00:00:01:08",
        "sw_depth": 1,
        "sw_port": 2,
        "wired_rate_mbps": 10000,
        "hostname_source": "ubios",
        "anomalies": -1,
        "satisfaction_avg": {
          "total": 4900328,
          "count": 51006
        },
        "uptime": 155967,
        "_uptime_by_ugw": 155969,
        "_last_seen_by_ugw": 1651066316,
        "_is_guest_by_ugw": false,
        "gw_mac": "00:00:00:00:01:13",
        "network": "Cameras",
        "tx_bytes": 0,
        "rx_bytes": 0,
        "tx_packets": 0,
        "rx_packets": 0,
        "tx_bytes-r": 0,
        "rx_bytes-r": 0,
        "qos_policy_applied": true,
        "_uptime_by_uap": 104380,
        "_last_seen_by_uap": 1651066313,
        "_is_guest_by_uap": false,
        "ap_mac": "00:00:00:00:01:07",
        "channel": 100,
        "radio": "na",
        "radio_name": "wifi1",
        "essid": "**REDACTED**",
        "bssid": "**REDACTED**",
        "powersave_enabled": false,
        "is_11r": false,
        "wlanconf_id": "5e9b9b46fbc902033e812ed9",
        "user_group_id_computed": "5ddfb6e02664520220877d0a",
        "anon_client_id": "5080ffbd9dfe218fc8bac3687cbf79",
        "ccq": 545,
        "dhcpend_time": 370,
        "idletime": 1,
        "ip": "10.0.250.115",
        "noise": -110,
        "nss": 1,
        "rx_rate": 58500,
        "rssi": 26,
        "satisfaction": 96,
        "satisfaction_now": 96,
        "satisfaction_real": 96,
        "satisfaction_reason": 2,
        "signal": -70,
        "tx_mcs": -1,
        "tx_power": 48,
        "tx_rate": 72200,
        "vlan": 0,
        "radio_proto": "na",
        "tx_retries": 307931,
        "wifi_tx_attempts": 8816615,
        "eagerly_discovered": null,
        "bytes-r": null
      },
      "00:00:00:00:00:11": {
        "site_id": "5ddfb6dc2664520220877cf8",
        "assoc_time": 1650910345,
        "latest_assoc_time": 1650963788,
        "oui": "Ubiquiti Inc.",
        "user_id": "60e4b5e77b88f950af28507a",
        "_id": "60e4b5e77b88f950af28507a",
        "mac": "00:00:00:00:00:11",
        "is_guest": false,
        "first_seen": 1625601511,
        "last_seen": 1651066316,
        "is_wired": true,
        "usergroup_id": "",
        "hostname": "25---Front-Left-360",
        "fingerprint_source": 4,
        "dev_cat": 207,
        "dev_family": 137,
        "os_name": 1,
        "dev_vendor": 234,
        "dev_id": 4238,
        "confidence": 5,
        "fingerprint_engine_version": "0.0.0",
        "fw_version": "UVC.CV2X.v4.49.9.67.8366a5d.220323.1204",
        "product_line": "unifi-protect",
        "product_model": "AI 360 Camera",
        "icon_filename": "19294b80-0922-4a83-b5c5-1022ca22764a",
        "icon_resolutions": [
          [
            129,
            129
          ],
          [
            25,
            25
          ],
          [
            51,
            51
          ],
          [
            101,
            101
          ],
          [
            257,
            257
          ]
        ],
        "blocked": false,
        "use_fixedip": true,
        "network_id": "5e496f4ef583e6034c04f2f9",
        "fixed_ip": "10.0.250.125",
        "noted": false,
        "disconnect_timestamp": 1644416650,
        "_uptime_by_ugw": 155971,
        "_last_seen_by_ugw": 1651066316,
        "_is_guest_by_ugw": false,
        "gw_mac": "00:00:00:00:01:13",
        "network": "Cameras",
        "satisfaction_avg": {
          "total": 4009800,
          "count": 40138
        },
        "uptime": 155971,
        "wired-tx_bytes": 0,
        "wired-rx_bytes": 0,
        "wired-tx_packets": 0,
        "wired-rx_packets": 0,
        "wired-tx_bytes-r": 0,
        "wired-rx_bytes-r": 0,
        "tx_retries": 0,
        "wifi_tx_attempts": 0,
        "qos_policy_applied": true,
        "_uptime_by_usw": 155971,
        "_last_seen_by_usw": 1651066316,
        "_is_guest_by_usw": false,
        "sw_mac": "00:00:00:00:01:10",
        "sw_depth": 2,
        "sw_port": 4,
        "wired_rate_mbps": 1000,
        "hostname_source": "ubios",
        "anomalies": -1,
        "ip": "10.0.250.125",
        "satisfaction": 100,
        "eagerly_discovered": null
      },
}

config_entry-unifi-3e2c6e36f370b4103aa665013021652e.json.txt
home-assistant/core#70910

Add ability to Enable/Disable DPI restrictions

We recently caught my daughter watching YouTube on her Chromebook while supposed to be in school, I created a DPI filter to block streaming media on the VLAN her machine is connected to. It works well, but would be nice to enable Home Assistant to import these configurations and expose a switch to enable/disable the block so I can create automations around it. Happy to open a PR eventually (unless you want to take a stab at it), but figured I would create this issue with the API details to start.

The below are called together to fetch the DPI Restriction Definitions:

GET /api/s/default/rest/dpigroup

{
	"meta": {
		"rc": "ok"
	},
	"data": [{
		"_id": "5ba29dd8e3c58f026e9d7c4a",
		"attr_no_delete": true,
		"attr_hidden_id": "Default",
		"name": "Default",
		"site_id": "5ba29dd4e3c58f026e9d7c38"
	}, {
		"_id": "5f976f4ae3c58f018ec7dff6",
		"name": "No Media",
		"site_id": "5ba29dd4e3c58f026e9d7c38",
		"dpiapp_ids": ["5f976f62e3c58f018ec7e17d"]
	}]
}

GET /api/s/default/rest/dpiapp

{
	"meta": {
		"rc": "ok"
	},
	"data": [{
		"_id": "5f976f62e3c58f018ec7e17d",
		"apps": [],
		"blocked": true,
		"cats": ["4"],
		"enabled": true,
		"log": true,
		"site_id": "5ba29dd4e3c58f026e9d7c38"
	}]
}

The below are called together to update the DPI Restriction Definitions:

PUT /api/s/default/rest/dpigroup/{dpigroup_id}
Request

{
	"_id": "5f976f4ae3c58f018ec7dff6",
	"name": "No Media",
	"site_id": "5ba29dd4e3c58f026e9d7c38",
	"dpiapp_ids": ["5f976f62e3c58f018ec7e17d"]
}

Response

{
	"meta": {
		"rc": "ok"
	},
	"data": []
}

PUT /api/s/default/rest/dpiapp/{dpiapp_id}
Request

{
	"_id": "5f976f62e3c58f018ec7e17d",
	"apps": [],
	"blocked": true,
	"cats": ["4"],
	"enabled": false,
	"log": true,
	"site_id": "5ba29dd4e3c58f026e9d7c38"
}

Response

{
	"meta": {
		"rc": "ok"
	},
	"data": [{
		"_id": "5f976f62e3c58f018ec7e17d",
		"apps": [],
		"blocked": true,
		"cats": ["4"],
		"enabled": false,
		"log": true,
		"site_id": "5ba29dd4e3c58f026e9d7c38"
	}]
}

[Feature Request] Include additional client attributes

Unifi provides several other attributes that can be used for automation. One that I am particularly interested in is the Activity indicator.

image

The activity indicator indicates the current level of activity for the client. It can be used to, for example, monitor specific devices.

Unsupported event key EVT_DM_Connected

A new warning was showing up which I haven't seen before. I don't recall what was going on and don't see any errors in the Unifi console logs. It's running Unifi OS 3.0.19 beta firmware and Unifi network 7.4.146

Unsupported event key EVT_DM_Connected
Unsupported event {'key': 'EVT_DM_Connected', 'dm': '74:ac:b9:XX:XX:XX', 'gw': '74:ac:b9:XX:XX:XX, 'dm_name': 'UDM XXX', 'dm_model': 'UDMPRO', 'dm_displayName': 'UDM Huysackers', 'gw_displayName': 'UDM XXX', 'subsystem': 'lan', 'is_negative': False, 'site_id': '60dee48f657XXX7', 'time': 1681829649586, 'datetime': '2023-04-18T14:54:09Z', 'msg': '74:ac:b9::XX:XX:XX was connected', '_id': '643eaf127ccaa6694XXXXX'}

Upon googling, it's mentioned in home-assistant/core#84251 but couldn't find any other occurrence.

Warnings on portforward sync

Steps to reproduce

  1. Go to Unifi Network
  2. Go to Firewall & security
  3. Enable or disable an existing port forwarding rule
  4. Check home assistant system log

This emits a warning upon saving:
2023-06-23 13:26:51.694 WARNING (MainThread) [aiounifi.models.message] Unsupported message key portforward:sync
2023-06-23 13:26:51.694 WARNING (MainThread) [aiounifi.models.message] Unsupported message {'meta': {'rc': 'ok', 'message': 'portforward:sync'}, 'data': {'pfwd_interface': 'wan', 'fwd': '192.168.178.XXX', 'destination_ip': 'any', 'src': 'any', 'log': False, 'proto': 'tcp', 'name': 'Certbot', 'dst_port': '80', 'site_id': 'XXX', '_id': 'XXX', 'fwd_port': '80', 'enabled': True}}

Versions:
Unifi OS: 3.1.9 on UDM PRO
Network: Unifi Network Application 7.4.156
Home Assistant: 2023.6.2

It makes sense as models/message.py does not include portforward:sync in the MessageKey class, so are you OK if I submit a PR to include portforward?

Now the other part is perhaps to assess what value it brings to Home Assistant user if you update / create a port forwarding. E.g. is a user going to use it in an automation? So perhaps the warning should be a changed to debug or just info? Seeing it's harmless.

Add support for Unifi Smart Power devices

Creating ticket as requested here, home-assistant/core#71531

Let me know what info you need. Happy to provide whatever is needed. Will just mention there are(as far as Im aware 2 different devices),
Single Outlet: https://store.ui.com/collections/unifi-accessories/products/unifi-smart-power
Strip: https://store.ui.com/collections/unifi-accessories/products/smartpower-strip

I have both of them(2 outlets, and 1 strip) so can provide whatever information is needed on either in case they different slightly

Help running tests

Hi, I have been using this library for some automations around my unifi controller and it is awesome. I was attempting to add some functionality and hit an issue running the test suite. when I run pytest I get the warning async def functions are not natively supported I see that asynio-0.14.0 is installed but the marker is not used on the tests. Is there a setup step that I missed? Sorry is this is an obvious question. Thank you!

Commands that I ran

pip install -r requirements_tests.txt
pytest

New message in Early Access firmware - session-metadata:sync

There appears to be a new message showing up in the websocket stream in the early-access versions of the API. I believe all this does is provide the UI information to highlight the computer you are on when viewing various aspects of the interface.

2023-08-15 19:24:55.508 WARNING (MainThread) [aiounifi.models.message] Unsupported message key session-metadata:sync
2023-08-15 19:24:55.515 WARNING (MainThread) [aiounifi.models.message] Unsupported message {'meta': {'message': 'session-metadata:sync', 'rc': 'ok'}, 'data': {'client_mac': '11:22:33:44:55:66}}

EVT_GW_WANTransition missing event

Not sure if this is still applicable since your changes in #205

EVT_GW_WANTransition is one I've seen as warning when there was a WAN problem.

Full messages:

Unsupported event key EVT_GW_WANTransition
Unsupported event {'gw': '74:ac:b9:58:b9:ce', 'iface': 'eth8', 'state': 'active', 'key': 'EVT_GW_WANTransition', 'dm': '74:ac:b9:58:b9:ce', 'dm_name': 'UDM XXXX', 'dm_model': 'UDMPRO', 'dm_displayName': 'UDM XXXX', 'gw_displayName': 'UDM XXXX', 'subsystem': 'lan', 'is_negative': False, 'site_id': '60dee48f6573ae03e1f837d7', 'time': 1665651169000, 'datetime': '2022-10-13T08:52:49Z', 'msg': 'Gateway[74:ac:b9:58:b9:cf] WAN iface eth8 transition to state active', '_id': '6347d1e1b17ae55c1341d2df'}

Unsupported event key EVT_GW_WANTransition

This event fires when the WAN connection fails over between interfaces.

Unsupported event {'gw': 'd0:21:f9:74:d2:0e', 'iface': 'eth0', 'state': 'active', 'key': 'EVT_GW_WANTransition', 'xg': 'd0:21:f9:74:d2:0e', 'xg_name': 'UXG Pro', 'xg_model': 'UXGPRO', 'gw_displayName': 'UXG Pro', 'xg_displayName': 'UXG Pro', 'subsystem': 'lan', 'is_negative': False, 'site_id': '<snip>', 'time': 1667404684000, 'datetime': '2022-11-02T15:58:04Z', 'msg': 'Gateway[d0:21:f9:74:d2:0e] WAN iface eth0 transition to state active', '_id': '6362938cb7ab837f6672a260'}
Unsupported event {'gw': 'd0:21:f9:74:d2:0e', 'iface': 'eth1', 'state': 'inactive', 'key': 'EVT_GW_WANTransition', 'xg': 'd0:21:f9:74:d2:0e', 'xg_name': 'UXG Pro', 'xg_model': 'UXGPRO', 'gw_displayName': 'UXG Pro', 'xg_displayName': 'UXG Pro', 'subsystem': 'lan', 'is_negative': False, 'site_id': '<snip>', 'time': 1667404685000, 'datetime': '2022-11-02T15:58:05Z', 'msg': 'Gateway[d0:21:f9:74:d2:0e] WAN iface eth1 transition to state inactive', '_id': '6362938db7ab837f6672a261'}

EVT_WU_RoamRadio should be included in list of wireless client events

It doesn't look common, but I received these events together with no intervening EVT_WU_Connected event:

2020-04-27 19:58:51 DEBUG (MainThread) [aiounifi.websocket] {"meta":{"rc":"ok","message":"events"},"data":[{"user":"<<user_mac>>","ssid":"<>","hostname":"<>","ap":"<<ap_mac>>","duration":477,"bytes":19130891,"key":"EVT_WU_Disconnected","subsystem":"wlan","site_id":"<<site_id>>","time":1588042724000,"datetime":"2020-04-28T02:58:44Z","msg":"User[<<user_mac>>] disconnected from "<>" (7m 57s<<site_id>> connected, 18.24M bytes, last AP[<<ap_mac>>])","_id":"5ea79be852faff00f29407d2"},{"ap":"<<ap_mac>>","user":"<<user_mac>>","radio_from":"na","radio_to":"ng","channel_from":"36","channel_to":"11","key":"EVT_WU_RoamRadio","subsystem":"wlan","site_id":"<<site_id>>","time":1588042728065,"datetime":"2020-04-28T02:58:48Z","msg":"User[<<user_mac>>] roams from "channel 36(na)" to "channel 11(ng)" at AP[<<ap_mac>>]","_id":"5ea79be852faff00f29407d4"}]}

The result in Home Assistant is that wireless_connection was False, preventing the clearing of cancel_scheduled_update, causing my device to be set as not_home.

I think EVT_WU_RoamRadio should be included as a wireless client event so it can be picked up in HA.

Feature > Add support additional client attributes

I'm not great at python, but it looks like there are many attributes missing from the clients "library" here, which ultimately could be useful to have exposed, especially upstream in Home Assistant, to drive some advanced automations. I'm very interested in having access to powersave_enabled, but could also use idletime and _last_seen_by_uap.

Here's an API implementation in Go, which has everything I know of documented. I couldn't find this officially for some reason.

Could you add these? Thank you!

Switch to control whether or not needed firmware updates are shown

I have found a version of Ubiquiti firmware that works for me and is stable and allows all my integrations to work. As such, I have stopped upgrading the firmware, and won't upgrade it unless some feature that I simply cannot live without requires it (like the addition of a new piece of hardware, for example).

This integration currently displays firmware updates that are needed (and presumably allows for the upgrade to be performed?) in the Updates view under settings. Because of this, I perpetually have an orange circle with a number in it on my Settings tab on the sidebar.

It would be wonderful if there were a checkbox in the integration config that would allow a user to enable/disable displaying of firmware updates needed.

Thank you for all your hard work on this integration, it really is great!

Unsupported event EVT_GW_AutoReadopted

Unsupported event key EVT_GW_AutoReadopted
Unsupported event {'key': 'EVT_GW_AutoReadopted', 'gw': 'f0:xxxxxx', 'gw_name': 'USG Router', 'gw_model': 'UGW3', 'gw_displayName': 'USG Router', 'subsystem': 'lan', 'is_negative': False, 'site_id': 'xxxxxxx', 'time': xxxx, 'datetime': '2022-12-02T01:06:25Z', 'msg': 'Gateway[f0:xxxx] was automatically readopted', '_id': 'xxxx'}

Home Assistant Version: 2022.11.5

Frequent error in switch.py in homeassistant logs.

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 275, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 309, in _async_write_ha_state
state = self.state
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 576, in state
return STATE_ON if self.is_on else STATE_OFF
File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 204, in is_on
return self.port.poe_mode != "off"
File "/usr/src/homeassistant/homeassistant/components/unifi/switch.py", line 249, in port
return self.device.ports[self.client.sw_port]
AttributeError: 'NoneType' object has no attribute 'ports'
2019-12-09 04:29:24 ERROR (MainThread) [aiounifi.api] Couldn't find key: 'None'
2019-12-09 04:29:24 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved

WAN IP

Moving query from home-assistant/core#99307 here as requested.

Could I ask if the IP attribute of my UDM device_tracker entity (the WAN address) is obtained via the same way you're getting the temperature of the device?

The reason I ask is that I recently added an LTE-PRO to my setup. If I force a failover to the LTE, the IP attribute doesn't seem to update. I'm having to use DNS IP integration which is cloud dependant and adds latency as it requires my UDM to update DDNS and then the integration to detect the change in 2 minutes intervals. While I'm notified of the failover event within ~5 minutes I was curious if the WAN IP was available locally in a similar way to this PR?

Unsupported message type in DEBUG Logs

I had debug logging on while trying to diagnose the HA integration.

Got that working. Now I'm seeing some messages that look like errors but are reported as debug in the logs.

In my logs I am seeing "Unsupported message type" followed by another line with the same message formatted differently.

Log posted:

2020-05-01 10:35:43 DEBUG (MainThread) [aiounifi.controller] Unsupported message type {'meta': {'rc': 'ok', 'message': 'device:update', 'mac': '***REDACTED***'}, 'data': [{'model_eol_date': None}]}
2020-05-01 10:36:09 DEBUG (MainThread) [aiounifi.websocket] {"meta":{"rc":"ok","message":"device:update","mac":"***REDACTED***"},"data":[{"model_eol_date":null}]}

2020-05-01 10:35:43 DEBUG (MainThread) [aiounifi.controller] Unsupported message type {'meta': {'rc': 'ok', 'message': 'device:update', 'mac': '***REDACTED***'}, 'data': [{'model_eol_version': None}]}
2020-05-01 10:36:09 DEBUG (MainThread) [aiounifi.websocket] {"meta":{"rc":"ok","message":"device:update","mac":"***REDACTED***"},"data":[{"model_eol_version":null}]}

2020-05-01 10:35:43 DEBUG (MainThread) [aiounifi.controller] Unsupported message type {'meta': {'rc': 'ok', 'message': 'device:update', 'mac': '***REDACTED***'}, 'data': [{'storage': [{'mount_point': '/mnt/persistent', 'name': 'Backup', 'size': 125783040, 'type': 'eMMC', 'used': 1588224}, {'mount_point': '/mnt/data', 'name': 'eMMC', 'size': 13097209856, 'type': 'eMMC', 'used': 1091309568}, {'mount_point': '/tmp', 'name': 'Temporary', 'size': 982810624, 'type': 'other', 'used': 233472}]}]}
2020-05-01 10:36:09 DEBUG (MainThread) [aiounifi.websocket] {"meta":{"rc":"ok","message":"device:update","mac":"***REDACTED***"},"data":[{"storage":[{"mount_point":"/mnt/persistent","name":"Backup","size":125783040,"type":"eMMC","used":1588224},{"mount_point":"/mnt/data","name":"eMMC","size":13097209856,"type":"eMMC","used":1093271552},{"mount_point":"/tmp","name":"Temporary","size":982810624,"type":"other","used":237568}]}]}

2020-05-01 10:35:44 DEBUG (MainThread) [aiounifi.controller] Unsupported message type {'meta': {'rc': 'ok', 'message': 'device:update', 'mac': '***REDACTED***'}, 'data': [{'temperatures': [{'name': 'Local', 'type': 'board', 'value': 70.0}, {'name': 'CPU', 'type': 'cpu', 'value': 80.0}]}]}
2020-05-01 10:35:44 DEBUG (MainThread) [aiounifi.websocket] {"meta":{"rc":"ok","message":"device:update","mac":"***REDACTED***"},"data":[{"temperatures":[{"name":"Local","type":"board","value":70.0},{"name":"CPU","type":"cpu","value":80.0}]}]}

Unifi OSv3 / Network Version 7.4.145 features

I would love to see some features of Unifi Network Version 7.4 / Unifi OS version 3 integrated into this integration.

I'm personally particularly interested in the following features:

  1. Control of traffic management functions
  2. Control of Smart Queues
  3. Reading of WAN health stats

I am happy to do some digging around in the Unifi UI to help figure out API endpoints etc. Is this something that would make sense to add here (and ultimately in the Home Assistant integration)?

Unsupported event keys

Hi there,

I'm using the UniFi-Network integration in HomeAssistant and encounter warning messages in my system's logs which, i suppose, originate from unsupported event keys! Due to the fact that the logger logging this message is aiounifi.models.event I thought this might be a problem of the underlying library, not HA core - so here I am!

The messages I get are:

Unsupported event {'guest': '<guest_mac>', 'key': 'EVT_WG_AuthorizationEnded', 'subsystem': 'wlan', 'is_negative': False, 'site_id': '<site_id>', 'time': 1677593579225, 'datetime': '2023-02-28T14:12:59Z', 'msg': 'Guest[<guest_mac>] has become unauthorized', '_id': '63fe0beb4a36f60dcf25a3da'}

... and:

Unsupported event {'code': '<voucher_used>', 'guest': '<guest_mac>', 'key': 'EVT_HS_VoucherUsed', 'subsystem': 'wlan', 'is_negative': False, 'site_id': '<site_id>', 'time': 1677591001035, 'datetime': '2023-02-28T13:30:01Z', 'msg': 'Voucher[<voucher_used>] was used by Guest[<guest_mac>]', '_id': '63fe01d94a36f60dcf257c78'}

It seems as if this library is currently not supporting the events EVT_WG_AuthorizationEnded and EVT_HS_VoucherUsed.
I would love it, if anybody with more knowledge in python than I have, could implement those events!

Thanks a lot! ❤

Kind regards
Linus

Unsupported message key user:sync

Seeing this message in the Home Assistant logs. I think the first was when I gave a client a name, and the second was when I gave it a fixed IP.

./home-assistant.log:2022-10-07 19:42:43.249 WARNING (MainThread) [aiounifi.models.message] Unsupported message key user:sync
./home-assistant.log:2022-10-07 19:42:43.252 DEBUG (MainThread) [aiounifi.websocket] {"meta":{"rc":"ok","message":"user:sync"},"data":[{"_id":"<snip>","mac":"<snip>","site_id":"<snip>","oui":"Apple, Inc.","is_guest":false,"first_seen":1665184785,"last_seen":1665184785,"is_wired":true,"usergroup_id":"","hostname":"Apple-TV","fingerprint_source":5,"dev_cat":47,"dev_family":14,"os_name":24,"dev_vendor":320,"dev_id":4405,"confidence":100,"fingerprint_engine_version":"0.0.0","name":"Living Room Apple TV ","noted":true}]}
./home-assistant.log:2022-10-07 19:44:42.060 WARNING (MainThread) [aiounifi.models.message] Unsupported message key user:sync
./home-assistant.log:2022-10-07 19:44:42.061 DEBUG (MainThread) [aiounifi.websocket] {"meta":{"rc":"ok","message":"user:sync"},"data":[{"_id":"<snip>","mac":"<snip>","site_id":"<snip>","oui":"Apple, Inc.","is_guest":false,"first_seen":1665184785,"last_seen":1665184785,"is_wired":true,"usergroup_id":"","hostname":"Apple-TV","fingerprint_source":5,"dev_cat":47,"dev_family":14,"os_name":24,"dev_vendor":320,"dev_id":4405,"confidence":100,"fingerprint_engine_version":"0.0.0","name":"Living Room Apple TV ","noted":true,"network_id":"<snip>","use_fixedip":true,"fixed_ip":"10.0.10.205"}]}

poe_caps related to poe_mode

"auto"
"passthrough"
"pasv24"

IW6

  • PoE Off
  • Passthrough
    P1 caps 8

8P

  • PoE Off
  • Passthrough
    P1 caps 8

16P

  • PoE Off
  • 24V Passive
  • Poe/PoE+
    P1-16 caps 7
    P17-18 caps 0

24P

  • PoE Off
  • PoE/PoE+ (auto)
  • PoE++ (auto)
    P1-16 caps 3
    P17-24 caps 35
    P25-26 SFP caps 0

Unsupported events for UXG Pro

I noticed these events in the Home Assistant logs after upgrading Unifi OS on my Cloud Key:

Unsupported event key EVT_XG_AutoReadopted
Unsupported event {'key': 'EVT_XG_AutoReadopted', 'xg': 'd0:21:f9:74:d2:0e', 'gw': 'd0:21:f9:74:d2:0e', 'xg_name': 'UXG Pro', 'xg_model': 'UXGPRO', 'gw_displayName': 'UXG Pro', 'xg_displayName': 'UXG Pro', 'subsystem': 'lan', 'is_negative': False, 'site_id': '5a1c29a182e390efef41297f', 'time': 1669868701300, 'datetime': '2022-12-01T04:25:01Z', 'msg': 'Gateway[d0:21:f9:74:d2:0e] was automatically readopted', '_id': '63882c9db7ab835e790287ff'}
Unsupported event key EVT_XG_Connected
Unsupported event {'key': 'EVT_XG_Connected', 'xg': 'd0:21:f9:74:d2:0e', 'gw': 'd0:21:f9:74:d2:0e', 'xg_name': 'UXG Pro', 'xg_model': 'UXGPRO', 'gw_displayName': 'UXG Pro', 'xg_displayName': 'UXG Pro', 'subsystem': 'lan', 'is_negative': False, 'site_id': '5a1c29a182e390efef41297f', 'time': 1669868701752, 'datetime': '2022-12-01T04:25:01Z', 'msg': 'Gateway[d0:21:f9:74:d2:0e] was connected', '_id': '63882c9db7ab835e79028800'}

Home Assistant Version: 2022.11.5

Feature: Add check for new releases of controller software

It wpuld be great to have a sensor in HA for "new version available" - both for the controller and other components.

The API that the controller itself is using to fetch the latest available software is
https://fw-update.ubnt.com/api/firmware?filter=eq~~product~~unifi-controller&filter=eq~~platform~~unix&filter=eq~~channel~~release&sort=-version&limit=1

It should be pretty trivial to compare this to what the controller is currently running.

I tried playing around with the url to get the latest version of different AP models too, but not success so far.

Unsupported event key EVT_AD_ScheduleUpgradeFailedNotFound

This appeared in the logs today. I am running 2022.11.0b3 of HA and latest Unify stack.

Unsupported event key EVT_AD_ScheduleUpgradeFailedNotFound
Unsupported event {'mac': '74:ac:b9:0b:07:1b', 'key': 'EVT_AD_ScheduleUpgradeFailedNotFound', 'subsystem': '', 'is_negative': True, 'site_id': '60dee48f6573ae03e1f837d7', 'time': 1667174700004, 'datetime': '2022-10-31T00:05:00Z', 'msg': 'Device 74:ac:b9:0b:07:1b not found for firmware upgrade', '_id': '635f112c01899308de7cf128'}

I have no idea what kind of device 74:ac:b9:0b:07:1b is and there are no logs in the UDM Pro console, but it showed up in the HA logs as a new event.

Unifi - passive PoE control

https://community.home-assistant.io/t/unifi-passive-poe-control/485568/7

I recently updated my home assistant instance and added the new controls for the poe ports of a switch. It works perfectly with the new Access-points that are powered over the lastest poe/ poe+ standard.

Nevertheless, I have two older access points which are supplied by passive 24v poe. When I switch the port to off, the poe on that port is correctly turned to off. When I switch the port back to on, the unifi integration turns the port on but with the wrong poe standard (poe+/ poe instead of passive 24v).

I already tried a port profile with passive poe as a standard but this doesn’t work either.

Has someone an idea on how to fix this problem?

outlet_caps relating to feature availability

Posting this to discuss the meaning of outlet_caps.

The data I have so far:
On the USP-Plug: no outlet_caps property is available
On the USP-PDU-Pro: the outlet_caps property is available on each outlet in the outlet_table
For USB ports, the value is 1
For Power outlets, the value is 3

USP-Plug has properties called has_metering and has_relay to convey the capabilities of that device
USP-PDU-Pro does not have these convenient properties, instead the outlets have a outlet_caps property.

Capability Flag Meaning
1 Supports Switching
2 (not seen on a device yet) Supports metering
3 Supports Switching and Metering

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.