Unifi controller : This integration has no devices

Hi,
I have a unifi controller with two AP and one USG configured.
When I try to add the unifi controller using the integration “unifi controller” I can connect to it, I can see a lot of information in logs when I turn debug on but hass says This integration has no devices.

What am I missing here ?

I’m running on hass 0.93.1 and controller version is 5.10.23 .

What does the logs say?

I only have two entries with large json content starting with this:

2019-05-27 21:28:55 DEBUG (MainThread) [aiounifi.api] [{’_id’: ‘5cd0a256e4332f00379579b8’,

2019-05-27 21:28:55 DEBUG (MainThread) [aiounifi.api] [{’_id’: ‘5cd17f105c55f60038b088aa’,

Nothing else containing unifi reference

Ok. So you don’t have any poe powered devices? Then you won’t see anything

I have two AP-LR poe powered

They are infrastructure, right now only clients are supported

The whole Unifi integration feels more like proof-of-conecept than really usable.
Sure APs are infrastructure, but a switchable POE port is a switchable POE port…

Ok the component documentation does not says anything about that.
So only camera are supported ?

As coincidence would have it, I’ve done exactly the same with my two AP and one USG today and was wondering why in heck I couldn’t see anything. The integration all seems to be a little dodgy right now. I hope they improve it.

The unifi api doesn’t support anything else. You can blame them instead of home-assistants integration. If you want other information from each AP, SWITCH, or USG, use SNMP. Even that is limited because ubiquiti doesn’t update that too often.

here’s some examples for snmp sensors:

  # SNMP
  
  - platform: snmp
    host: !secret unifi_bonus_switch
    name: Bonus Room Switch Temperature
    unit_of_measurement: "°C"
    baseoid: 1.3.6.1.4.1.4413.1.1.43.1.8.1.5.1.0

  - platform: snmp
    host: !secret unifi_bonus_switch
    name: Bonus Room Switch Uptime
    baseoid: 1.3.6.1.2.1.1.3.0
    value_template: >
      {%- set time = value | int // 100 %}
      {%- set minutes = ((time % 3600) // 60) %}
      {%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %}
      {%- set hours = ((time % 86400) // 3600) %}
      {%- set hours = '{}hr '.format(hours) if hours > 0 else '' %}
      {%- set days = (time // 86400) %}
      {%- set days = '{}d '.format(days) if days > 0 else '' %}
      {{ 'Less than 1 min' if time < 60 else days + hours + minutes }}
      
  - platform: snmp
    host: !secret unifi_server_switch
    name: Server Room Switch Temperature
    unit_of_measurement: "°C"
    baseoid: 1.3.6.1.4.1.4413.1.1.43.1.8.1.5.1.0
      
  - platform: snmp
    host: !secret unifi_server_switch
    name: Server Room Switch Uptime
    baseoid: 1.3.6.1.2.1.1.3.0
    value_template: >
      {%- set time = value | int // 100 %}
      {%- set minutes = ((time % 3600) // 60) %}
      {%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %}
      {%- set hours = ((time % 86400) // 3600) %}
      {%- set hours = '{}hr '.format(hours) if hours > 0 else '' %}
      {%- set days = (time // 86400) %}
      {%- set days = '{}d '.format(days) if days > 0 else '' %}
      {{ 'Less than 1 min' if time < 60 else days + hours + minutes }}
      
  - platform: snmp
    host: !secret unifi_server_gateway
    name: Server Room Gateway Uptime
    baseoid: 1.3.6.1.2.1.1.3.0
    value_template: >
      {%- set time = value | int // 100 %}
      {%- set minutes = ((time % 3600) // 60) %}
      {%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %}
      {%- set hours = ((time % 86400) // 3600) %}
      {%- set hours = '{}hr '.format(hours) if hours > 0 else '' %}
      {%- set days = (time // 86400) %}
      {%- set days = '{}d '.format(days) if days > 0 else '' %}
      {{ 'Less than 1 min' if time < 60 else days + hours + minutes }}
      
  - platform: snmp
    host: !secret synology_host
    name: Synology Uptime
    baseoid: 1.3.6.1.2.1.25.1.1.0
    value_template: >
      {%- set time = value | int // 100 %}
      {%- set minutes = ((time % 3600) // 60) %}
      {%- set minutes = '{}min'.format(minutes) if minutes > 0 else '' %}
      {%- set hours = ((time % 86400) // 3600) %}
      {%- set hours = '{}hr '.format(hours) if hours > 0 else '' %}
      {%- set days = (time // 86400) %}
      {%- set days = '{}d '.format(days) if days > 0 else '' %}
      {{ 'Less than 1 min' if time < 60 else days + hours + minutes }}

I don’t blame HA. I’m sure they’ve done everything they can. I wish Ubiquti had opened up more to it, but I guess they need to ensure the secure nature of the network. It just seems a bit of a missed opportunity to supply even some basic information such as throughput, uptime and so on. As has been said before, it just seems a bit “proof of concept” right now.
Hopefully they expand it.

Thanks for the code, btw. I’ll try it this evening.

I also don’t blame HA, but from what I’ve read/seen the Unifi API provides a lot more information/options than the python implementation supports. And HA dosen’t even use the full python implementation.

https://api-browser-demo.artofwifi.net/

So there is some room for improvement …

Give suggestions of what to expose from UniFi :+1:

Next up is to add block/unblock clients