diff --git a/FHEM/32_SYSSTAT.pm b/FHEM/32_SYSSTAT.pm index 13b688341..132ddafc3 100644 --- a/FHEM/32_SYSSTAT.pm +++ b/FHEM/32_SYSSTAT.pm @@ -41,7 +41,7 @@ SYSSTAT_Initialize($) $hash->{UndefFn} = "SYSSTAT_Undefine"; $hash->{GetFn} = "SYSSTAT_Get"; $hash->{AttrFn} = "SYSSTAT_Attr"; - $hash->{AttrList} = "disable:1 disabledForIntervals raspberrycpufreq:1 raspberrytemperature:0,1,2 synologytemperature:0,1,2 stat:1 uptime:1,2 ssh_user "; + $hash->{AttrList} = "disable:1 disabledForIntervals raspberrycpufreq:1 raspberrytemperature:0,1,2 synologytemperature:0,1,2 stat:1 uptime:1,2 ssh_user armbiantemperature:0,1,2"; $hash->{AttrList} .= " snmp:1 mibs:textField-long snmpVersion:1,2 snmpCommunity" if( $SYSSTAT_hasSNMP ); $hash->{AttrList} .= " filesystems showpercent"; $hash->{AttrList} .= " useregex:1" if( $SYSSTAT_hasSysStatistics ); @@ -245,6 +245,7 @@ SYSSTAT_Attr($$$) sub SYSSTAT_getLoadAVG($); sub SYSSTAT_getPiTemp($); +sub SYSSTAT_getArmbianTemp($); sub SYSSTAT_getUptime($); sub SYSSTAT_GetUpdate($) @@ -360,6 +361,14 @@ SYSSTAT_GetUpdate($) } readingsBulkUpdate($hash,"temperature",$temp); } + } elsif( AttrVal($name, "armbiantemperature", 0) > 0 ) { + my $temp = SYSSTAT_getArmbianTemp($hash); + if( $temp && $temp > 0 && $temp < 200 ) { + if( AttrVal($name, "armbiantemperature", 0) eq 2 ) { + $temp = sprintf( "%.1f", (3 * ReadingsVal($name,"temperature",$temp) + $temp ) / 4 ); + } + readingsBulkUpdate($hash,"temperature",$temp); + } } if( $hash->{USE_SNMP} && defined($hash->{session}) ) { @@ -578,6 +587,15 @@ SYSSTAT_getPiTemp($) return $temp / 1000; } sub +SYSSTAT_getArmbianTemp($) +{ + my ($hash) = @_; + + my $temp = SYSSTAT_readFile($hash,"/etc/armbianmonitor/datasources/soctemp",-1); + + return $temp / 1000; +} +sub SYSSTAT_getSynoTemp($) { my ($hash) = @_; @@ -851,6 +869,9 @@ SYSSTAT_getStat($)
  • synologytemperature
    If set and > 0 the main temperaure of a synology diskstation is read. requires snmp.
    If set to 2 a geometric average over the last 4 values is created.
  • +
  • armbiantemperature
    + If set and > 0 the armbian based SOC on chip termal sensor is read.
    + If set to 2 a geometric average over the last 4 values is created.
  • raspberrycpufreq
    If set and > 0 the raspberry pi on chip termal sensor is read.
  • uptime
    @@ -981,6 +1002,9 @@ SYSSTAT_getStat($)
  • synologytemperature
    Wenn gesetzt und > 0 wird die Temperatur einer Synology Diskstation ausgelesen (erfordert snmp).
    Wenn Wert 2 ist, wird ein geometrischer Durchschnitt der letzten 4 Werte dargestellt.
  • +
  • armbiantemperature
    + Wenn gesetzt und > 0 wird der Temperatursensor auf Armbian basierten Board ausgelesen.
    + Wenn Wert 2 ist, wird ein geometrischer Durchschnitt der letzten 4 Werte dargestellt.
  • raspberrycpufreq
    Wenn gesetzt und > 0 wird die Raspberry Pi CPU Frequenz ausgelesen.
  • uptime