From a220dacb66b0b3c870dc3cf80727654f4baed11e Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Wed, 19 Aug 2020 16:54:17 +0000 Subject: [PATCH] fhem.pl: better support for deviating reading/event timestamps (Forum #113652) git-svn-id: https://svn.fhem.de/fhem/trunk@22631 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/01_FHEMWEB.pm | 4 ++- fhem/docs/commandref_frame.html | 6 ++-- fhem/docs/commandref_frame_DE.html | 6 ++-- fhem/fhem.pl | 53 +++++++++++++++++++----------- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 145c2fc70..ec6f50ce4 100644 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -3112,6 +3112,7 @@ FW_Notify($$) #Add READINGS if($events) { # It gets deleted sometimes (?) my $tn = TimeNow(); + my $ct = $dev->{CHANGETIME}; my $max = int(@{$events}); for(my $i = 0; $i < $max; $i++) { if($events->[$i] !~ /: /) { @@ -3127,7 +3128,8 @@ FW_Notify($$) next if($readingName !~ m/^[A-Za-z\d_\.\-\/:]+$/); # Forum #70608,70844 push @data, FW_longpollInfo($h->{fmt}, "$dn-$readingName", $readingVal,$readingVal); - push @data, FW_longpollInfo($h->{fmt}, "$dn-$readingName-ts", $tn, $tn); + my $t = (($ct && $ct->[$i]) ? $ct->[$i] : $tn); + push @data, FW_longpollInfo($h->{fmt}, "$dn-$readingName-ts", $t, $t); } } } diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html index 605b36b3c..69b78ef7d 100644 --- a/fhem/docs/commandref_frame.html +++ b/fhem/docs/commandref_frame.html @@ -1279,12 +1279,14 @@ The following local attributes are used by a wider range of devices:

setreading