ReadingsVal added

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2705 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-02-12 12:22:21 +00:00
parent c35b2180b2
commit e54e564b87

View File

@ -251,9 +251,7 @@ Help me!</h4>
we just can change it with<br> we just can change it with<br>
<code>set FHZ FHTcode &lt;hex-code&gt;</code> (1 byte, range 1 to 99)</li> <code>set FHZ FHTcode &lt;hex-code&gt;</code> (1 byte, range 1 to 99)</li>
<li>Resync the FHT80b: Press PROG until "Sond" appears, then select "CEnt" <li>Resync the FHT80b: Press PROG until "Sond" appears, then select "CEnt"
with the wheel, press PROG again, Select "nA" with the wheel, press PROG with the wheel, press PROG again, Select "nA" with the wheel, press PROG</li>
again. For more details, see <a href="http://www.ip-symcon.de/wiki/index.php/FHT">IP-Symcon Wiki</a> (especially Fredje's comment)
and <a href="http://www.contronics.de/BedAnl_Studio/homeputerStudio_web/html/hard6vl3.htm">Contronics &quot;Anmelden von Raumreglern FHT80b&quot;</a>.</li>
</ul> </ul>
</ul> </ul>
@ -383,8 +381,8 @@ messages from my FHT80b. How to switch back to the actuator:0% messages?
You can automate it with the following notify: You can automate it with the following notify:
<pre> <pre>
define lime_reset notify .*lime-protection {\ define lime_reset notify .*lime-protection {\
$d = $defs{@}{READINGS}{"desired-temp"}{VAL};;\ $d = ReadingsVal("@", "desired-temp", 0);;\
$m = $defs{@}{READINGS}{"measured-temp"}{VAL};;\ $m = ReadingsVal("@", "measured-temp", 0);;\
if($m gt $d) {\ if($m gt $d) {\
fhem("set @ desired-temp 29");;\ fhem("set @ desired-temp 29");;\
fhem("set @ desired-temp $d");;\ fhem("set @ desired-temp $d");;\
@ -427,22 +425,20 @@ messages from my FHT80b. How to switch back to the actuator:0% messages?
<ul> <ul>
Thanks to Waldemar Porsche the following notify will take care of that:<br> Thanks to Waldemar Porsche the following notify will take care of that:<br>
<pre>define ExtendedAutoMode notify .*mode.*auto {\ <pre>define ExtendedAutoMode notify .*mode.*auto {\
$r = $defs{@}{READINGS};;\ my $olddesired = ReadingsValue("@", "desired-temp", 0);;\
return if (!defined($r));;\
my $olddesired = $r->{"desired-temp"}{VAL};;\
return if (!defined($olddesired));;\ return if (!defined($olddesired));;\
my @@day = ("sun", "mon", "tue", "wed", "thu", "fri", "sat");;\ my @@day = ("sun", "mon", "tue", "wed", "thu", "fri", "sat");;\
my $now = sprintf("%%02d:%%02d", $hour, $min);;\ my $now = sprintf("%%02d:%%02d", $hour, $min);;\
my $wd = $day[$wday];;\ my $wd = $day[$wday];;\
my $desired;;\ my $desired;;\
if (defined($r->{"warnings"}{VAL}) && $r->{"warnings"}{VAL} eq "Window open") {\ if (ReadingsVal("@", "warnings", "none") eq "Window open") {\
$desired = $r->{"windowopen-temp"}{VAL};;\ $desired = ReadingsVal("@", "windowopen-temp", 0);;\
} elsif (defined($r->{"$wd-from1"}{VAL}) && $r->{"$wd-from1"}{VAL} le $now && defined($r->{"$wd-to1"}{VAL}) && $r->{"$wd-to1"}{VAL} ge $now) {\ } elsif (ReadingsVal("@", "$wd-from1", "") le $now && ReadingsVal("@", "$wd-to1", "") ge $now) {\
$desired = $r->{"day-temp"}{VAL};;\ $desired = ReadingsVal("@", "day-temp", 0);;\
} elsif (defined($r->{"$wd-from2"}{VAL}) && $r->{"$wd-from2"}{VAL} le $now && defined($r->{"$wd-to2"}{VAL}) && $r->{"$wd-to2"}{VAL} ge $now) {\ } elsif (ReadingsVal("@", "$wd-from2", "") le $now && ReadingsVal("@", "$wd-to2", "") ge $now) {\
$desired = $r->{"day-temp"}{VAL};;\ $desired = ReadingsVal("@", "day-temp", 0);;\
} else {\ } else {\
$desired = $r->{"night-temp"}{VAL};;\ $desired = ReadingsVal("@", "night-temp", 0);;\
}\ }\
fhem ("set @ desired-temp $desired") if (defined($desired) && $desired ne $olddesired);;\ fhem ("set @ desired-temp $desired") if (defined($desired) && $desired ne $olddesired);;\
} }