@@ -34,6 +34,8 @@ public function Create()
34
34
35
35
$ this ->RegisterPropertyBoolean ("DataPointBasic " , 1 );
36
36
$ this ->RegisterPropertyBoolean ("DataPointHardware " , 0 );
37
+ $ this ->RegisterPropertyBoolean ("DataPointTemperature " , 0 );
38
+ $ this ->RegisterPropertyBoolean ("DataPointPower " , 0 );
37
39
$ this ->RegisterPropertyBoolean ("DataPointSpecific " , 0 );
38
40
39
41
@@ -67,6 +69,12 @@ public function ApplyChanges()
67
69
$ this ->MaintainVariable ("MemoryLoad " , $ this ->Translate ("Memory Load " ), vtFloat, "" , $ vpos ++, $ this ->ReadPropertyBoolean ("DataPointHardware " ) == 1 );
68
70
$ this ->MaintainVariable ("ConnectedDevices " , $ this ->Translate ("Connected Devices " ), vtInteger, "" , $ vpos ++, $ this ->ReadPropertyBoolean ("DataPointHardware " ) == 1 );
69
71
72
+ //Temperature Data
73
+ $ vpos = 230 ;
74
+ $ this ->MaintainVariable ("TotalUsedPower " , $ this ->Translate ("Total Used Power (POE) " ), vtFloat, "" , $ vpos ++, $ this ->ReadPropertyBoolean ("DataPointPower " ) == 1 );
75
+ $ this ->MaintainVariable ("FanLevel " , $ this ->Translate ("Fan Level " ), vtInteger, "" , $ vpos ++, $ this ->ReadPropertyBoolean ("DataPointTemperature " ) == 1 );
76
+ $ this ->MaintainVariable ("DeviceTemperature " , $ this ->Translate ("Device Temperature " ), vtInteger, "" , $ vpos ++, $ this ->ReadPropertyBoolean ("DataPointTemperature " ) == 1 );
77
+
70
78
71
79
//Device Specific Data Connection Data UDM/USG
72
80
$ vpos = 300 ;
@@ -187,6 +195,30 @@ public function DeviceMonitor()
187
195
$ this ->SetValue ("ConnectedDevices " , $ ConnectedDevices );
188
196
$ this ->SendDebug ($ this ->Translate ("Endpoint Monitor " ), $ this ->Translate ("Connected Devices " ).$ ConnectedDevices , 0 );
189
197
}
198
+ if ($ this ->ReadPropertyBoolean ("DataPointHardware " ) == 1 )
199
+ {
200
+ if (isset ($ JSONData ["data " ][0 ]["fan_level " ]))
201
+ {
202
+ $ FanLevel = $ JSONData ["data " ][0 ]["fan_level " ];
203
+ $ this ->SetValue ("FanLevel " , $ FanLevel );
204
+ $ this ->SendDebug ($ this ->Translate ("Device Monitor " ), $ this ->Translate ("Fan Level " ).$ FanLevel , 0 );
205
+ }
206
+ if (isset ($ JSONData ["data " ][0 ]["general_temperature " ]))
207
+ {
208
+ $ DeviceTemp = $ JSONData ["data " ][0 ]["general_temperature " ];
209
+ $ this ->SetValue ("DeviceTemperature " , $ DeviceTemp );
210
+ $ this ->SendDebug ($ this ->Translate ("Device Monitor " ), $ this ->Translate ("Device Temperature " ).$ DeviceTemp , 0 );
211
+ }
212
+ }
213
+ if ($ this ->ReadPropertyBoolean ("DataPointPower " ) == 1 )
214
+ {
215
+ if (isset ($ JSONData ["data " ][0 ]["total_used_power " ]))
216
+ {
217
+ $ POETotalPower = $ JSONData ["data " ][0 ]["total_used_power " ];
218
+ $ this ->SetValue ("TotalUsedPower " , $ POETotalPower );
219
+ $ this ->SendDebug ($ this ->Translate ("Device Monitor " ), $ this ->Translate ("Total used Power " ).$ POETotalPower , 0 );
220
+ }
221
+ }
190
222
if ($ this ->ReadPropertyBoolean ("DataPointSpecific " ) == 1 && $ this ->ReadPropertyInteger ("DeviceType " ) == 0 && $ DeviceConfigError == false )
191
223
{
192
224
$ WAN1IP = $ JSONData ["data " ][0 ]["wan1 " ]["ip " ];
0 commit comments