Compare commits
10 Commits
2df1e8d26b
...
effa653a15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
effa653a15 | ||
|
|
8a8a64cd91 | ||
| e88e701a59 | |||
| 84c27863f6 | |||
| 5e67aa9dfe | |||
| 91f0669000 | |||
| eb201a9cf2 | |||
| b90ea44b2f | |||
|
|
406dd136b8 | ||
|
|
f240ddc5af |
@@ -431,9 +431,11 @@ sub Twilight_getWeatherHorizon(@)
|
||||
|
||||
my $location=$hash->{WEATHER};
|
||||
if ($location == 0) {
|
||||
$hash->{WEATHER_HORIZON}="0";
|
||||
$hash->{CONDITION}="0";
|
||||
return 1;
|
||||
$hash->{WEATHER_HORIZON}=$hash->{INDOOR_HORIZON}+1;
|
||||
$hash->{CONDITION}="-1";
|
||||
#$hash->{WEATHER_HORIZON}="0";
|
||||
#$hash->{CONDITION}="0";
|
||||
return 1;
|
||||
}
|
||||
|
||||
my $mod = "[".$hash->{NAME} ."] ";
|
||||
|
||||
@@ -2,278 +2,419 @@ package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
sub
|
||||
MyUtils_Initialize($$)
|
||||
use feature "state";
|
||||
|
||||
sub MyUtils_Initialize($$)
|
||||
{
|
||||
my ($hash) = @_;
|
||||
}
|
||||
|
||||
use constant {
|
||||
STATE_IDLE => 0,
|
||||
STATE_HOCH => 1,
|
||||
STATE_RUNTER => 2,
|
||||
STATE_SCHLITZ => 3,
|
||||
STATE_IDLE => 0,
|
||||
STATE_HOCH => 1,
|
||||
STATE_RUNTER => 2,
|
||||
STATE_SCHLITZ => 3,
|
||||
};
|
||||
|
||||
|
||||
my @rolls = (
|
||||
{ roll => "wohn.rollTerrR", dir=>"W", typ=>"n", temp=>"wohn.fht", tempS=>21, win=>"wohn.fenTerr", state=>STATE_IDLE, },
|
||||
{ roll => "wohn.rollTerrL", dir=>"W", typ=>"n", temp=>"wohn.fht", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "wohn.rollSofa", dir=>"S", typ=>"n", temp=>"wohn.fht", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "ess.roll", dir=>"S", typ=>"n", temp=>"wohn.fht", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "kuch.rollBar", dir=>"S", typ=>"n", temp=>"wohn.fht", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "kuch.rollStr", dir=>"O", typ=>"n", temp=>"wohn.fht", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "arb.rollTerr", dir=>"W", typ=>"n", temp=>"studio.fht", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "arb.rollWeg", dir=>"S", typ=>"n", temp=>"studio.fht", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "bad.roll", dir=>"S", typ=>"n", temp=>"bad.fht", tempS=>23, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "schlaf.rollWeg", dir=>"S", typ=>"s", temp=>"schlaf.fht", tempS=>18, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "schlaf.rollStr", dir=>"O", typ=>"s", temp=>"schlaf.fht", tempS=>18, win=>"", state=>STATE_IDLE, },
|
||||
);
|
||||
|
||||
{ roll => "wohn.rollTerrR", dir=>"W", typ=>"n", temp=>"tempWohn", tempS=>21, win=>"wohn.fenTerr", state=>STATE_IDLE, },
|
||||
{ roll => "wohn.rollTerrL", dir=>"W", typ=>"n", temp=>"tempWohn", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "wohn.rollSofa", dir=>"S", typ=>"n", temp=>"tempWohn", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "ess.roll", dir=>"S", typ=>"n", temp=>"tempWohn", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "kuch.rollBar", dir=>"S", typ=>"n", temp=>"tempKueche", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "kuch.rollStr", dir=>"O", typ=>"n", temp=>"tempKueche", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "arb.rollTerr", dir=>"W", typ=>"n", temp=>"tempStudio", tempS=>21, win=>"wohn.fenTerr", state=>STATE_IDLE, },
|
||||
{ roll => "arb.rollWeg", dir=>"S", typ=>"n", temp=>"tempStudio", tempS=>21, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "bad.roll", dir=>"S", typ=>"n", temp=>"tempBad", tempS=>23, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "schlaf.rollWeg", dir=>"S", typ=>"s", temp=>"tempSchlaf", tempS=>18, win=>"", state=>STATE_IDLE, },
|
||||
{ roll => "schlaf.rollStr", dir=>"O", typ=>"s", temp=>"tempSchlaf", tempS=>18, win=>"wohn.fenTerr", state=>STATE_IDLE, },
|
||||
);
|
||||
|
||||
# in dieser Reihenfolge fahren
|
||||
my @rollHoch = (
|
||||
"bad.roll",
|
||||
"arb.rollWeg",
|
||||
"arb.rollTerr",
|
||||
"kuch.rollStr",
|
||||
"kuch.rollBar",
|
||||
"ess.roll",
|
||||
"wohn.rollSofa",
|
||||
"wohn.rollTerrL",
|
||||
"wohn.rollTerrR"
|
||||
);
|
||||
"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"
|
||||
);
|
||||
"wohn.rollTerrR",
|
||||
"wohn.rollTerrL",
|
||||
"wohn.rollSofa",
|
||||
"ess.roll",
|
||||
"kuch.rollBar",
|
||||
"kuch.rollStr",
|
||||
"arb.rollTerr",
|
||||
"arb.rollWeg",
|
||||
"bad.roll",
|
||||
"schlaf.rollWeg",
|
||||
"schlaf.rollStr"
|
||||
);
|
||||
|
||||
# Bei Weckzeit auf Schlitz
|
||||
my @rollWeck = (
|
||||
"schlaf.rollWeg",
|
||||
"schlaf.rollStr"
|
||||
);
|
||||
"schlaf.rollWeg",
|
||||
"schlaf.rollStr"
|
||||
);
|
||||
|
||||
my @rollTest = (
|
||||
"wohn.rollTerrR"
|
||||
);
|
||||
"wohn.rollTerrR"
|
||||
);
|
||||
|
||||
my @rollSchlaf = (
|
||||
"schlaf.rollWeg",
|
||||
"schlaf.rollStr"
|
||||
);
|
||||
"schlaf.rollWeg",
|
||||
"schlaf.rollStr"
|
||||
);
|
||||
|
||||
my @rollArb = (
|
||||
"arb.rollTerr",
|
||||
"arb.rollWeg",
|
||||
);
|
||||
"arb.rollTerr",
|
||||
"arb.rollWeg",
|
||||
);
|
||||
|
||||
#------------------------------------------
|
||||
|
||||
my $tc=0;
|
||||
my @blocktime=localtime;
|
||||
my $blocktimerRunning=0;
|
||||
|
||||
sub myfhem($) {
|
||||
#print "@_\n";
|
||||
#------------------------------------------
|
||||
|
||||
sub myfhemcmd($) {
|
||||
#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
|
||||
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);
|
||||
myfhemcmd ("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;
|
||||
@myrolls=@$rolls;
|
||||
|
||||
#local $" = ', ';
|
||||
#print "@myrolls $cmd\n";
|
||||
|
||||
$i=0;
|
||||
for my $r (@myrolls) {
|
||||
my @tparts = gmtime($i*$delay+1);
|
||||
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 ($r eq "wohn.rollTerrR") {
|
||||
if (Value("wohn.fenTerr") eq "Open") {
|
||||
$skip=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($skip==0) {
|
||||
myfhem ("define r".$i." at +".$t." set ".$r." ".$cmd);
|
||||
myfhemcmd ("define r".$i." at +".$t." set ".$r." ".$cmd);
|
||||
}
|
||||
$i=$i+1;
|
||||
$i=$i+1;
|
||||
}
|
||||
}
|
||||
|
||||
#------------------------------------------
|
||||
|
||||
sub RollTest() {
|
||||
&RollGroup(\@rollTest, "closes", 1);
|
||||
&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);
|
||||
}
|
||||
my ($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("set wach 1");
|
||||
my ($delay) = @_;
|
||||
&RollGroup(\@rollWeck, "up 5", $delay);
|
||||
myfhemcmd ("define weckwachat at +03:00:00 set wach 1");
|
||||
# myfhem("set wach 1");
|
||||
}
|
||||
|
||||
#------------------------------------------
|
||||
|
||||
sub Dbg($) {
|
||||
Log 1,$_[0];
|
||||
Log3 "Roll", 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");
|
||||
myfhemcmd("define r".$i." at +".$t." set ".$roll." closes");
|
||||
myfhemcmd("define ru".$i." at +".$t2." set ".$roll." up 6");
|
||||
}
|
||||
|
||||
#------------------------------------------
|
||||
|
||||
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");
|
||||
myfhemcmd("define r".$i." at +".$t." set ".$roll." opens");
|
||||
}
|
||||
|
||||
#------------------------------------------
|
||||
|
||||
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");
|
||||
myfhemcmd("define r".$i." at +".$t." set ".$roll." closes");
|
||||
}
|
||||
|
||||
#------------------------------------------
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
#------------------------------------------
|
||||
|
||||
# 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 RollCheck() {
|
||||
# Dbg("RollCheck\n");
|
||||
#Dbg("RollCheck\n");
|
||||
my $temp=20;
|
||||
my $wett;
|
||||
my $twil;
|
||||
my $fen;
|
||||
my $r;
|
||||
my $sr;
|
||||
my $i=0;
|
||||
my $delay=11;
|
||||
my $tag=0;
|
||||
|
||||
my $tempOut=ReadingsVal("wetter", "temp_c", 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);
|
||||
|
||||
for $r ( @rolls ) {
|
||||
|
||||
my $tempH=0;
|
||||
my $sonne=0;
|
||||
my $tag=0;
|
||||
my $fen="Closed";
|
||||
my $tempH=0;
|
||||
my $tempL=0;
|
||||
my $sonne=0;
|
||||
my $skipRunter=0;
|
||||
my $skipHoch=0;
|
||||
my @tparts = gmtime($i*$delay+1);
|
||||
my $t=sprintf ("%02d:%02d:%02d",@tparts[2,1,0]);
|
||||
my @tparts2 = gmtime($i*$delay+40);
|
||||
my $t2=sprintf ("%02d:%02d:%02d",@tparts2[2,1,0]);
|
||||
my $ndelay=$i*$delay+1;
|
||||
#Dbg("--------r:g ".$r->{roll}." / ".$r->{temp});
|
||||
|
||||
# Dbg("r:g ".$r->{roll}." / ".$r->{temp}."\n");
|
||||
|
||||
$temp=ReadingsVal($r->{temp},"measured-temp", 99);
|
||||
if($temp > $r->{tempS}) {
|
||||
$tempH=1;
|
||||
}
|
||||
|
||||
$wett=ReadingsVal("wetter", "code", 99);
|
||||
$sr=Value("sonnenrichtung");
|
||||
if($wett==30 || $wett==32 || $wett==34 || $wett==36) { # sonnig, heiter, heiss
|
||||
if (index($sr, $r->{dir}) != -1) {
|
||||
$sonne=1;
|
||||
}
|
||||
}
|
||||
|
||||
$twil=Value("twil");
|
||||
if($twil>=3 && $twil<10) {
|
||||
$tag=1;
|
||||
}
|
||||
|
||||
if($r->{win} ne "") {
|
||||
$fen=Value($r->{win});
|
||||
Dbg("test win:$r->{roll}-$fen");
|
||||
if ($fen eq "Open") {
|
||||
Dbg("$r->{roll}:skipR");
|
||||
$skipRunter=1;
|
||||
}
|
||||
# Raum zu warm und aussentemp hoch ?
|
||||
#$temp=ReadingsVal($r->{temp},"measured-temp", 99);
|
||||
$temp=ReadingsVal($r->{temp},"temperature", 99);
|
||||
if( ($temp>$r->{tempS} && $tempOut>($r->{tempS}-3)) || $temp>($r->{tempS}+2) ) {
|
||||
$tempH=1;
|
||||
}
|
||||
if($r->{typ} eq "s") {
|
||||
if(Value("wach") eq "0") {
|
||||
$skipHoch=1;
|
||||
if( $temp<$r->{tempS}-1 ) {
|
||||
$tempL=1;
|
||||
}
|
||||
|
||||
# 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 > ($r->{tempS}+2) && $tempOut > $r->{tempS}) {
|
||||
$sonne=1;
|
||||
}
|
||||
}
|
||||
elsif (index($sr, $r->{dir}) != -1) { # Sonnenrichtung ins Fenster
|
||||
if($sonneblock) {
|
||||
$sonne=1;
|
||||
}
|
||||
elsif(IsSunny($wett)) {
|
||||
$sonne=1;
|
||||
}
|
||||
#Dbg("son3, $sonne");
|
||||
}
|
||||
}
|
||||
|
||||
# Dbg(" tempH:$tempH so:$sonne tag:$tag skipR:$skipRunter");
|
||||
# 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;
|
||||
}
|
||||
}
|
||||
|
||||
if( $tag and $sonne and $tempH) {
|
||||
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}");
|
||||
|
||||
if( $tag and $sonne and $tempH) {
|
||||
if($r->{state}!=STATE_SCHLITZ) {
|
||||
if(!$skipRunter) {
|
||||
myfhem("define r".$i." at +".$t." set ".$r->{roll}." closes");
|
||||
myfhem("define ru".$i." at +".$t2." set ".$r->{roll}." up 7");
|
||||
Dbg("RollChg: $r->{roll} - runter schlitz\n");
|
||||
if(!$skipHoch && !$skipRunter) {
|
||||
RollRunterSchlitz($r->{roll}, $ndelay);
|
||||
}
|
||||
$r->{state}=STATE_SCHLITZ;
|
||||
}
|
||||
}
|
||||
|
||||
if($tag && !$sonne) {
|
||||
}
|
||||
}
|
||||
|
||||
if(($tag && !$sonne)||($tag && $tempL)) {
|
||||
if($r->{state}!=STATE_HOCH) {
|
||||
if(!$skipHoch) {
|
||||
myfhem("define r".$i." at +".$t." set ".$r->{roll}." opens");
|
||||
Dbg("RollChg: $r->{roll} - hoch\n");
|
||||
}
|
||||
$r->{state}=STATE_HOCH;
|
||||
}
|
||||
}
|
||||
if(!$skipHoch) {
|
||||
RollHoch($r->{roll}, $ndelay);
|
||||
$r->{state}=STATE_HOCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$tag) {
|
||||
if(!$tag) {
|
||||
if($r->{state}!=STATE_RUNTER) {
|
||||
if(!$skipRunter) {
|
||||
myfhem("define r".$i." at +".$t." set ".$r->{roll}." closes");
|
||||
Dbg("RollChg: $r->{roll} - runter\n");
|
||||
}
|
||||
if(!$skipRunter) {
|
||||
RollRunter($r->{roll}, $ndelay);
|
||||
}
|
||||
$r->{state}=STATE_RUNTER;
|
||||
}
|
||||
}
|
||||
$i=$i+1;
|
||||
}
|
||||
}
|
||||
$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")}
|
||||
}
|
||||
if (OldValue($obj) eq "off") {
|
||||
{fhem ("setstate ".$obj." on")}
|
||||
}
|
||||
else {
|
||||
{fhem ("setstate ".$obj." off")}
|
||||
}
|
||||
}
|
||||
else {
|
||||
{fhem "setstate ".$obj." ".Value($obj)}
|
||||
{fhem "setstate ".$obj." ".Value($obj)}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,13 +62,42 @@ SetExtensions($$@)
|
||||
|
||||
if($cmd eq "on-for-timer" || $cmd eq "off-for-timer") {
|
||||
RemoveInternalTimer("SE $name $cmd");
|
||||
delete($hash->{SE_TIMERRUNNING});
|
||||
return "$cmd requires a number as argument" if($param !~ m/^\d*\.?\d*$/);
|
||||
|
||||
if($param) {
|
||||
$hash->{SE_TIMERRUNNING} = $cmd;
|
||||
DoSet($name, $cmd1);
|
||||
InternalTimer(gettimeofday()+$param,"SetExtensionsFn","SE $name $cmd",0);
|
||||
}
|
||||
|
||||
} elsif($cmd eq "on-for-timer-when-off") {
|
||||
my $startTimer=1;
|
||||
my $timercmd="on-for-timer";
|
||||
if(!$hash->{SE_TIMERRUNNING}) {
|
||||
my $actualState = ReadingsVal($name, "state", undef);
|
||||
if($actualState eq $cmd1) {
|
||||
$startTimer=0; # started Manually do not override by timer
|
||||
}
|
||||
}
|
||||
if($startTimer) {
|
||||
RemoveInternalTimer("SE $name $timercmd");
|
||||
delete($hash->{SE_TIMERRUNNING});
|
||||
return "$cmd requires a number as argument" if($param !~ m/^\d*\.?\d*$/);
|
||||
|
||||
if($param) {
|
||||
$hash->{SE_TIMERRUNNING} = $timercmd;
|
||||
DoSet($name, $cmd1);
|
||||
InternalTimer(gettimeofday()+$param,"SetExtensionsFn","SE $name $timercmd",0);
|
||||
}
|
||||
}
|
||||
|
||||
} elsif($cmd eq "on-stop-timer" ) {
|
||||
my $timercmd="on-for-timer";
|
||||
RemoveInternalTimer("SE $name $timercmd");
|
||||
delete($hash->{SE_TIMERRUNNING});
|
||||
DoSet($name, $cmd1);
|
||||
|
||||
} elsif($cmd =~ m/^(on|off)-till/) {
|
||||
my ($err, $hr, $min, $sec, $fn) = GetTimeSpec($param);
|
||||
return "$cmd: $err" if($err);
|
||||
@@ -154,9 +183,11 @@ SetExtensionsFn($)
|
||||
|
||||
|
||||
if($cmd eq "on-for-timer") {
|
||||
$defs{$name}{SE_TIMERRUNNING}="";
|
||||
DoSet($name, "off");
|
||||
|
||||
} elsif($cmd eq "off-for-timer") {
|
||||
$defs{$name}{SE_TIMERRUNNING}="";
|
||||
DoSet($name, "on");
|
||||
|
||||
} elsif($cmd eq "blink" && $defs{$name}{SE_BLINKPARAM}) {
|
||||
|
||||
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_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
|
||||
Reference in New Issue
Block a user