diff --git a/fhem/FHEM/98_CustomReadings.pm b/fhem/FHEM/98_CustomReadings.pm
index e66593a29..e95c3669d 100644
--- a/fhem/FHEM/98_CustomReadings.pm
+++ b/fhem/FHEM/98_CustomReadings.pm
@@ -66,7 +66,7 @@ sub CustomReadings_read($)
readingsEndUpdate($hash, 1);
foreach my $r (keys %{$hash->{READINGS}}) {
- if (not $r ~~ @used ) {
+ if (not $r ~~ @used) {
delete $hash->{READINGS}{$r};
}
}
@@ -85,6 +85,25 @@ CustomReadings_Undef($$)
return undef;
}
+sub CustomReadings_GetHTML ($)
+{
+ my ($name) = @_;
+ my $hash = $main::defs{$name};
+ my $result = "";
+
+ $result .= "
";
+ foreach my $reading (keys %{$hash->{READINGS}}) {
+ $result .= "";
+ $result .= "| $reading: | " . ReadingsVal($name, $reading, "???") . " | ";
+ $result .= "
";
+ }
+ $result .= "
";
+
+ return $result;
+}
+
+
+
1;
@@ -106,6 +125,7 @@ CustomReadings_Undef($$)
define myReadings CustomReadings
attr myReadings room 0-Test
+attr myReadings group Readings
attr myReadings interval 2
attr myReadings readingDefinitions hdd_temperature:qx(hddtemp /dev/sda 2>&1),
ac_powersupply_voltage:qx(cat /sys/class/power_supply/ac/voltage_now 2>&1) / 1000000,
@@ -117,6 +137,13 @@ device_name:$hash->{NAME},
bullshit: $hash->{bullshit},
fhem_backup_folder_size:qx(du -ch /opt/fhem/backup | grep total | cut -d 't' -f1 2>&1)
+
+Optionally, to display the readings:
+define myReadingsDisplay weblink htmlCode {CustomReadings_GetHTML('myReadings')}
+attr myReadingsDisplay group Readings
+attr myReadingsDisplay room 0-Test
+
+
Resulting readings: