diff --git a/fhem/FHEM/00_THZ.pm b/fhem/FHEM/00_THZ.pm index 5fdc3d8a7..8182e9f85 100644 --- a/fhem/FHEM/00_THZ.pm +++ b/fhem/FHEM/00_THZ.pm @@ -2,7 +2,7 @@ # 00_THZ # $Id$ # by immi 04/2014 -# v. 0.092 +# v. 0.093 # this code is based on the hard work of Robert; I just tried to port it # http://robert.penz.name/heat-pump-lwz/ # http://heatpumpmonitor.penz.name/heatpumpmonitorwiki/ @@ -51,6 +51,7 @@ sub THZ_debugread($); sub THZ_GetRefresh($); sub THZ_Refresh_all_gets($); sub THZ_Get_Comunication($$); +sub THZ_PrintcurveSVG; @@ -295,9 +296,10 @@ sub THZ_Initialize($) ."interval_sHC2:0,60,120,180,300,600,3600,7200,43200,86400 " ."interval_sHistory:0,3600,7200,28800,43200,86400 " ."interval_sLast10errors:0,3600,7200,28800,43200,86400 " - ."internal_sHeatRecoveredDay:0,3600,7200,28800,43200,86400 " - ."internal_sHeatRecoveredTotal:0,3600,7200,28800,43200,86400 " + ."interval_sHeatRecoveredDay:0,1200,3600,7200,28800,43200,86400 " + ."interval_sHeatRecoveredTotal:0,3600,7200,28800,43200,86400 " . $readingFnAttributes; + $data{FWEXT}{"/THZ_PrintcurveSVG"}{FUNC} = "THZ_PrintcurveSVG"; } @@ -1159,11 +1161,126 @@ sub THZ_Undef($$) { DevIo_CloseDev($hash); return undef; } +##################################### +# sub THZ_PrintcurveSVG +# plots heat curve +#define wl_hr weblink htmlCode {THZ_PrintcurveSVG} +# da mettere dentro lo style per funzionare sopra svg { height:200px; width:800px;} +#define wl_hr2 weblink htmlCode
wl_hr2
+##################################### + +sub THZ_PrintcurveSVG { +my $ret = <<'END'; + + + + + + + + + + + + + + + + + + + + + + + + + + + + +HC1 heat SetTemp °C +outside temperature filtered °C +-15 +-9 +-3 +3 +9 +15 +21 + + 15 + 19 + 23 + 27 + 31 + + + 15 + 19 + 23 + 27 + 31 + +Actual working point +Heat curve +END +my $roomSetTemp =(split ' ',ReadingsVal("Mythz","sHC1",0))[21]; +my $p13GradientHC1 = ReadingsVal("Mythz","p13GradientHC1",0); +my $heatSetTemp =(split ' ',ReadingsVal("Mythz","sHC1",0))[11]; +my $outside_tempFiltered =(split ' ',ReadingsVal("Mythz","sGlobal",0))[65]; +my $p14LowEnDHC1 =(split ' ',ReadingsVal("Mythz","p14LowEnDHC1",0))[0]; +my $a= 1.5 + ($roomSetTemp * 1.3) + $p14LowEnDHC1; +my $b= -10 * $p13GradientHC1 / $roomSetTemp; +my $c= -0.01; +my $Simul_heatSetTemp; + +open (MYFILE, '>/share/simone/txt.txt'); +print MYFILE ($outside_tempFiltered ." xx " . $heatSetTemp ); +close (MYFILE); + +$ret .='/share/simone/data.svg'); +print MYFILE ($ret); +close (MYFILE); +my $FW_RETTYPE = "image/svg+xml"; +return ($FW_RETTYPE, $ret); +#return $ret; +} - +#####################################