w1tw0lf / Unifi-Device-info

Unifi AP Device info via API for home assistant
17 stars 3 forks source link

satisfaction per signal allways -1 #8

Open DAVIZINH0 opened 1 month ago

DAVIZINH0 commented 1 month ago

Hello I configure this integration and works fine! i use home assistant os and the addon unifi. It works great with all parameters but the "satisfaction" dont report the correct information

The general satisfaction is ok. report data like 98%

But the 2.4ghz and the 5ghz report -1

i have 4 aps. and all of this report -1 i think maybe something is wrong

can i make some changes or something to find the problem?

w1tw0lf commented 1 month ago

Hi

Working perfectly on my side. Will compare files on my side once in front of a pc and update if needs be.

DAVIZINH0 commented 1 month ago

I make some changes, because my APS are the u7pro with wifi6ghz. Its easy the changes but it will be interesesting to say. Tomorrow i will put here

w1tw0lf commented 1 month ago

Unfortunetly I don't have a u7 device yet.

If you share what you have done to get it to work, will see if I can add it to the code.

DAVIZINH0 commented 1 month ago

Unfortunetly I don't have a u7 device yet.

If you share what you have done to get it to work, will see if I can add it to the code.

The modification are easy, because the wifi6ghz are the wifi2

in the py script, adding this:

wifi2clients = devs['radio_table_stats'][2]['user-num_sta']
wifi2score = devs['radio_table_stats'][2]['satisfaction']

and modify the final with this new 2 informations:

final = json.dumps({"Clients":numclients,"Guests":numguests,"Clients_wifi0":wifi0clients ,"Clients_wifi1":wifi1clients ,"Clients_wifi2":wifi2clients ,"Score":score,"CPU":str(cpu),"RAM":str(ram),"Uptime":uptime,"Score_wifi0":wifi0score ,"Score_wifi1":wifi1score ,"Score_wifi2":wifi2score ,\
                "Activity":str(activity)+' Mbps',"Update":update})

in the configuration.yaml add the new 2 atributes

     json_attributes:
         - Clients_wifi2
         - Score_wifi2

and in the sensor section add this 2 new sensors:

      unifi_ap_6ghz_wifi_devices:
          value_template: >
              {{ states.sensor.unifi_ap.attributes.Clients_wifi2 }}
          friendly_name_template: Unifi AP 6gHz Clients

      unifi_ap_6_score:
          value_template: >
              {% if is_state_attr('sensor.unifi_ap', 'Score_wifi2' , -1) %}
                N/A
              {% else %}
                {{ states.sensor.unifi_ap.attributes.Score_wifi2 }}.
              {% endif %}
          friendly_name_template: Unifi AP 6gHz SCORE

the score allways report -1 but not only wifi6. the 3 wifi (2.4ghz, 5ghz, and 6ghz, report -1 value :-(

DAVIZINH0 commented 1 month ago

hello again. Can i make some test or other thing to help to solve the problem with the score in the individual wifis??

thanks again!

w1tw0lf commented 1 month ago

@DAVIZINH0 I do apologize.... got distracted and completely forgot about this.

What version of the controller are you running ? Is it dream machine, cloudkey or standalone ?

DAVIZINH0 commented 1 month ago

@DAVIZINH0 I do apologize.... got distracted and completely forgot about this.

What version of the controller are you running ? Is it dream machine, cloudkey or standalone ?

dont worry man! this is not important in our lives :-) this is only a hobbie

my controller is the addon version of home assistant. In a few days i will buy a cloud gateway ultra.

The version of my controller is Network 8.5.6

w1tw0lf commented 1 month ago

Wondering if the addon for home assistant doesn't report it. Is it showing when logging into the controller?

DAVIZINH0 commented 1 month ago

yes in the controller i can see this information by each wifi image

but we can wait for the migration to the new gateway in a few days. and maybe it solves the probem i will tell you as soon as posible

w1tw0lf commented 1 month ago

Only other thing that comes to mind is that it isn't reported in the api.

I have tested on my side with cloudkey v2 and works correctly. Only thing that I have seen is, that when it show -1, the value is not available.

PS: I am by no means an expert on this.