diff --git a/.DS_Store b/.DS_Store index 8794b78..4284437 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/UniFi Device Monitor/README.md b/UniFi Device Monitor/README.md index 6e41ae1..1782182 100644 --- a/UniFi Device Monitor/README.md +++ b/UniFi Device Monitor/README.md @@ -97,5 +97,5 @@ Version 1.3 - 03-01-2022 Version 1.5 - 03-12-2023 * Neu - UI Aufgeräumt -Version 1.51 - 09-06-2024 +Version 1.6 - 25-08-2024 * Neu - Anzahl der verbundenen Geräte wird angezeigt \ No newline at end of file diff --git a/UniFi Device Monitor/README_en.md b/UniFi Device Monitor/README_en.md index c12ac47..0f31085 100644 --- a/UniFi Device Monitor/README_en.md +++ b/UniFi Device Monitor/README_en.md @@ -79,5 +79,5 @@ Version 1.3 - 03-01-2022 Version 1.5 - 03-12-2023 * New - UI tidied up -Version 1.51 - 09-06-2024 +Version 1.6 - 25-08-2024 * New - Number of connected devices are shown \ No newline at end of file diff --git a/UniFi Endpoint Blocker/README.md b/UniFi Endpoint Blocker/README.md index 0c94772..46ed3f2 100644 --- a/UniFi Endpoint Blocker/README.md +++ b/UniFi Endpoint Blocker/README.md @@ -127,3 +127,6 @@ Version 1.3 - 03-01-2022 Version 1.5 - 03-12-2023 * Neu - UI Aufgeräumt + +Version 1.6 - 25-08-2024 +* Keine Änderungen \ No newline at end of file diff --git a/UniFi Endpoint Blocker/README_en.md b/UniFi Endpoint Blocker/README_en.md index 1b0a55e..2f14b3f 100644 --- a/UniFi Endpoint Blocker/README_en.md +++ b/UniFi Endpoint Blocker/README_en.md @@ -109,4 +109,7 @@ Version 1.3 - 03-01-2022 * New - Device Blocker is now called Endpoint Blocker Version 1.5 - 03-12-2023 -* New - UI tidied up \ No newline at end of file +* New - UI tidied up + +Version 1.6 - 25-08-2024 +* No changes \ No newline at end of file diff --git a/UniFi Multi Endpoint Monitor/README.md b/UniFi Multi Endpoint Monitor/README.md index 75f45a6..2f05832 100644 --- a/UniFi Multi Endpoint Monitor/README.md +++ b/UniFi Multi Endpoint Monitor/README.md @@ -88,4 +88,12 @@ Das Modul gibt diverse Informationen im Debug Bereich aus. ## 5. Versionsinformation Version 1.5 - 02-12-2023 -* Neu - Modul verfügbar \ No newline at end of file +* Neu - Modul verfügbar + +Version 1.6 - 25-08-2024 (Credit M70 - Danke) +* Fix - Connection wurde nicht gesetzt +* Fix - Satisfaction wurde nicht aktualisiert +* Fix - IP wurde nicht gesetzt +* Fix - LastSeen wird auf Zeit von Symcon korrigiert +* Fix - Modul zieht jetzt nicht mehr die Werte für WLAN Geräte bei LAN Komponenten +* Change - SetValue durch $this->SetValue ersetzt \ No newline at end of file diff --git a/UniFi Multi Endpoint Monitor/README_en.md b/UniFi Multi Endpoint Monitor/README_en.md index a9da138..b84ce11 100644 --- a/UniFi Multi Endpoint Monitor/README_en.md +++ b/UniFi Multi Endpoint Monitor/README_en.md @@ -71,4 +71,15 @@ The module outputs various information in the debug area. ## 5. version information Version 1.5 - 02-12-2023 -* New - Module available \ No newline at end of file +* New - Module available + +Version 1.6 - 02-12-2023 +* Neu - Modul verfügbar + +Version 1.6 - 25-08-2024 (Credit M70 - Danke) +* Fix - Connection was not set +* Fix - Satisfaction was not set +* Fix - IP was not set +* Fix - LastSeen is set to Symcon Server time +* Fix - Module is no longer pulling WLAN data from LAN devices +* Change - SetValue replaced by $this->SetValue ersetzt \ No newline at end of file diff --git a/UniFi Multi Endpoint Monitor/form.json b/UniFi Multi Endpoint Monitor/form.json index 61e38d3..df3be03 100644 --- a/UniFi Multi Endpoint Monitor/form.json +++ b/UniFi Multi Endpoint Monitor/form.json @@ -194,7 +194,7 @@ { "type": "Button", "label": "Get Device Data", - "onClick": "UMEM_EndpointMonitor($id);" + "onClick": "UMEM_MultiEndpointMonitor($id);" }, { "type": "Button", diff --git a/UniFi Multi Endpoint Monitor/module.php b/UniFi Multi Endpoint Monitor/module.php index 8cd9968..f9cc589 100644 --- a/UniFi Multi Endpoint Monitor/module.php +++ b/UniFi Multi Endpoint Monitor/module.php @@ -39,7 +39,7 @@ public function Create() $this->RegisterPropertyBoolean("DataPointConnection", 0); $this->RegisterPropertyBoolean("DataPointTransfer", 0); - $this->RegisterTimer("UniFi Multi Endpoint Monitor", 0, MODUL_PREFIX."_EndpointMonitor(\$_IPS['TARGET']);"); + $this->RegisterTimer("UniFi Multi Endpoint Monitor", 0, MODUL_PREFIX."_MultiEndpointMonitor(\$_IPS['TARGET']);"); } public function Destroy() @@ -152,7 +152,7 @@ public function AuthenticateAndGetData(string $UnifiAPI = "") } } - public function EndpointMonitor() + public function MultiEndpointMonitor() { $ControllerType = $this->ReadPropertyInteger("ControllerType"); $ServerAddress = $this->ReadPropertyString("ServerAddress"); @@ -196,6 +196,7 @@ public function EndpointMonitor() $DeviceMac = $this->removeInvalidChars($Device["varDeviceMAC"], true); $DeviceName = $Device["varDeviceName"]; $ConnectionType = $Device["varDeviceConnectionType"]; + $Connected = false; //Itterate through all device and check if one of them matches the list in the config form. foreach ($ActiveDevices["data"] as $Index => $DeviceFromController) @@ -205,8 +206,10 @@ public function EndpointMonitor() if ($DeviceMac == $DeviceFromControllerClean) { $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Device with Name was found: ").$DeviceName, 0); - + $Connected = true; $ConnectionMethod = $DeviceFromController["is_wired"]; + $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Setze Wert"), 0); + $this->SetValue($this->GetIDForIdent($DeviceMac."_Connected"), $Connected); if ($ConnectionMethod == true && $ConnectionType == 0) { @@ -219,77 +222,80 @@ public function EndpointMonitor() } if ($this->ReadPropertyBoolean("DataPointNetwork") == 1) - { - $IPAddress = $DeviceFromController["ip"]; - SetValue($this->GetIDForIdent($DeviceMac."IPAddress"), $IPAddress); - $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Network Data IP ").$IPAddress, 0); - + { + if (isset($DeviceFromController["ip"])) { + $IPAddress = $DeviceFromController["ip"]; + $this->SetValue($this->GetIDForIdent($DeviceMac."IPAddress"), $IPAddress); + $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Network Data IP ").$IPAddress, 0); + } if ("" != $DeviceFromController["hostname"]) { $Hostname = $DeviceFromController["hostname"]; } - elseif ("" != $DeviceFromController["name"]) - { - $Hostname = $DeviceFromController["name"]; - } else { $Hostname = ""; } - SetValue($this->GetIDForIdent($DeviceMac."Hostname"), $Hostname); + $this->SetValue($this->GetIDForIdent($DeviceMac."Hostname"), $Hostname); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Network Data Hostname ").$Hostname, 0); + $Connected = true; } + if ($this->ReadPropertyBoolean("DataPointConnection") == 1) { if (isset($DeviceFromController["satisfaction"])) { - $Satisfaction = isset($DeviceMac["satisfaction"]); - SetValue($this->GetIDForIdent($DeviceMac."Satisfaction"), $Satisfaction); + $Satisfaction = $DeviceFromController["satisfaction"]; + //$Satisfaction = isset($DeviceMac["satisfaction"]); + $this->SetValue($this->GetIDForIdent($DeviceMac."Satisfaction"), $Satisfaction); + $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Satisfaction ").$Satisfaction, 0); } - $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Satisfaction ").$Satisfaction, 0); + //$this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Satisfaction ").$Satisfaction, 0); $SLastSeen = $DeviceFromController["last_seen"]; - SetValue($this->GetIDForIdent($DeviceMac."LastSeen"), gmdate("Y-m-d H:i:s", $SLastSeen)); + $SLastSeen = $SLastSeen + date("Z"); + $this->SetValue($this->GetIDForIdent($DeviceMac."LastSeen"), gmdate("Y-m-d H:i:s", $SLastSeen)); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Last Seen ").gmdate("Y-m-d H:i:s", $SLastSeen), 0); $Uptime = $DeviceFromController["uptime"]; - SetValue($this->GetIDForIdent($DeviceMac."Uptime"), round($Uptime / 3600, 0)); + $this->SetValue($this->GetIDForIdent($DeviceMac."Uptime"), round($Uptime / 3600, 0)); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Uptime in hours ").round($Uptime / 3600, 0), 0); } - if ($this->ReadPropertyBoolean("DataPointConnection") == 1 && $ConnectionType == 0 && $ConnectionConfigError == false) + + if ($this->ReadPropertyBoolean("DataPointConnection") == 1 AND $ConnectionType == 0 AND $ConnectionConfigError == false); { $Accesspoint = $DeviceFromController["ap_mac"]; - SetValue($this->GetIDForIdent($DeviceMac."Accesspoint"), $Accesspoint); + $this->SetValue($this->GetIDForIdent($DeviceMac."Accesspoint"), $Accesspoint); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Accesspoint ").$Accesspoint, 0); $Channel = $DeviceFromController["channel"]; - SetValue($this->GetIDForIdent($DeviceMac."Channel"), $Channel); + $this->SetValue($this->GetIDForIdent($DeviceMac."Channel"), $Channel); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Channel ").$Channel, 0); $Radio = $DeviceFromController["radio"]; - SetValue($this->GetIDForIdent($DeviceMac."Radio"), $Radio); + $this->SetValue($this->GetIDForIdent($DeviceMac."Radio"), $Radio); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Radio ").$Radio, 0); $ESSID = $DeviceFromController["essid"]; - SetValue($this->GetIDForIdent($DeviceMac."ESSID"), $ESSID); + $this->SetValue($this->GetIDForIdent($DeviceMac."ESSID"), $ESSID); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data ESSID ").$ESSID, 0); $RSSI = $DeviceFromController["rssi"]; - SetValue($this->GetIDForIdent($DeviceMac."RSSI"), $RSSI); + $this->SetValue($this->GetIDForIdent($DeviceMac."RSSI"), $RSSI); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data RSSI ").$RSSI, 0); $Noise = $DeviceFromController["noise"]; - SetValue($this->GetIDForIdent($DeviceMac."Noise"), $Noise); + $this->SetValue($this->GetIDForIdent($DeviceMac."Noise"), $Noise); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data Noise ").$Noise, 0); $SignalStrength = $DeviceFromController["signal"]; - SetValue($this->GetIDForIdent($DeviceMac."SignalStrength"), $SignalStrength); + $this->SetValue($this->GetIDForIdent($DeviceMac."SignalStrength"), $SignalStrength); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Connection Data SignalStrength ").$SignalStrength, 0); } - if ($this->ReadPropertyBoolean("DataPointTransfer") == 1 && $ConnectionType == 0 && $ConnectionConfigError == false) + if ($this->ReadPropertyBoolean("DataPointTransfer") == 1 AND $ConnectionType == 0 AND $ConnectionConfigError == false) { $TXBytes = $DeviceFromController["tx_bytes"]; - SetValue($this->GetIDForIdent($DeviceMac."TXBytes"), $TXBytes / 1000000); + $this->SetValue($this->GetIDForIdent($DeviceMac."TXBytes"), $TXBytes / 1000000); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data TXBytes ").$TXBytes / 1000000, 0); $RXBytes = $DeviceFromController["rx_bytes"]; - SetValue($this->GetIDForIdent($DeviceMac."RXBytes"), $RXBytes / 1000000); + $this->SetValue($this->GetIDForIdent($DeviceMac."RXBytes"), $RXBytes / 1000000); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data RXBytes ").$RXBytes / 1000000, 0); $TXPackets = $DeviceFromController["tx_packets"]; - SetValue($this->GetIDForIdent($DeviceMac."TXPackets"), $TXPackets); + $this->SetValue($this->GetIDForIdent($DeviceMac."TXPackets"), $TXPackets); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data TXPackets ").$TXPackets, 0); $RXPackets = $DeviceFromController["rx_packets"]; - SetValue($this->GetIDForIdent($DeviceMac."RXPackets"), $RXPackets); + $this->SetValue($this->GetIDForIdent($DeviceMac."RXPackets"), $RXPackets); $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Transfer Data RXPackets ").$RXPackets, 0); } @@ -298,6 +304,8 @@ public function EndpointMonitor() { //$this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("NOT found - Device: ").$DeviceName, 0); } + $this->SendDebug($this->Translate("Endpoint Monitor"), $this->Translate("Setze Wert"), 0); + $this->SetValue($this->GetIDForIdent($DeviceMac."_Connected"), $Connected); } } } diff --git a/library.json b/library.json index adc05e7..fd501e0 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "5.5" }, - "version": "1.51", + "version": "1.6", "build": 0, "date": 0 } diff --git a/tests/.DS_Store b/tests/.DS_Store new file mode 100644 index 0000000..a2944cf Binary files /dev/null and b/tests/.DS_Store differ