Hi,
Thanks again for this great application.
Im learning a lot but would like to include a sub routine into Fhem.
I have seen some code that I would like to include, but I dont know where to put it?
Can I just put the following in the config file, or do I need to put it into one of the 99 files?
By the way, what are the 99 files for?
Here is the code, if someone could tell me where to paste it I would be very grateful.
16. Setting auto-mode from manual for the FHT won't change the desired temperature!
Thanks to Waldemar Porsche the following notify will take care of that:
define ExtendedAutoMode notify .*mode.*auto {\
$r = $defs{@}{READINGS};;\
return if (!defined($r));;\
my $olddesired = $r->{"desired-temp"}{VAL};;\
return if (!defined($olddesired));;\
my @@day = ("sun", "mon", "tue", "wed", "thu", "fri", "sat");;\
my $now = sprintf("%%02d:%%02d", $hour, $min);;\
my $wd = $day[$wday];;\
my $desired;;\
if (defined($r->{"warnings"}{VAL}) && $r->{"warnings"}{VAL} eq "Window open") {\
$desired = $r->{"windowopen-temp"}{VAL};;\
} elsif (defined($r->{"$wd-from1"}{VAL}) && $r->{"$wd-from1"}{VAL} le $now && defined($r->{"$wd-to1"}{VAL}) && $r->{"$wd-to1"}{VAL} ge $now) {\
$desired = $r->{"day-temp"}{VAL};;\
} elsif (defined($r->{"$wd-from2"}{VAL}) && $r->{"$wd-from2"}{VAL} le $now && defined($r->{"$wd-to2"}{VAL}) && $r->{"$wd-to2"}{VAL} ge $now) {\
$desired = $r->{"day-temp"}{VAL};;\
} else {\
$desired = $r->{"night-temp"}{VAL};;\
}\
fhem ("set @ desired-temp $desired") if (defined($desired) && $desired ne $olddesired);;\
}
attr ExtendedAutoMode comment Setzt fuer den Auto mode die desired-temp in Abhaengigkeit von Temperaturprofil und Fensterkontakt
Fon