diff --git a/fhem/lib/FHEM/SynoModules/SMUtils.pm b/fhem/lib/FHEM/SynoModules/SMUtils.pm
index 9758267a2..9fbf55b05 100644
--- a/fhem/lib/FHEM/SynoModules/SMUtils.pm
+++ b/fhem/lib/FHEM/SynoModules/SMUtils.pm
@@ -31,6 +31,7 @@ use strict;
use warnings;
use utf8;
use MIME::Base64;
+use Time::HiRes qw(gettimeofday);
eval "use JSON;1;" or my $nojsonmod = 1; ## no critic 'eval'
use Data::Dumper;
@@ -40,7 +41,7 @@ use FHEM::SynoModules::ErrCodes qw(:all); # Erro
use GPUtils qw( GP_Import GP_Export );
use Carp qw(croak carp);
-use version; our $VERSION = version->declare('1.11.1');
+use version; our $VERSION = version->declare('1.13.0');
use Exporter ('import');
our @EXPORT_OK = qw(
@@ -51,6 +52,7 @@ our @EXPORT_OK = qw(
sortVersion
showModuleInfo
jboolmap
+ plotPngToFile
completeAPI
showAPIinfo
setCredentials
@@ -65,6 +67,8 @@ our @EXPORT_OK = qw(
setReadingErrorState
addSendqueueEntry
listSendqueue
+ startFunctionDelayed
+ checkSendRetry
purgeSendqueue
updQueueLength
);
@@ -76,6 +80,7 @@ BEGIN {
# Import from main::
GP_Import(
qw(
+ attr
AttrVal
asyncOutput
Log3
@@ -87,6 +92,10 @@ BEGIN {
FmtDateTime
setKeyValue
getKeyValue
+ InternalTimer
+ plotAsPng
+ RemoveInternalTimer
+ ReadingsVal
readingsSingleUpdate
readingsBeginUpdate
readingsBulkUpdate
@@ -98,10 +107,11 @@ BEGIN {
};
# Standardvariablen
-my $carpnohash = "got no hash value";
-my $carpnoname = "got no name value";
-my $carpnoctyp = "got no credentials type";
-my $carpnoapir = "got no API Hash reference";
+my $carpnohash = "got no hash value";
+my $carpnoname = "got no name value";
+my $carpnoctyp = "got no credentials type";
+my $carpnoapir = "got no API Hash reference";
+my $carpnotfarg = "got no Timer function argument";
###############################################################################
# Clienthash übernehmen oder zusammenstellen
@@ -364,6 +374,44 @@ sub jboolmap {
return $bool;
}
+####################################################################################
+# Ausgabe der SVG-Funktion "plotAsPng" in eine Datei schreiben
+# Die Datei wird im Verzeichnis "/opt/fhem/www/images" erstellt
+####################################################################################
+sub plotPngToFile {
+ my $name = shift;
+ my $svg = shift;
+ my $hash = $defs{$name};
+ my $file = $name."_SendPlot.png";
+ my $path = $attr{global}{modpath}."/www/images";
+ my $err = "";
+
+ my @options = split ",", $svg;
+ my $svgdev = $options[0];
+ my $zoom = $options[1];
+ my $offset = $options[2];
+
+ if(!$defs{$svgdev}) {
+ $err = qq{SVG device "$svgdev" doesn't exist};
+ Log3($name, 1, "$name - ERROR - $err !");
+
+ setReadingErrorState ($hash, $err);
+ return $err;
+ }
+
+ open (my $FILE, ">", "$path/$file") or do {
+ $err = qq{>PlotToFile< can't open $path/$file for write access};
+ Log3($name, 1, "$name - ERROR - $err !");
+ setReadingErrorState ($hash, $err);
+ return $err;
+ };
+ binmode $FILE;
+ print $FILE plotAsPng(@options);
+ close $FILE;
+
+return ($err, $file);
+}
+
###############################################################################
# vervollständige das übergebene API-Hash mit den Werten aus $data der
# JSON-Antwort
@@ -400,10 +448,10 @@ sub showAPIinfo {
my $out = "";
$out .= "Synology $type API Info
";
$out .= "
API | Path | Version | Changed | ||
API | Path | Version | Modified | ||