Compare commits
26 Commits
master
...
mhop_20102
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ac6b05f43 | |||
| 04e35b18cb | |||
| 289c6c17de | |||
| 3592e9d765 | |||
|
|
7c3607bfff | ||
|
|
2267569195 | ||
|
|
d54c8cd784 | ||
| 020b885e81 | |||
|
|
2c6b5e49fe | ||
| 70df0f4fcd | |||
| d97c3b1dc0 | |||
| fac3fd23fc | |||
| 51019c9692 | |||
| 64b19c5028 | |||
| 5dd1dedf17 | |||
| 2b6bf795bc | |||
| 7578929636 | |||
| 06c16d0ac2 | |||
| 85db7f100e | |||
| bb353bf884 | |||
| 0d99416251 | |||
|
|
5aac7b589a | ||
|
|
c2e651f78a | ||
|
|
2d651c5156 | ||
|
|
e7dc1f6253 | ||
|
|
aeed07e68c |
@@ -488,10 +488,12 @@ sub Twilight_getWeatherHorizon(@)
|
|||||||
|
|
||||||
my $location=$hash->{WEATHER};
|
my $location=$hash->{WEATHER};
|
||||||
if ($location == 0) {
|
if ($location == 0) {
|
||||||
$hash->{WEATHER_HORIZON}="0";
|
$hash->{WEATHER_HORIZON}=$hash->{INDOOR_HORIZON}+1;
|
||||||
$hash->{CONDITION}="0";
|
$hash->{CONDITION}="-1";
|
||||||
return 1;
|
#$hash->{WEATHER_HORIZON}="0";
|
||||||
}
|
#$hash->{CONDITION}="0";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
my $mod = "[".$hash->{NAME} ."] ";
|
my $mod = "[".$hash->{NAME} ."] ";
|
||||||
my @faktor_cond_code = (10,10,10,10, 9, 7, 7, 7, 7, 7,
|
my @faktor_cond_code = (10,10,10,10, 9, 7, 7, 7, 7, 7,
|
||||||
|
|||||||
@@ -181,7 +181,8 @@ WS3600_Initialize($)
|
|||||||
|
|
||||||
# Consumer
|
# Consumer
|
||||||
$hash->{DefFn} = "WS3600_Define";
|
$hash->{DefFn} = "WS3600_Define";
|
||||||
$hash->{AttrList}= "model:WS3600,WS2300,WS1080,WS3080";
|
$hash->{AttrList}= "model:WS3600,WS2300,WS1080,WS3080 ".
|
||||||
|
$readingFnAttributes;
|
||||||
# $hash->{ReadFn} = "WS3600_Read";
|
# $hash->{ReadFn} = "WS3600_Read";
|
||||||
$hash->{UndefFn} = "WS3600_Undef";
|
$hash->{UndefFn} = "WS3600_Undef";
|
||||||
}
|
}
|
||||||
@@ -267,7 +268,7 @@ WS3600_Read($)
|
|||||||
# Log 1-GetLogLevel($name,0), "WS3600(Err): (1) Error";
|
# Log 1-GetLogLevel($name,0), "WS3600(Err): (1) Error";
|
||||||
|
|
||||||
# Log3 $name, 4, "WS3600(Dbg): $name Read started using \"$dev\"";
|
# Log3 $name, 4, "WS3600(Dbg): $name Read started using \"$dev\"";
|
||||||
Log3 $name, 3, "WS3600(Msg): $name Read started";
|
# Log3 $name, 3, "WS3600(Msg): $name Read started";
|
||||||
@lines = `$dev`; # call external program
|
@lines = `$dev`; # call external program
|
||||||
|
|
||||||
foreach my $inputline ( @lines ) {
|
foreach my $inputline ( @lines ) {
|
||||||
@@ -275,10 +276,14 @@ WS3600_Read($)
|
|||||||
my ($rawreading, $val, $val2) = split(/ /, $inputline, 3);
|
my ($rawreading, $val, $val2) = split(/ /, $inputline, 3);
|
||||||
if(defined($rawreading)) {
|
if(defined($rawreading)) {
|
||||||
if(!defined($val2)) { $val2 = ""; }
|
if(!defined($val2)) { $val2 = ""; }
|
||||||
Log3 $name, 4, "WS3600(Dbg): $name read $inputline|$rawreading|$val|$val2";
|
my $logmsg = "WS3600(Dbg): $name read $inputline|$rawreading|$val";
|
||||||
|
$logmsg .= "|$val2" if(defined($val2));
|
||||||
|
# Log3 $name, 4, $logmsg;
|
||||||
|
# Log3 $name, 4, "WS3600(Dbg): $name read $inputline|$rawreading|$val|$val2";
|
||||||
if(defined($TranslatedCodes{$rawreading})) {
|
if(defined($TranslatedCodes{$rawreading})) {
|
||||||
$reading = $TranslatedCodes{$rawreading};
|
$reading = $TranslatedCodes{$rawreading};
|
||||||
readingsBulkUpdate($hash,$reading, $val);
|
readingsBulkUpdate($hash,$reading, $val);
|
||||||
|
Log3 $name, 4, "WS3600(Dbg): $name read $inputline|$rawreading|$reading|$val|$val2";
|
||||||
$AnythingRead = 1;
|
$AnythingRead = 1;
|
||||||
}
|
}
|
||||||
# write Date/Time-Records
|
# write Date/Time-Records
|
||||||
@@ -304,7 +309,7 @@ WS3600_Read($)
|
|||||||
. " Ti: " . $defs{$name}{READINGS}{"Temp-inside"}{VAL}
|
. " Ti: " . $defs{$name}{READINGS}{"Temp-inside"}{VAL}
|
||||||
. " Hi: " . $defs{$name}{READINGS}{"rel-Humidity-inside"}{VAL};
|
. " Hi: " . $defs{$name}{READINGS}{"rel-Humidity-inside"}{VAL};
|
||||||
|
|
||||||
$hash->{CHANGED}[0] = $hash->{STATE};
|
# $hash->{CHANGED}[0] = $hash->{STATE};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$hash->{STATE} = "no data received";
|
$hash->{STATE} = "no data received";
|
||||||
|
|||||||
449
fhem/FHEM/99_MyUtils.pm
Normal file
449
fhem/FHEM/99_MyUtils.pm
Normal file
@@ -0,0 +1,449 @@
|
|||||||
|
|
||||||
|
package main;
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use POSIX;
|
||||||
|
use feature "state";
|
||||||
|
|
||||||
|
sub MyUtils_Initialize($$)
|
||||||
|
{
|
||||||
|
my ($hash) = @_;
|
||||||
|
}
|
||||||
|
|
||||||
|
use constant {
|
||||||
|
STATE_IDLE => 0,
|
||||||
|
STATE_HOCH => 1,
|
||||||
|
STATE_RUNTER => 2,
|
||||||
|
STATE_SCHLITZ => 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
use constant {
|
||||||
|
TEMP_COLD => 0,
|
||||||
|
TEMP_LOW => 1,
|
||||||
|
TEMP_OK => 2,
|
||||||
|
TEMP_HIGH => 3,
|
||||||
|
TEMP_HOT => 4,
|
||||||
|
};
|
||||||
|
my $tempIn_offset=0;
|
||||||
|
my $tempOut_offset=+5;
|
||||||
|
my $tempOutForecastLimit=28;
|
||||||
|
|
||||||
|
# CheckSkip
|
||||||
|
use constant {
|
||||||
|
SKIP_NO => 0,
|
||||||
|
SKIP_ALL => 1,
|
||||||
|
SKIP_DOWN => 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
# CheckWeather
|
||||||
|
use constant {
|
||||||
|
WEATHER_SUNNY => 0,
|
||||||
|
WEATHER_CLOUDY => 1,
|
||||||
|
WEATHER_BAD => 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
# dir: Himmelsrichtung des Fensters
|
||||||
|
# typ: n-normal, s-schlaf bis wecken geschlossen, o-nachts offen
|
||||||
|
my @rolls = (
|
||||||
|
{ roll => "wohn.rollTerrR", dir=>"W", typ=>"no", temp=>"tempWohn", tempSoll=>20, win=>"wohn.fenTerr", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "wohn.rollTerrL", dir=>"W", typ=>"n", temp=>"tempWohn", tempSoll=>20, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "wohn.rollSofa", dir=>"S", typ=>"n", temp=>"tempWohn", tempSoll=>20, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "ess.roll", dir=>"S", typ=>"n", temp=>"tempWohn", tempSoll=>20, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "kuch.rollBar", dir=>"S", typ=>"n", temp=>"tempKueche", tempSoll=>20, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "kuch.rollStr", dir=>"O", typ=>"n", temp=>"tempKueche", tempSoll=>20, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "arb.rollTerr", dir=>"W", typ=>"no", temp=>"tempStudio", tempSoll=>20, win=>"", block=>"blockRoll", state=>STATE_IDLE, },
|
||||||
|
{ roll => "arb.rollWeg", dir=>"S", typ=>"n", temp=>"tempStudio", tempSoll=>20, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "bad.roll", dir=>"S", typ=>"n", temp=>"tempBad", tempSoll=>22, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "schlaf.rollWeg", dir=>"S", typ=>"s", temp=>"tempSchlaf", tempSoll=>18, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "schlaf.rollStr", dir=>"O", typ=>"so", temp=>"tempSchlaf", tempSoll=>18, win=>"", block=>"", state=>STATE_IDLE, },
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
my $tc=0;
|
||||||
|
my @blocktime=localtime;
|
||||||
|
my $blocktimerRunning=0;
|
||||||
|
#my @schlitzblocktime=localtime;
|
||||||
|
#my $schlitzBlocktimerRunning=0;
|
||||||
|
my $delaySec=11;
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub myfhem($)
|
||||||
|
{
|
||||||
|
#Log 1, "@_";
|
||||||
|
fhem("@_");
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub findRoll($)
|
||||||
|
{
|
||||||
|
my($name) = @_;
|
||||||
|
my $r=0;
|
||||||
|
|
||||||
|
for $r (@rolls) {
|
||||||
|
if ($r->{roll} eq $name) {
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub Dbg($) {
|
||||||
|
if(Value("DebugRoll") eq "1") {
|
||||||
|
Log 1,$_[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub getDelayTime($)
|
||||||
|
{
|
||||||
|
my ($delay_sec) = @_;
|
||||||
|
my @tparts = gmtime($delay_sec);
|
||||||
|
my $t=sprintf ("%02d:%02d:%02d",@tparts[2,1,0]);
|
||||||
|
return($t);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollRunterSchlitz($$$)
|
||||||
|
{
|
||||||
|
my ($r, $skipRunter, $ndelay) = @_;
|
||||||
|
$ndelay ||= 0;
|
||||||
|
|
||||||
|
if ($skipRunter==SKIP_NO || $skipRunter==SKIP_DOWN ) {
|
||||||
|
if ($r->{state}!=STATE_SCHLITZ) {
|
||||||
|
my $t1=getDelayTime($ndelay*$delaySec);
|
||||||
|
my $t2=getDelayTime($ndelay*$delaySec+39);
|
||||||
|
my $i=$tc++;
|
||||||
|
|
||||||
|
Dbg("RollChg: $r->{roll} - runter schlitz($ndelay)\n");
|
||||||
|
SchlitzBlockStart($r);
|
||||||
|
myfhem("define rc".$i." at +".$t1." set ".$r->{roll}." closes");
|
||||||
|
myfhem("define ru".$i." at +".$t2." set ".$r->{roll}." up 6");
|
||||||
|
$r->{state}=STATE_SCHLITZ;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollHoch($$$)
|
||||||
|
{
|
||||||
|
my ($r, $skipHoch, $ndelay) = @_;
|
||||||
|
$ndelay ||= 0;
|
||||||
|
|
||||||
|
if ($skipHoch==SKIP_NO) {
|
||||||
|
if ($r->{state}!=STATE_HOCH) {
|
||||||
|
my $t1=getDelayTime($ndelay*$delaySec);
|
||||||
|
my $i=$tc++;
|
||||||
|
|
||||||
|
Dbg("RollChg: $r->{roll} - hoch($ndelay)\n");
|
||||||
|
myfhem("define ro".$i." at +".$t1." set ". $r->{roll} ." opens");
|
||||||
|
$r->{state}=STATE_HOCH;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollRunter($$$)
|
||||||
|
{
|
||||||
|
my ($r, $skipRunter, $ndelay) = @_;
|
||||||
|
$ndelay ||= 0;
|
||||||
|
|
||||||
|
if ($skipRunter==SKIP_NO) {
|
||||||
|
if ($r->{state}!=STATE_RUNTER) {
|
||||||
|
my $t1=getDelayTime($ndelay*$delaySec);
|
||||||
|
my $i=$tc++;
|
||||||
|
|
||||||
|
Dbg("RollChg: $r->{roll} - runter($ndelay)\n");
|
||||||
|
myfhem("define rc".$i." at +".$t1." set ".$r->{roll}." closes");
|
||||||
|
$r->{state}=STATE_RUNTER;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub IsSunny($)
|
||||||
|
{
|
||||||
|
my ($wett)=@_;
|
||||||
|
if($wett==30|| $wett==32 || $wett==34 || $wett==36) { # sonnig, heiter, heiss
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub IsLater($)
|
||||||
|
{
|
||||||
|
my($t)=@_;
|
||||||
|
#Dbg("Islater:$t");
|
||||||
|
my @time = localtime(time);
|
||||||
|
if ($t =~ /(\d+):(\d+)/ and ($time[2]>=$1) and ($time[1]>=$2) ) {
|
||||||
|
#Dbg("later:$t");
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
# Nach dem Wechsel auf !sonne noch 2Std warten
|
||||||
|
sub IsWetterSonneWait($)
|
||||||
|
{
|
||||||
|
my ($wett)=@_;
|
||||||
|
|
||||||
|
state $wettalt=0;
|
||||||
|
if($wett != $wettalt) {
|
||||||
|
if(!IsSunny($wett)) {
|
||||||
|
if(IsSunny($wettalt)) {
|
||||||
|
@blocktime=localtime;
|
||||||
|
$blocktime[2]+=2; # +2Std
|
||||||
|
if($blocktime[2]>23) { $blocktime[2]=23; } # da nachts keine sonne scheint egal
|
||||||
|
$blocktimerRunning=1;
|
||||||
|
Dbg("Wechsel auf sonnig");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$wettalt=$wett;
|
||||||
|
}
|
||||||
|
if($blocktimerRunning) {
|
||||||
|
if(!IsLater("$blocktime[2]:$blocktime[1]")) {
|
||||||
|
return(1);
|
||||||
|
} else {
|
||||||
|
$blocktimerRunning=0;
|
||||||
|
Dbg("Sonnigblockierung Ende");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub SchlitzBlockStart($)
|
||||||
|
{
|
||||||
|
my ($r) = @_;
|
||||||
|
@{$r->{bt}}=localtime;
|
||||||
|
@{$r->{bt}}[2]+=2; # +2Std
|
||||||
|
if(@{$r->{bt}}[2]>23) { @{$r->{bt}}[2]=23; } # da nachts keine sonne scheint egal
|
||||||
|
$r->{btr}=1;
|
||||||
|
Dbg("Schlitzblockstart $r->{roll}");
|
||||||
|
}
|
||||||
|
|
||||||
|
sub SchlitzBlockCheck($)
|
||||||
|
{
|
||||||
|
my ($r) = @_;
|
||||||
|
if($r->{btr}) {
|
||||||
|
if(!IsLater("@{$r->{bt}}[2]:@{$r->{bt}}[1]")) {
|
||||||
|
Dbg("Schlitz blocked");
|
||||||
|
return(0);
|
||||||
|
} else {
|
||||||
|
$r->{btr}=0;
|
||||||
|
Dbg("Schlitzblock End $r->{roll}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub setTagHell($$)
|
||||||
|
{
|
||||||
|
my ($twil, $light) = @_;
|
||||||
|
if ($twil>=3 && $twil<10) { # civil
|
||||||
|
myfhem("set tag 1");
|
||||||
|
} else {
|
||||||
|
myfhem("set tag 0");
|
||||||
|
}
|
||||||
|
if ($light>=5) { # weather
|
||||||
|
myfhem("set hell 1");
|
||||||
|
} else {
|
||||||
|
myfhem("set hell 0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
# Die maximal für den aktuellen Tag verhergesagte Temperatur bestimmen
|
||||||
|
OBsub getTempMaxForecast()
|
||||||
|
{
|
||||||
|
# aktuellen Wert auch einbeziehen
|
||||||
|
my $max=ReadingsVal("wetter", "tempHigh", 20);
|
||||||
|
for (my $i=1; $i<=6; $i++) {
|
||||||
|
my $temp = ReadingsVal("wetter", "hfc".$i."_tempHigh", 20);
|
||||||
|
if($temp>$max) { $max=$temp; }
|
||||||
|
#print("i:$i t:$temp, m=$max\n");
|
||||||
|
}
|
||||||
|
return $max;
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
# Raum zu warm und aussentemp hoch ?
|
||||||
|
sub checkTemps($$$)
|
||||||
|
{
|
||||||
|
my($temp, $tempOut, $tempSoll)=@_;
|
||||||
|
my $tempI=TEMP_OK; my $tempO=TEMP_OK;
|
||||||
|
|
||||||
|
if ($temp > $tempSoll+$tempIn_offset+3.0) { $tempI=TEMP_HOT; }
|
||||||
|
if ($temp > $tempSoll+$tempIn_offset+0.5) { $tempI=TEMP_HIGH; }
|
||||||
|
if ($temp < $tempSoll+$tempIn_offset-0.5) { $tempI=TEMP_LOW; }
|
||||||
|
if ($tempOut > $tempSoll+$tempOut_offset+4.0) { $tempO=TEMP_HOT; }
|
||||||
|
if ($tempOut > $tempSoll+$tempOut_offset+1.0) { $tempO=TEMP_HIGH; }
|
||||||
|
if ($tempOut < $tempSoll+$tempOut_offset-1.0) { $tempO=TEMP_LOW; }
|
||||||
|
if ($tempOut < $tempSoll+$tempOut_offset-1.5) { $tempO=TEMP_COLD; }
|
||||||
|
return($tempI, $tempO);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
# Sonne scheint ins Fenster ?
|
||||||
|
sub checkSunIn($$$$$)
|
||||||
|
{
|
||||||
|
my($twil, $sun_dir, $win_dir, $sunblock, $sunny)=@_;
|
||||||
|
# Sonne scheint ins Fenster ?
|
||||||
|
my $sun_in=0;
|
||||||
|
my $dir_in=0;
|
||||||
|
if($twil>=5 && $twil<7) { # nur, wenn der Sonnenstand ueber 'weather' liegt
|
||||||
|
if (index($sun_dir, $win_dir) != -1) { # Sonnenrichtung ins Fenster
|
||||||
|
$dir_in=1;
|
||||||
|
if ($sunblock) { $sun_in=1; }
|
||||||
|
if ($sunny) { $sun_in=1; }
|
||||||
|
#Dbg("son3, $sonne");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ($sun_in, $dir_in);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
# Offene Fenster nicht mit Rollaeden verschliessen
|
||||||
|
sub checkSkip($)
|
||||||
|
{
|
||||||
|
my ($r)=@_;
|
||||||
|
|
||||||
|
my $wach=Value("wach");
|
||||||
|
my $winstate=Value($r->{win});
|
||||||
|
my $typ=$r->{typ};
|
||||||
|
my $skipRunter=SKIP_NO; my $skipHoch=SKIP_NO;
|
||||||
|
|
||||||
|
if (Value($r->{block})) {
|
||||||
|
$skipRunter=SKIP_ALL;
|
||||||
|
$skipHoch=SKIP_ALL;
|
||||||
|
}
|
||||||
|
if ($winstate eq "Open") {
|
||||||
|
# Offene Fenster nicht mit Rollaeden verschliessen
|
||||||
|
$skipRunter=SKIP_ALL;
|
||||||
|
} elsif (index($typ, "o") != -1) {
|
||||||
|
#Dbg("Skip0: t:$typ w:$winstate r:$skipRunter h:$skipHoch");
|
||||||
|
|
||||||
|
# bei typ o nur auf schlitz schliessen
|
||||||
|
$skipRunter=SKIP_DOWN;
|
||||||
|
}
|
||||||
|
# Zur Schlafzeit nicht oeffnen
|
||||||
|
if (index($typ, "s") != -1) {
|
||||||
|
#Dbg("Skip1: t:$typ w:winstate r:$skipRunter h:$skipHoch");
|
||||||
|
if($wach eq "0") {
|
||||||
|
#Dbg("Skip2: t:$typ w:winstate r:$skipRunter h:$skipHoch");
|
||||||
|
|
||||||
|
$skipHoch=SKIP_ALL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#Dbg("Skip: t:$typ w:winstate r:$skipRunter h:$skipHoch");
|
||||||
|
return($skipRunter, $skipHoch);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollCheck()
|
||||||
|
{
|
||||||
|
state $tagalt=0;
|
||||||
|
state $wachalt=0;
|
||||||
|
|
||||||
|
my $r;
|
||||||
|
my $ndelay = 0;
|
||||||
|
my $tempOut = ReadingsVal("myWH1080", "Temp-outside", 40);
|
||||||
|
my $tempOutMaxForecast = getTempMaxForecast(); #ReadingsVal("wetter", "tempHigh", 40),
|
||||||
|
my $twil = Value("twil");
|
||||||
|
my $light = ReadingsVal("twil", "light", 0);
|
||||||
|
my $wett = ReadingsVal("wetter", "code", 99);
|
||||||
|
|
||||||
|
my $sr = Value("sonnenrichtung");
|
||||||
|
my $sunny = IsSunny($wett);
|
||||||
|
my $dawn = 0;
|
||||||
|
|
||||||
|
setTagHell($twil, $light);
|
||||||
|
my $tag=Value("tag");
|
||||||
|
my $wach=Value("wach");
|
||||||
|
# Nach wechsel von sonne auf !sonne blockert ?
|
||||||
|
my $sonneblock=IsWetterSonneWait($wett);
|
||||||
|
if($twil>=7) { # ss-weather
|
||||||
|
$dawn=1;
|
||||||
|
}
|
||||||
|
for $r ( @rolls ) {
|
||||||
|
#Dbg("--------r:g ".$r->{roll}." / ".$r->{temp});
|
||||||
|
my $run=0;
|
||||||
|
my $tempIn=ReadingsVal($r->{temp},"temperature", 99);
|
||||||
|
my($tempI, $tempO)=checkTemps($tempIn, $tempOut, $r->{tempSoll}); # Temperatur klassifizieren
|
||||||
|
my($sunIn, $sunDir) =checkSunIn($twil, $sr, $r->{dir}, $sonneblock, $sunny); # Sonne scheint ins Fenster ?
|
||||||
|
# Offene Fenster nicht mit Rollaeden verschliessen, zur Schlafenszeit nicht öffnen
|
||||||
|
my ($skipRunter, $skipHoch)=checkSkip($r);
|
||||||
|
# Bedingungen zum Fahren
|
||||||
|
my $Hot = $tempO>=TEMP_HOT;
|
||||||
|
my $WarmSun = $sunIn && $tempO>=TEMP_HIGH;
|
||||||
|
my $WarmHotIn = $sunDir && $tempO>=TEMP_HIGH && $tempI>=TEMP_HOT;
|
||||||
|
my $ForecastHotSun = $sunIn && $tempOutMaxForecast>=$tempOutForecastLimit;
|
||||||
|
my $ForecastHotWarmIn = $sunDir && $tempOutMaxForecast>=$tempOutForecastLimit && $tempI>=TEMP_HIGH;
|
||||||
|
my $Cold = $tempO<=TEMP_COLD;
|
||||||
|
my $NoSunNotHot = !$sunIn && ($tempO<=TEMP_LOW || $tempI<=TEMP_OK);
|
||||||
|
|
||||||
|
if (!$tag) {
|
||||||
|
$run=RollRunter($r, $skipRunter, $ndelay++);
|
||||||
|
} elsif ($dawn) { # Abenddämmerung
|
||||||
|
$run=RollHoch($r, $skipHoch, $ndelay++);
|
||||||
|
} elsif ($Hot || $WarmSun || $WarmHotIn || $ForecastHotSun || $ForecastHotWarmIn) {
|
||||||
|
$run=RollRunterSchlitz($r, $skipRunter, $ndelay++);
|
||||||
|
} elsif ( $Cold || $NoSunNotHot ) {
|
||||||
|
if(!SchlitzBlockCheck($r)) { $run=RollHoch($r, $skipHoch, $ndelay++); }
|
||||||
|
} elsif ( ($tag && !$tagalt) || ($wach && !$wachalt) ) { # bei Tagesbeginn hoch
|
||||||
|
$run=RollHoch($r, $skipHoch, $ndelay++);
|
||||||
|
}
|
||||||
|
# if ($run) {
|
||||||
|
Dbg("RollCheck: H:$Hot WS:$WarmSun WHI:$WarmHotIn FHS:$ForecastHotSun FHI:$ForecastHotWarmIn C:$Cold NSNH:$NoSunNotHot "
|
||||||
|
. "to:$tempOut twil:$twil light:$light wett:$wett sr:$sr block:$sonneblock tomax:$tempOutMaxForecast "
|
||||||
|
. "$r->{roll}-tempLevI,O:$tempI,$tempO tempI,O:$tempIn,$tempOut sun:$sunIn/$sunDir wett:$wett sr:$sr "
|
||||||
|
. "twil:$twil tag:$tag/$tagalt wach:$wach/$wachalt skipR,H:$skipRunter,$skipHoch st:$r->{state}");
|
||||||
|
# }
|
||||||
|
} # for $r
|
||||||
|
$tagalt=$tag;
|
||||||
|
$wachalt=$wach;
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub Untoggle($)
|
||||||
|
{
|
||||||
|
my ($obj) = @_;
|
||||||
|
if (Value($obj) eq "toggle"){
|
||||||
|
if (OldValue($obj) eq "off") {
|
||||||
|
{fhem ("setstate ".$obj." on")}
|
||||||
|
} else {
|
||||||
|
{fhem ("setstate ".$obj." off")}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
{fhem ("setstate ".$obj." ".Value($obj))}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
||||||
715
fhem/FHEM/verschattung.pm
Normal file
715
fhem/FHEM/verschattung.pm
Normal file
@@ -0,0 +1,715 @@
|
|||||||
|
package main;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use POSIX;
|
||||||
|
use feature "state";
|
||||||
|
|
||||||
|
sub MyUtils_Initialize($$)
|
||||||
|
{
|
||||||
|
my ($hash) = @_;
|
||||||
|
}
|
||||||
|
|
||||||
|
use constant {
|
||||||
|
STATE_IDLE => 0,
|
||||||
|
STATE_HOCH => 1,
|
||||||
|
STATE_RUNTER => 2,
|
||||||
|
STATE_SCHLITZ => 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
my @rolls = (
|
||||||
|
{ roll => "wohn.rollTerrR", dir=>"W", typ=>"n", temp=>"tempWohn", tempSoll=>20, tempSchalt=>-1, win=>"wohn.fenTerr", state=>STATE_IDLE, },
|
||||||
|
{ roll => "wohn.rollTerrL", dir=>"W", typ=>"n", temp=>"tempWohn", tempSoll=>20, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "wohn.rollSofa", dir=>"S", typ=>"n", temp=>"tempWohn", tempSoll=>20, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "ess.roll", dir=>"S", typ=>"n", temp=>"tempWohn", tempSoll=>20, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "kuch.rollBar", dir=>"S", typ=>"n", temp=>"tempKueche", tempSoll=>20, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "kuch.rollStr", dir=>"O", typ=>"n", temp=>"tempKueche", tempSoll=>20, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "arb.rollTerr", dir=>"W", typ=>"n", temp=>"tempStudio", tempSoll=>20, tempSchalt=>-1, win=>"wohn.fenTerr", state=>STATE_IDLE, },
|
||||||
|
{ roll => "arb.rollWeg", dir=>"S", typ=>"n", temp=>"tempStudio", tempSoll=>20, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "bad.roll", dir=>"S", typ=>"n", temp=>"tempBad", tempSoll=>23, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "schlaf.rollWeg", dir=>"S", typ=>"s", temp=>"tempSchlaf", tempSoll=>18, tempSchalt=>-1, win=>"", state=>STATE_IDLE, },
|
||||||
|
{ roll => "schlaf.rollStr", dir=>"O", typ=>"s", temp=>"tempSchlaf", tempSoll=>18, tempSchalt=>-1, win=>"wohn.fenTerr", state=>STATE_IDLE, },
|
||||||
|
);
|
||||||
|
|
||||||
|
my @schatten = (
|
||||||
|
{ roll => "wohn.rollTerrR", dir=>"W", typ=>"n", temp=>"tempWohn", tempSoll=>20, win=>"wohn.fenTerr", },
|
||||||
|
{ roll => "wohn.rollTerrL", dir=>"W", typ=>"n", temp=>"tempWohn", tempSoll=>20, win=>"", },
|
||||||
|
{ roll => "wohn.rollSofa", dir=>"S", typ=>"n", temp=>"tempWohn", tempSoll=>20, win=>"", },
|
||||||
|
{ roll => "ess.roll", dir=>"S", typ=>"n", temp=>"tempWohn", tempSoll=>20, win=>"", },
|
||||||
|
{ roll => "kuch.rollBar", dir=>"S", typ=>"n", temp=>"tempKueche", tempSoll=>20, win=>"", },
|
||||||
|
{ roll => "kuch.rollStr", dir=>"O", typ=>"n", temp=>"tempKueche", tempSoll=>20, win=>"", },
|
||||||
|
{ roll => "arb.rollTerr", dir=>"W", typ=>"n", temp=>"tempStudio", tempSoll=>20, win=>"wohn.fenTerr", },
|
||||||
|
{ roll => "arb.rollWeg", dir=>"S", typ=>"n", temp=>"tempStudio", tempSoll=>20, win=>"", },
|
||||||
|
{ roll => "bad.roll", dir=>"S", typ=>"n", temp=>"tempBad", tempSoll=>23, win=>"", },
|
||||||
|
{ roll => "schlaf.rollWeg", dir=>"S", typ=>"s", temp=>"tempSchlaf", tempSoll=>18, win=>"", },
|
||||||
|
{ roll => "schlaf.rollStr", dir=>"O", typ=>"s", temp=>"tempSchlaf", tempSoll=>18, win=>"wohn.fenTerr", },
|
||||||
|
);
|
||||||
|
|
||||||
|
my @rollStates = {
|
||||||
|
{ state=>STATE_IDLE }, # "wohn.rollTerrR",
|
||||||
|
{ state=>STATE_IDLE }, # "wohn.rollTerrL",
|
||||||
|
{ state=>STATE_IDLE }, # "wohn.rollSofa",
|
||||||
|
{ state=>STATE_IDLE }, # "ess.roll",
|
||||||
|
{ state=>STATE_IDLE }, # "kuch.rollBar",
|
||||||
|
{ state=>STATE_IDLE }, # "kuch.rollStr",
|
||||||
|
{ state=>STATE_IDLE }, # "arb.rollTerr",
|
||||||
|
{ state=>STATE_IDLE }, # "arb.rollWeg",
|
||||||
|
{ state=>STATE_IDLE }, # "bad.roll",
|
||||||
|
{ state=>STATE_IDLE }, # "schlaf.rollWeg",
|
||||||
|
{ state=>STATE_IDLE }, # "schlaf.rollStr",
|
||||||
|
};
|
||||||
|
|
||||||
|
#my %rollStates = (
|
||||||
|
# lastWeatherCode => 0,
|
||||||
|
# lastWaetherCodeTime => 0,
|
||||||
|
# timerNum => 0,
|
||||||
|
# );
|
||||||
|
|
||||||
|
|
||||||
|
my @rollHoch = (
|
||||||
|
"bad.roll",
|
||||||
|
"arb.rollWeg",
|
||||||
|
"arb.rollTerr",
|
||||||
|
"kuch.rollStr",
|
||||||
|
"kuch.rollBar",
|
||||||
|
"ess.roll",
|
||||||
|
"wohn.rollSofa",
|
||||||
|
"wohn.rollTerrL",
|
||||||
|
"wohn.rollTerrR"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
my @rollRunter = (
|
||||||
|
"wohn.rollTerrR",
|
||||||
|
"wohn.rollTerrL",
|
||||||
|
"wohn.rollSofa",
|
||||||
|
"ess.roll",
|
||||||
|
"kuch.rollBar",
|
||||||
|
"kuch.rollStr",
|
||||||
|
"arb.rollTerr",
|
||||||
|
"arb.rollWeg",
|
||||||
|
"bad.roll",
|
||||||
|
"schlaf.rollWeg",
|
||||||
|
"schlaf.rollStr"
|
||||||
|
);
|
||||||
|
|
||||||
|
my @rollWeck = (
|
||||||
|
"schlaf.rollWeg",
|
||||||
|
"schlaf.rollStr"
|
||||||
|
);
|
||||||
|
|
||||||
|
my @rollTest = (
|
||||||
|
"wohn.rollTerrR"
|
||||||
|
);
|
||||||
|
|
||||||
|
my @rollSchlaf = (
|
||||||
|
"schlaf.rollWeg",
|
||||||
|
"schlaf.rollStr"
|
||||||
|
);
|
||||||
|
|
||||||
|
my @rollArb = (
|
||||||
|
"arb.rollTerr",
|
||||||
|
"arb.rollWeg",
|
||||||
|
);
|
||||||
|
|
||||||
|
my $tc=0;
|
||||||
|
my @blocktime=localtime;
|
||||||
|
my $blocktimerRunning=0;
|
||||||
|
my $tempHystOffset=-0.9;
|
||||||
|
my $tempHighOffset=0.3;
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub myfhem($) {
|
||||||
|
#Log 1, "@_";
|
||||||
|
fhem("@_");
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollCheckSkip($$)
|
||||||
|
{
|
||||||
|
my($cmd, $roll) = @_;
|
||||||
|
my $skip=0;
|
||||||
|
if ($cmd eq "closes") {
|
||||||
|
if ($roll eq "wohn.rollTerrR") {
|
||||||
|
if (Value("wohn.fenTerr") eq "Open") {
|
||||||
|
$skip=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $skip
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollCmd($$$)
|
||||||
|
{
|
||||||
|
my ($cmd, $roll, $delay) = @_;
|
||||||
|
if(RollCheckSkip($cmd, $roll)==0) {
|
||||||
|
myfhem ("define r".int(rand(10000))." at +".$delay." set ".$roll." ".$cmd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollGroup(\@$$)
|
||||||
|
{
|
||||||
|
my ($rolls, $cmd, $delay) = @_;
|
||||||
|
#Log 1, "RollGroup ## cmd:$cmd del:$delay";
|
||||||
|
my $i;
|
||||||
|
my @myrolls;
|
||||||
|
@myrolls=@$rolls;
|
||||||
|
|
||||||
|
#local $" = ', ';
|
||||||
|
#print "@myrolls $cmd\n";
|
||||||
|
|
||||||
|
$i=0;
|
||||||
|
for my $r (@myrolls) {
|
||||||
|
my @tparts = gmtime($i*$delay+1);
|
||||||
|
my $t=sprintf ("%02d:%02d:%02d",@tparts[2,1,0]);
|
||||||
|
my $skip=0;
|
||||||
|
#$t="00:00:".sprintf("%02d", $i*5);
|
||||||
|
#Log 1, "time $t";
|
||||||
|
if ($cmd eq "closes") {
|
||||||
|
if ($r eq "wohn.rollTerrR") {
|
||||||
|
if (Value("wohn.fenTerr") eq "Open") {
|
||||||
|
$skip=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($skip==0) {
|
||||||
|
myfhem ("define r".$i." at +".$t." set ".$r." ".$cmd);
|
||||||
|
}
|
||||||
|
$i=$i+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollTest() {
|
||||||
|
&RollGroup(\@rollTest, "closes", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollAll($$) {
|
||||||
|
# Log 1, "################";
|
||||||
|
my ($cmd, $delay) = @_;
|
||||||
|
# Log 1, "c:$cmd d:$delay";
|
||||||
|
# &RollGroup(\@rollAlle, $cmd, $delay);
|
||||||
|
if($cmd eq "closes") {
|
||||||
|
&RollGroup(\@rollRunter, $cmd,$delay);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
&RollGroup(\@rollHoch, $cmd,$delay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollWeck($) {
|
||||||
|
my ($delay) = @_;
|
||||||
|
&RollGroup(\@rollWeck, "up 5", $delay);
|
||||||
|
myfhem("define weckwachat at +03:00:00 set wach 1");
|
||||||
|
# myfhem("set wach 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub Dbg($) {
|
||||||
|
if(Value("DebugRoll") eq "1") {
|
||||||
|
Log 1,$_[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollRunterSchlitz($;$) {
|
||||||
|
my ($roll, $delay) = @_;
|
||||||
|
$delay ||= 0;
|
||||||
|
|
||||||
|
my @tparts = gmtime($delay);
|
||||||
|
my $t=sprintf ("%02d:%02d:%02d",@tparts[2,1,0]);
|
||||||
|
my @tparts2 = gmtime($delay+40);
|
||||||
|
my $t2=sprintf ("%02d:%02d:%02d",@tparts2[2,1,0]);
|
||||||
|
my $i=$tc++;
|
||||||
|
|
||||||
|
Dbg("RollChg: $roll - runter schlitz($delay)\n");
|
||||||
|
myfhem("define r".$i." at +".$t." set ".$roll." closes");
|
||||||
|
myfhem("define ru".$i." at +".$t2." set ".$roll." up 6");
|
||||||
|
}
|
||||||
|
|
||||||
|
sub CalcDelay()
|
||||||
|
{
|
||||||
|
my ($delay) = @_;
|
||||||
|
$delay ||= 0;
|
||||||
|
|
||||||
|
my @tparts = gmtime($delay);
|
||||||
|
my $t=sprintf ("%02d:%02d:%02d",@tparts[2,1,0]);
|
||||||
|
my @tparts2 = gmtime($delay+40);
|
||||||
|
my $t2=sprintf ("%02d:%02d:%02d",@tparts2[2,1,0]);
|
||||||
|
my $n=$tc++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub RollRunterSchlitzNeu($;$) {
|
||||||
|
my ($r, $rs, $delay) = @_;
|
||||||
|
$delay ||= 0;
|
||||||
|
|
||||||
|
if($rs->{state}!=STATE_SCHLITZ) {
|
||||||
|
my ($t1, $t2, $n)=CalcDelay($delay);
|
||||||
|
|
||||||
|
Dbg("RollChg: $roll - runter schlitz($delay)\n");
|
||||||
|
myfhem("define r".$n." at +".$t1." set ".$r->{roll}." closes");
|
||||||
|
myfhem("define ru".$n." at +".$t2." set ".$r->{roll}." up 6");
|
||||||
|
}
|
||||||
|
$rs->{state}=STATE_SCHLITZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollHoch($;$) {
|
||||||
|
my ($roll, $delay) = @_;
|
||||||
|
$delay ||= 0;
|
||||||
|
|
||||||
|
my @tparts = gmtime($delay);
|
||||||
|
my $t=sprintf ("%02d:%02d:%02d",@tparts[2,1,0]);
|
||||||
|
my $i=$tc++;
|
||||||
|
|
||||||
|
Dbg("RollChg: $roll - hoch($delay)\n");
|
||||||
|
myfhem("define r".$i." at +".$t." set ".$roll." opens");
|
||||||
|
}
|
||||||
|
|
||||||
|
sub RollHoch2($;$) {
|
||||||
|
my ($roll, $delay) = @_;
|
||||||
|
$delay ||= 0;
|
||||||
|
|
||||||
|
if($rs->{state}!=STATE_HOCH) {
|
||||||
|
my ($t1, $t2, $n)=CalcDelay($delay);
|
||||||
|
|
||||||
|
Dbg("RollChg: $roll - hoch($delay)\n");
|
||||||
|
myfhem("define r".$n." at +".$t1." set ".$r->{roll}." opens");
|
||||||
|
}
|
||||||
|
$rs->{state}=STATE_HOCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub RollRunter($;$) {
|
||||||
|
my ($roll, $delay) = @_;
|
||||||
|
$delay ||= 0;
|
||||||
|
|
||||||
|
my @tparts = gmtime($delay);
|
||||||
|
my $t=sprintf ("%02d:%02d:%02d",@tparts[2,1,0]);
|
||||||
|
my $i=$tc++;
|
||||||
|
|
||||||
|
Dbg("RollChg: $roll - runter($delay)\n");
|
||||||
|
myfhem("define r".$i." at +".$t." set ".$roll." closes");
|
||||||
|
}
|
||||||
|
|
||||||
|
sub RollRunter2($;$) {
|
||||||
|
my ($roll, $delay) = @_;
|
||||||
|
$delay ||= 0;
|
||||||
|
|
||||||
|
if($rs->{state}!=STATE_RUNTER) {
|
||||||
|
my ($t1, $t2, $n)=CalcDelay($delay);
|
||||||
|
|
||||||
|
Dbg("RollChg: $roll - runter($delay)\n");
|
||||||
|
myfhem("define r".$n." at +".$t." set ".$r->{roll}." closes");
|
||||||
|
}
|
||||||
|
$rs->{state}=STATE_HOCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub IsSunny($) {
|
||||||
|
my ($wett)=@_;
|
||||||
|
if($wett==30 || $wett==31 || $wett==32 || $wett==33 || $wett==34 || $wett==35 || $wett==36) { # sonnig, heiter, heiss
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub IsLater($) {
|
||||||
|
my($t)=@_;
|
||||||
|
#Dbg("Islater:$t");
|
||||||
|
my @time = localtime(time);
|
||||||
|
if ($t =~ /(\d+):(\d+)/ and ($time[2]>=$1) and ($time[1]>=$2) ) {
|
||||||
|
Dbg("later:$t");
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub IsSunBlocked($$)
|
||||||
|
{
|
||||||
|
my ($sonneAn, $rs)=@_;;
|
||||||
|
|
||||||
|
state $sonnealt=0;
|
||||||
|
if($sonneAn != $sonneAnalt) {
|
||||||
|
if($sonneAn != 0) {
|
||||||
|
$rs->{@blocktime}=localtime;
|
||||||
|
$rs->{blocktime}[2]+=2; # +2Std
|
||||||
|
if($rs->{blocktime}[2]>23) { $rs->$blocktime[2]=23; } # da nachts keine sonne scheint egal
|
||||||
|
$rs->{blocktimerRunning}=1;
|
||||||
|
}
|
||||||
|
$sonneAnalt=$sonneAn
|
||||||
|
}
|
||||||
|
if($rs->{blocktimerRunning}) {
|
||||||
|
if(!IsLater("$rs->{blocktime}[2]:$rs->{blocktime}[1]")) {
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$rs->{blocktimerRunning}=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
# Nach dem Wechsel auf !sonne noch 2Std warten
|
||||||
|
sub IsWetterSonneWait($) {
|
||||||
|
my ($wett)=@_;
|
||||||
|
|
||||||
|
state $wettalt=0;
|
||||||
|
if($wett != $wettalt) {
|
||||||
|
if(!IsSunny($wett)) {
|
||||||
|
if(IsSunny($wettalt)) {
|
||||||
|
@blocktime=localtime;
|
||||||
|
$blocktime[2]+=2; # +2Std
|
||||||
|
if($blocktime[2]>23) { $blocktime[2]=23; } # da nachts keine sonne scheint egal
|
||||||
|
$blocktimerRunning=1;
|
||||||
|
Dbg("son1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
}
|
||||||
|
$wettalt=$wett;
|
||||||
|
}
|
||||||
|
if($blocktimerRunning) {
|
||||||
|
if(!IsLater("$blocktime[2]:$blocktime[1]")) {
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$blocktimerRunning=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub CheckSum($)
|
||||||
|
{
|
||||||
|
my ($r, $rs)=@_;
|
||||||
|
|
||||||
|
my $twil=Value("twil");
|
||||||
|
my $sonneAn=0;
|
||||||
|
my $sonneAus=0;
|
||||||
|
|
||||||
|
if($twil>=5 && $twil<7) { # nur, wenn der Sonnenstand ueber 'weather' liegt
|
||||||
|
my $tempSoll=$r->{tempSoll};
|
||||||
|
my $temp=ReadingsVal($r->{temp},"temperature", 99);
|
||||||
|
my $tempOut=ReadingsVal("myWH1080", "Temp-outside", 99);
|
||||||
|
|
||||||
|
# bei hoher Raum- und Aussentemperatur immer unten lassen
|
||||||
|
if( ($temp > ($tempSoll-1)) && ($tempOut > $tempSoll) ) {
|
||||||
|
$sonneAn=1;
|
||||||
|
}
|
||||||
|
elsif(($temp < ($tempSoll-1-$tempHyst)) && ($tempOut < ($tempSoll-$tempHyst)) ) {
|
||||||
|
$sonneAus=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Sonne scheint ins Fenster ?
|
||||||
|
elsif (index($sr, $r->{dir}) != -1) { # Sonnenrichtung ins Fenster
|
||||||
|
if(IsSunny($wett)) {
|
||||||
|
$sonneAn=1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sonneAus=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IsSunBlocked($rs, $sonneAn)) {
|
||||||
|
$sonneAus=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ($sonneAn, $SonneAus);
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub CheckTemp()
|
||||||
|
{
|
||||||
|
my ($r, $rs)=@_;
|
||||||
|
|
||||||
|
my $temp=ReadingsVal($r->{temp},"temperature", 99);
|
||||||
|
my $tempSoll=$r->{tempSoll};
|
||||||
|
|
||||||
|
if( ($temp>$tempSoll && $tempOut>($tempSoll-3)) || $temp>($tempSoll+2) ) {
|
||||||
|
$tempH=1;
|
||||||
|
}
|
||||||
|
if( $temp<$tempSoll-1 ) {
|
||||||
|
$tempL=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Offene Fenster nicht mit Rollaeden verschliessen
|
||||||
|
sub CheckSkip()
|
||||||
|
{
|
||||||
|
my ($r, $rs)=@_;
|
||||||
|
|
||||||
|
my $skipRunter=0;
|
||||||
|
my $skipHoch=0;
|
||||||
|
|
||||||
|
if($r->{win} ne "") {
|
||||||
|
my $fen=Value($r->{win});
|
||||||
|
#Dbg("test win:$r->{roll}-$fen");
|
||||||
|
if ($fen eq "Open") {
|
||||||
|
#Dbg("$r->{roll}:skipR");
|
||||||
|
$skipRunter=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Zur Schlafzeit nicht oeffnen
|
||||||
|
if($r->{typ} eq "s") {
|
||||||
|
if(Value("wach") eq "0") {
|
||||||
|
$skipHoch=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub CheckTag()
|
||||||
|
{
|
||||||
|
my $tag=0;
|
||||||
|
my $twil=Value("twil");
|
||||||
|
if ($twil>=3 && $twil<10) { # civil
|
||||||
|
$tag=1;
|
||||||
|
myfhem("set tag 1");
|
||||||
|
} else {
|
||||||
|
myfhem("set tag 0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub CheckHell()
|
||||||
|
{
|
||||||
|
my $light=ReadingsVal("twil", "light", 0);
|
||||||
|
if ($light>=5) { # weather
|
||||||
|
myfhem("set hell 1");
|
||||||
|
} else {
|
||||||
|
myfhem("set hell 0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub SetRollNew()
|
||||||
|
{
|
||||||
|
my ($tag, $sonne,$tempH, $tempL, $skipHoch, $skipRunter)=@_;
|
||||||
|
|
||||||
|
if( $tag and $sonne and $tempH) {
|
||||||
|
if(!$skipHoch && !$skipRunter) {
|
||||||
|
if($rs->{state}!=STATE_SCHLITZ) {
|
||||||
|
RollRunterSchlitz($r, $rs, $ndelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$rs->{state}=STATE_SCHLITZ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(($tag && !$sonne)||($tag && $tempL)) {
|
||||||
|
if($rs->{state}!=STATE_HOCH) {
|
||||||
|
$tempHyst=0;
|
||||||
|
if(!$skipHoch) {
|
||||||
|
RollHoch($r->{roll}, $ndelay);
|
||||||
|
$rs->{state}=STATE_HOCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$tag) {
|
||||||
|
if($rs->{state}!=STATE_RUNTER) {
|
||||||
|
if(!$skipRunter) {
|
||||||
|
RollRunter($r->{roll}, $ndelay);
|
||||||
|
}
|
||||||
|
$rs->{state}=STATE_RUNTER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($tempHyst<50) {
|
||||||
|
$rs->{tempSchalt}=$tempSoll+$tempHyst;
|
||||||
|
}
|
||||||
|
$i=$i+1;
|
||||||
|
|
||||||
|
sub RollCheckNeu()
|
||||||
|
{
|
||||||
|
|
||||||
|
for $r ( @rolls ) {
|
||||||
|
my $rs= shift @rollStates;
|
||||||
|
|
||||||
|
my($SonneAn, $sonnAus) = CheckSun($r, $rs);
|
||||||
|
my($tempH, $tempL) = CheckTemp($r, $rs);
|
||||||
|
my($skipHoch, $skipRunter) = CheckSkip($r, $rs);
|
||||||
|
my $tag=CheckTag();
|
||||||
|
CheckHell();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
sub RollCheck() {
|
||||||
|
my $temp=20;
|
||||||
|
my $r;
|
||||||
|
my $i=0;
|
||||||
|
my $delay=11;
|
||||||
|
my $tag=0;
|
||||||
|
|
||||||
|
#my $tempOut=ReadingsVal("wetter", "temp_c", 99);
|
||||||
|
#my $tempOut=ReadingsVal("naAussen", "temperature", 99);
|
||||||
|
my $tempOut=ReadingsVal("myWH1080", "Temp-outside", 99);
|
||||||
|
|
||||||
|
my $twil=Value("twil");
|
||||||
|
if ($twil>=3 && $twil<10) { # civil
|
||||||
|
$tag=1;
|
||||||
|
myfhem("set tag 1");
|
||||||
|
} else {
|
||||||
|
myfhem("set tag 0");
|
||||||
|
}
|
||||||
|
my $light=ReadingsVal("twil", "light", 0);
|
||||||
|
if ($light>=5) { # weather
|
||||||
|
myfhem("set hell 1");
|
||||||
|
} else {
|
||||||
|
myfhem("set hell 0");
|
||||||
|
}
|
||||||
|
my $wett=ReadingsVal("wetter", "code", 99);
|
||||||
|
my $sr=Value("sonnenrichtung");
|
||||||
|
|
||||||
|
# Nach wechsel von sonne auf !sonne blockert ?
|
||||||
|
my $sonneblock=IsWetterSonneWait($wett);
|
||||||
|
|
||||||
|
Dbg("RollCheck to:$tempOut twil:$twil light:$light wett:$wett sr:$sr block:$sonneblock\n");
|
||||||
|
|
||||||
|
for $r ( @rolls ) {
|
||||||
|
my $rs= shift @rollStates;
|
||||||
|
my $fen="Closed";
|
||||||
|
my $tempH=0;
|
||||||
|
my $tempL=0;
|
||||||
|
my $sonne=0;
|
||||||
|
my $skipRunter=0;
|
||||||
|
my $skipHoch=0;
|
||||||
|
my $ndelay=$i*$delay+1;
|
||||||
|
#Dbg("--------r:g ".$r->{roll}." / ".$r->{temp});
|
||||||
|
|
||||||
|
# Raum zu warm und aussentemp hoch ?
|
||||||
|
#$temp=ReadingsVal($r->{temp},"measured-temp", 99);
|
||||||
|
$temp=ReadingsVal($r->{temp},"temperature", 99);
|
||||||
|
my $tempSoll=$r->{tempSoll};
|
||||||
|
my $tempSchalt=$tempSoll;
|
||||||
|
my $tempHyst=99;
|
||||||
|
if($rs->{tempSchalt}>-1) {
|
||||||
|
$tempSchalt=$rs->{tempSchalt};
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ($temp>$tempSoll && $tempOut>($tempSoll-3)) || $temp>($tempSoll+2) ) {
|
||||||
|
$tempH=1;
|
||||||
|
}
|
||||||
|
if( $temp<$tempSoll-1 ) {
|
||||||
|
$tempL=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# RollCheck:kuch.rollBar-tempH:1 temp:20.25 tempO:32.7 so:0 wett:32 sr:WN twil:6 tag:1 fen:Closed skipR:0 skipH:0 st:3 h:99 ts:20
|
||||||
|
# my($SonneAn, $sonnAus) = CheckSun($r, $rs)
|
||||||
|
|
||||||
|
# Sonne scheint ins Fenster ?
|
||||||
|
if($twil>=5 && $twil<7) { # nur, wenn der Sonnenstand ueber 'weather' liegt
|
||||||
|
# bei hoher Raum- und Aussentemperatur immer unten lassen
|
||||||
|
if($temp > ($tempSchalt+$tempHighOffset) && $tempOut > $tempSchalt+$tempHighOffset) {
|
||||||
|
$sonne=1;
|
||||||
|
$tempHyst=$tempHystOffset;
|
||||||
|
}
|
||||||
|
elsif (index($sr, $r->{dir}) != -1) { # Sonnenrichtung ins Fenster
|
||||||
|
if(IsSunny($wett)) {
|
||||||
|
$sonne=1;
|
||||||
|
}
|
||||||
|
#Dbg("son3, $sonne");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IsSunBlocked($sonne)) {
|
||||||
|
$sonne=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Offene Fenster nicht mit Rollaeden verschliessen
|
||||||
|
if($r->{win} ne "") {
|
||||||
|
$fen=Value($r->{win});
|
||||||
|
#Dbg("test win:$r->{roll}-$fen");
|
||||||
|
if ($fen eq "Open") {
|
||||||
|
#Dbg("$r->{roll}:skipR");
|
||||||
|
$skipRunter=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Zur Schlafzeit nicht oeffnen
|
||||||
|
if($r->{typ} eq "s") {
|
||||||
|
if(Value("wach") eq "0") {
|
||||||
|
$skipHoch=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dbg("RollCheck:$r->{roll}-tempH:$tempH temp:$temp tempO:$tempOut so:$sonne wett:$wett sr:$sr twil:$twil tag:$tag fen:$fen skipR:$skipRunter skipH:$skipHoch st:$r->{state} h:$tempHyst ts:$tempSchalt");
|
||||||
|
|
||||||
|
if( $tag and $sonne and $tempH) {
|
||||||
|
if($rs->{state}!=STATE_SCHLITZ) {
|
||||||
|
if(!$skipHoch && !$skipRunter) {
|
||||||
|
RollRunterSchlitz($r->{roll}, $ndelay);
|
||||||
|
}
|
||||||
|
$rs->{state}=STATE_SCHLITZ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(($tag && !$sonne)||($tag && $tempL)) {
|
||||||
|
if($rs->{state}!=STATE_HOCH) {
|
||||||
|
$tempHyst=0;
|
||||||
|
if(!$skipHoch) {
|
||||||
|
RollHoch($r->{roll}, $ndelay);
|
||||||
|
$rs->{state}=STATE_HOCH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$tag) {
|
||||||
|
if($rs->{state}!=STATE_RUNTER) {
|
||||||
|
if(!$skipRunter) {
|
||||||
|
RollRunter($r->{roll}, $ndelay);
|
||||||
|
}
|
||||||
|
$rs->{state}=STATE_RUNTER;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($tempHyst<50) {
|
||||||
|
$rs->{tempSchalt}=$tempSoll+$tempHyst;
|
||||||
|
}
|
||||||
|
$i=$i+1;
|
||||||
|
} # for
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------
|
||||||
|
|
||||||
|
sub Untoggle($) {
|
||||||
|
my ($obj) = @_;
|
||||||
|
if (Value($obj) eq "toggle"){
|
||||||
|
if (OldValue($obj) eq "off") {
|
||||||
|
{fhem ("setstate ".$obj." on")}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
{fhem ("setstate ".$obj." off")}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
{fhem "setstate ".$obj." ".Value($obj)}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
@@ -6,31 +6,31 @@
|
|||||||
# and write 'user => ""' respectively 'password => ""' instead !
|
# and write 'user => ""' respectively 'password => ""' instead !
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
## for MySQL
|
## for MySQL
|
||||||
####################################################################################
|
################################################################
|
||||||
#%dbconfig= (
|
%dbconfig= (
|
||||||
# connection => "mysql:database=fhem;host=db;port=3306",
|
connection => "mysql:database=fhem;host=nas;port=3306",
|
||||||
# user => "fhemuser",
|
user => "fhemuser",
|
||||||
# password => "fhempassword",
|
password => "fhempassword",
|
||||||
# # optional enable(1) / disable(0) UTF-8 support (at least V 4.042 is necessary)
|
# optional enable(1) / disable(0) UTF-8 support of MySQL (at least V 4.042 necessary)
|
||||||
# utf8 => 1
|
# utf8 => 1,
|
||||||
#);
|
);
|
||||||
####################################################################################
|
################################################################
|
||||||
#
|
#
|
||||||
## for PostgreSQL
|
## for PostgreSQL
|
||||||
####################################################################################
|
################################################################
|
||||||
#%dbconfig= (
|
#%dbconfig= (
|
||||||
# connection => "Pg:database=fhem;host=localhost",
|
# connection => "Pg:database=fhem;host=localhost",
|
||||||
# user => "fhemuser",
|
# user => "fhemuser",
|
||||||
# password => "fhempassword"
|
# password => "fhempassword"
|
||||||
#);
|
#);
|
||||||
####################################################################################
|
################################################################
|
||||||
#
|
#
|
||||||
## for SQLite (username and password stay empty for SQLite)
|
## for SQLite (username and password stay empty for SQLite)
|
||||||
####################################################################################
|
################################################################
|
||||||
#%dbconfig= (
|
#%dbconfig= (
|
||||||
# connection => "SQLite:dbname=/opt/fhem/fhem.db",
|
# connection => "SQLite:dbname=/opt/fhem/fhem.db",
|
||||||
# user => "",
|
# user => "",
|
||||||
# password => ""
|
# password => ""
|
||||||
#);
|
#);
|
||||||
####################################################################################
|
################################################################
|
||||||
|
|||||||
16
fhem/www/gplot/SVG_Regen.gplot
Normal file
16
fhem/www/gplot/SVG_Regen.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2016-09-24 12:51:49
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title 'Niederschlag'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "mm"
|
||||||
|
|
||||||
|
#logdb myWH1080:Rain-total
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Regen' ls l0 lw 1 with lines
|
||||||
22
fhem/www/gplot/SVG_TempHeizungOG.gplot
Normal file
22
fhem/www/gplot/SVG_TempHeizungOG.gplot
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2016-10-10 21:36:42
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title 'OG'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logdb OG_RL_Wohn1:temperature
|
||||||
|
#logdb OG_RL_Wohn2:temperature
|
||||||
|
#logdb OG_RL_Kueche:temperature
|
||||||
|
#logdb OG_RL_Flur:temperature
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Wohn1' ls l0 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Wohn2' ls l1 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Küche' ls l2 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Flur' ls l0 lw 1 with lines
|
||||||
18
fhem/www/gplot/SVG_TempOut.gplot
Normal file
18
fhem/www/gplot/SVG_TempOut.gplot
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2016-11-13 11:10:24
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title 'Temperatur Außen'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logdb myWH1080:Temp-outside
|
||||||
|
#logdb naAussen:temperature
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'WH1080' ls l0 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'NetAtmo' ls l1 lw 1 with lines
|
||||||
24
fhem/www/gplot/SVG_TempRaum.gplot
Normal file
24
fhem/www/gplot/SVG_TempRaum.gplot
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2016-09-23 19:56:37
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title 'Raumtemperatur'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logdb tempWohn:temperature
|
||||||
|
#logdb tempKueche:temperature
|
||||||
|
#logdb tempStudio:temperature
|
||||||
|
#logdb tempSchlaf:temperature
|
||||||
|
#logdb tempBad:temperature
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Wohn' ls l0 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Küche' ls l1 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Studio' ls l2 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Schlaf' ls l3 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Bad' ls l4 lw 1 with lines
|
||||||
20
fhem/www/gplot/SVG_logDGHeizungRL.gplot
Normal file
20
fhem/www/gplot/SVG_logDGHeizungRL.gplot
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-11-04 22:49:54
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logDGHeizung 4:rl7.*:0:
|
||||||
|
#logDGHeizung 4:RL_Bad.*:0:
|
||||||
|
#logDGHeizung 4:rl9.*:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'RL7' ls l0 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'RL_Bad' ls l1 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'RL9' ls l2 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logDGHeizung_1.gplot
Normal file
16
fhem/www/gplot/SVG_logDGHeizung_1.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-11-04 22:46:57
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logDGHeizung 4:DG_VL.*:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'VL' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logNetatmoAussen_1.gplot
Normal file
16
fhem/www/gplot/SVG_logNetatmoAussen_1.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-12-07 18:00:48
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logNetatmoAussen 4:naAussen.temperature\x3a::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logOgRvKueche.gplot
Normal file
16
fhem/www/gplot/SVG_logOgRvKueche.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-10-27 22:27:15
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logOgRvKueche 4:RegExp::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logOgVl.gplot
Normal file
16
fhem/www/gplot/SVG_logOgVl.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-10-31 10:40:49
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logOgVl 4:OG_VL.temperature\x3a:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines
|
||||||
21
fhem/www/gplot/SVG_logOgVl_1.gplot
Normal file
21
fhem/www/gplot/SVG_logOgVl_1.gplot
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
############################
|
||||||
|
# Display the power reported by the EM1010
|
||||||
|
# Corresponding FileLog definition:
|
||||||
|
# define ememlog FileLog /var/log/fhem/emem-%Y.log emem:power.*
|
||||||
|
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
|
||||||
|
set title '<TL>'
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
set grid
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
|
||||||
|
#FileLog 4:RegExp::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 title 'Line 1' with lines
|
||||||
16
fhem/www/gplot/SVG_logOgVl_2.gplot
Normal file
16
fhem/www/gplot/SVG_logOgVl_2.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-10-27 21:46:26
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperatur"
|
||||||
|
|
||||||
|
#logOgVl 4:OG_VL.temperature\x3a:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'VL' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logRlFlur.gplot
Normal file
16
fhem/www/gplot/SVG_logRlFlur.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-10-30 23:05:40
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logRlFlur 4:OG_RL_Flur.*:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Flur' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logRlKueche.gplot
Normal file
16
fhem/www/gplot/SVG_logRlKueche.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-10-27 22:37:42
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logRlKueche 4:OG_RL_Kueche.temperature\x3a:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Kueche' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logRlWohn1.gplot
Normal file
16
fhem/www/gplot/SVG_logRlWohn1.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-10-30 23:06:33
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperatur"
|
||||||
|
|
||||||
|
#logRlWohn1 4:OG_RL_Wohn1.*:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Wohn1' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logRlWohn2.gplot
Normal file
16
fhem/www/gplot/SVG_logRlWohn2.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-10-30 23:07:05
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperatur"
|
||||||
|
|
||||||
|
#logRlWohn2 4:OG_RL_Wohn2.*:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Wohn2' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logTempBad.gplot
Normal file
16
fhem/www/gplot/SVG_logTempBad.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-11-28 18:14:03
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logTempBad 4:tempBad.temperature\x3a::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Bad' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logTempKueche_1.gplot
Normal file
16
fhem/www/gplot/SVG_logTempKueche_1.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-12-04 20:26:59
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logTempKueche 4:tempKueche.temperature\x3a::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logTempSchlaf.gplot
Normal file
16
fhem/www/gplot/SVG_logTempSchlaf.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-11-24 09:12:53
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logTempSchlaf 4:tempSchlaf.*:0:
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Schlaf' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logTempStudio.gplot
Normal file
16
fhem/www/gplot/SVG_logTempStudio.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-11-28 19:38:06
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logTempStudio 4:tempStudio.temperature\x3a::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Studio' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logTempWohn.gplot
Normal file
16
fhem/www/gplot/SVG_logTempWohn.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-12-04 19:42:32
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#FileLog_CUL_FHTTK_150d42 parameter
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines
|
||||||
16
fhem/www/gplot/SVG_logTempWohn_1.gplot
Normal file
16
fhem/www/gplot/SVG_logTempWohn_1.gplot
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2015-12-04 19:49:10
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title '<TL>'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logTempWohn 4:tempWohn.temperature\x3a::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Line 1' ls l0 lw 1 with lines
|
||||||
19
fhem/www/gplot/SVG_logdb_1.gplot
Normal file
19
fhem/www/gplot/SVG_logdb_1.gplot
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# template file for use with DbLog
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
|
||||||
|
set title '<L1>'
|
||||||
|
set ylabel "Humidity"
|
||||||
|
set y2label "Temperature"
|
||||||
|
set grid
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
|
||||||
|
#DbLog device:reading::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 title 'Line 1' with lines
|
||||||
18
fhem/www/gplot/SVG_logdb_2.gplot
Normal file
18
fhem/www/gplot/SVG_logdb_2.gplot
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2016-09-23 19:59:20
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title 'Wetterstation'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel "Druck"
|
||||||
|
set y2label "Wind"
|
||||||
|
|
||||||
|
#logdb myWH1080:Wind-Gust
|
||||||
|
#logdb myWH1080:rel-Pressure
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'Böhen' ls l0 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y1 title 'Druck' ls l1 lw 1 with lines
|
||||||
24
fhem/www/gplot/SVG_logdb_3.gplot
Normal file
24
fhem/www/gplot/SVG_logdb_3.gplot
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Created by FHEM/98_SVG.pm, 2017-11-09 18:05:35
|
||||||
|
set terminal png transparent size <SIZE> crop
|
||||||
|
set output '<OUT>.png'
|
||||||
|
set xdata time
|
||||||
|
set timefmt "%Y-%m-%d_%H:%M:%S"
|
||||||
|
set xlabel " "
|
||||||
|
set title 'Heizung DG'
|
||||||
|
set ytics
|
||||||
|
set y2tics
|
||||||
|
set grid
|
||||||
|
set ylabel ""
|
||||||
|
set y2label "Temperature"
|
||||||
|
|
||||||
|
#logdb DG_VL:temperature::
|
||||||
|
#logdb rl7:temperature::
|
||||||
|
#logdb RL_Bad:temperature::
|
||||||
|
#logdb rl9:temperature::
|
||||||
|
#logdb OG_VL:temperature::
|
||||||
|
|
||||||
|
plot "<IN>" using 1:2 axes x1y2 title 'VL' ls l0 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Studio' ls l1 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Bad' ls l2 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Schlaf' ls l3 lw 1 with lines,\
|
||||||
|
"<IN>" using 1:2 axes x1y2 title 'Vl og' ls l4 lw 1 with lines
|
||||||
Reference in New Issue
Block a user