Neues Modul - 74_Unifi - Für den Ubiquiti Networks (UBNT) - Unifi Controller

Begonnen von rapster, 23 August 2015, 02:12:04

Vorheriges Thema - Nächstes Thema

KyleK

Hallo,

ich hab seit ein paar Tagen unglaublich viele Fehlermeldungen im FHEM Log:
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1374.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1457.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 2010.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1019.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1074.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1238.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1415.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1238.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1074.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1415.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1457.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.
Use of uninitialized value in string eq at /opt/fhem/FHEM/74_Unifi.pm line 1374.
Use of uninitialized value in concatenation (.) or string at /opt/fhem/FHEM/74_Unifi.pm line 2576.

Ich vermute es hängt mit dem Update Unifi OS 5.1.15 bzw. Network 10.4.57 zusammen?

FHEM on Futro S940
CUL868
7x MAX! Thermostat, 8x MAX! Fensterkontakte
Conbee II + deConz, TradFri Lampen, Osram Smart+ Steckdosen

Wolle02

Bei mir stelle ich alle 30 Sekunden diesen Eintrag im Log fest:
Error: >< has no TYPE, but following keys: >unifi<
Dazu verliert Fhem regelmäßig einmal am Tag die Verbindung zur UDM. Nur ein Löschen des Device und Neuanlage mit den Zugangsdaten lässt wieder eine Verbindung entstehen.
Auch bei mir läuft Unifi OS 5.1.15 und Netzwork 10.4.57

eisman

hi,

habe die UDM PM
  Version: 5.1.15
  Netzwerk: 10.4.57

und keine Probleme, nur beim Start die Meldung siehe:
 #1724 "PERL WARNING: Use of uninitialized value in string ne at /usr/share/fhem/FHEM/74_Unifi.pm line 939."

was aber nicht groß stört

gruss
1x FHEM Debian, Homematic,ZigBee,FS20 / 1X Raspberry, ConBee / 7x ESP
1x FHEM Debian, Homematic,Z2M             / 1X Raspberry, ConBee / 6x ESP
1x FHEM Debian,MQTT2                             / 1X Raspberry, i2c,onewire,gpio
1x auf Windows 2012 Hyper-V-S

Gary

Ich habe seit einigen Tagen das Problem, dass nach einer gewissen Laufzeit die Unifi Daten der Geräte nicht mehr aktualisiert werden. Der Timestamp der Readings ändert sich zwar weiterhin, aber die Werte der Readings nicht mehr. Nach einem Neustart von FHEM geht es wieder ein paar Stunden und dann wieder das Problem.

Zum Zeitpunkt, wo es nicht mehr geht, habe ich im Log diese Fehler:

2026.06.12 02:00:36 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 1244.
2026.06.12 02:00:36 1: PERL WARNING: Use of uninitialized value in concatenation (.) or string at ./FHEM/74_Unifi.pm line 2582.
2026.06.12 02:00:36 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 1197.
2026.06.12 02:00:37 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 1028.
2026.06.12 02:00:37 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 1421.
2026.06.12 02:00:37 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 1380.
2026.06.12 02:00:37 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 1463.
2026.06.12 02:00:37 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 2016.
2026.06.12 02:00:37 1: PERL WARNING: Use of uninitialized value in string eq at ./FHEM/74_Unifi.pm line 1083.

Mit Verbose Debug sehe ich im Log, dass die API offenbar Fehler erzeugt, keine Werte kommen und immer nur die zuletzt abgefragten wieder neu zugewiesen werden:

2026.06.12 11:16:18 5: unifi (Unifi_Notify) - executed.
2026.06.12 11:16:18 5: unifi: get called with ?.
2026.06.12 11:16:58 5: unifi (Unifi_DoUpdate) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetEvents_Send) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetEvents_Receive) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetEvents_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:58 5: unifi (Unifi_GetUnarchivedAlerts_Send) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetUnarchivedAlerts_Receive) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetUnarchivedAlerts_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:58 5: unifi (Unifi_GetAccesspoints_Send) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetAccesspoints_Receive) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetAccesspoints_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:58 5: unifi (Unifi_GetClientInsights_Send) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetClientInsights_Receive) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetClientInsights_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:58 5: unifi (Unifi_GetVoucherList_Send) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetVoucherList_Receive) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetVoucherList_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:58 5: unifi (Unifi_GetWlans_Send) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetWlans_Receive) - executed.
2026.06.12 11:16:58 5: unifi (Unifi_GetWlans_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:58 5: unifi (Unifi_GetClients_Send) - executed.
2026.06.12 11:16:59 5: unifi (Unifi_GetClients_Receive) - executed.
2026.06.12 11:16:59 5: unifi (Unifi_GetClients_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:59 5: unifi (Unifi_GetHealth_Send) - executed.
2026.06.12 11:16:59 5: unifi (Unifi_GetHealth_Receive) - executed.
2026.06.12 11:16:59 5: unifi (Unifi_GetHealth_Receive) - Failed (without message)! - state:''
2026.06.12 11:16:59 5: unifi (Unifi_ProcessUpdate) - executed after 0.4984 seconds.
2026.06.12 11:16:59 5: unifi (Unifi_SetHealthReadings) - executed.
2026.06.12 11:16:59 5: unifi (Unifi_SetClientReadings) - executed.

Meine Vermutung wäre demnach, dass nach einer gewissen Zeit ein erneutes Login nötig ist. Und dass sich das kürzlich bei Unifi geändert hat.
Ich verwende eine Cloud Gateway Ultra mit Network Version 10.4.57. Ich verwende für FHEM einen dedizierten Admin User mit Local Access Rights in Unifi.

@KyleK: Du hast ja offenbar auch die Fehler im Log mit dieser Version - werden deine Werte überhaupt noch aktualisiert?
Irgendwelche Ideen? Ähnliche Probleme?

Wolle02

Die Symptome (keine Aktualisierung der Readings mehr) sind bei mir die gleichen nur die Fehlermeldung im Log ist bei mir anders. Aber da dieses Modul scheinbar auch schon länger nicht mehr gepflegt wird, habe ich keine große Hoffnung, dass es hier zeitnah zu einer Abhilfe kommt.  :(

Als Workaround habe ich mir Node-Red im Docker erstellt und rufe die Unifi Werte dort ab. Dort funktioniert der Login mit einem API-Key, der auf der UDM erstellt werden kann. Das scheint jetzt der offizielle Weg zu sein.
Jedenfalls funktioniert das gut und die benötigten Werte pushe ich mir per MQTT nach Fhem.

Gary

Ich habe ein wenig gesucht und mehrere Beiträge der Unifi Community und auf Reddit gefunden, die die eine kürzliche Änderung des Sessions Timeouts bestätigen und mehrheitlich das nicht gut finden. Wie diesen hier: New, and very frequent requests to reauthenticate

Für das Modul bedeutet das entweder eine Lösung zu finden, regelmäßig oder bei Bedarf neu einzuloggen oder darauf zu hoffen, dass Unifi das wieder zurück ändert (in meiner persönlichen Erfahrung eher unwahrscheinlich). Für mich hat das Modul bisher sehr gut funktioniert.