diff --git a/fhem/CHANGED b/fhem/CHANGED
index dddbc623e..ebce34f26 100644
--- a/fhem/CHANGED
+++ b/fhem/CHANGED
@@ -570,3 +570,4 @@
- bugfix: dummy/structure was listed twice in list and xmllist
- feature: 11_FHT.pm added new readings for warnings on battery, lowtemp,
window and windowsensor (M.Fischer)
+ - feature: on-for-timer added for X10 modules (Boris)
\ No newline at end of file
diff --git a/fhem/FHEM/20_X10.pm b/fhem/FHEM/20_X10.pm
index c303fca0f..f333491e0 100755
--- a/fhem/FHEM/20_X10.pm
+++ b/fhem/FHEM/20_X10.pm
@@ -74,6 +74,7 @@ my %functions_set = ( "on" => 0,
"dimup" => 1,
"dimdown" => 1,
"on-till" => 1,
+ "on-for-timer" => 1,
);
@@ -102,7 +103,7 @@ X10_Initialize($)
$hash->{DefFn} = "X10_Define";
$hash->{UndefFn} = "X10_Undef";
$hash->{ParseFn} = "X10_Parse";
- $hash->{AttrList} = "IODev follow-on-for-timer:1,0 do_not_notify:1,0 " .
+ $hash->{AttrList} = "IODev do_not_notify:1,0 " .
"dummy:1,0 showtime:1,0 model:lm12,lm15,am12,tm13 " .
"loglevel:0,1,2,3,4,5,6";
@@ -134,9 +135,38 @@ X10_Do_On_Till($@)
return "";
}
+ if($modules{X10}{ldata}{$a[0]}) {
+ CommandDelete(undef, $a[0] . "_timer");
+ delete $modules{FS20}{ldata}{$a[0]};
+ }
+ $modules{X10}{ldata}{$a[0]} = "$hms_till";
+
my @b = ($a[0], "on");
X10_Set($hash, @b);
- CommandDefine(undef, $hash->{NAME} . "_till at $hms_till set $a[0] off");
+ CommandDefine(undef, $hash->{NAME} . "_timer at $hms_till set $a[0] off");
+
+}
+#############################
+sub
+X10_Do_On_For_Timer($@)
+{
+ my ($hash, @a) = @_;
+ return "Timespec (HH:MM[:SS]) needed for the on-for-timer command" if(@a != 3);
+
+ my ($err, $hr, $min, $sec, $fn) = GetTimeSpec($a[2]);
+ return $err if($err);
+
+ my $hms_for_timer = sprintf("+%02d:%02d:%02d", $hr, $min, $sec);
+
+ if($modules{X10}{ldata}{$a[0]}) {
+ CommandDelete(undef, $a[0] . "_timer");
+ delete $modules{FS20}{ldata}{$a[0]};
+ }
+ $modules{X10}{ldata}{$a[0]} = "$hms_for_timer";
+
+ my @b = ($a[0], "on");
+ X10_Set($hash, @b);
+ CommandDefine(undef, $hash->{NAME} . "_timer at $hms_for_timer set $a[0] off");
}
@@ -195,6 +225,11 @@ X10_Set($@)
# special for on-till
return X10_Do_On_Till($hash, @a) if($function eq "on-till");
+ # special for on-for-timer
+ return X10_Do_On_For_Timer($hash, @a) if($function eq "on-for-timer");
+
+
+
# argument evaluation
my $model= $hash->{MODEL};
diff --git a/fhem/HISTORY b/fhem/HISTORY
index 2727e62f6..3fce8eef0 100644
--- a/fhem/HISTORY
+++ b/fhem/HISTORY
@@ -446,9 +446,9 @@
KS300 CUL_WS CUL_EM X10.
- Mon Nov 16 2009 (MartinH)
- - pgm3: Google-Weather-Api added. Display of all Logs including the
- FS20-devices (grep on fhem.log) The status of the batteries of FHT and HMS
- are shown in the graphics. php4 disabled. Now only php5 is supported. A
+ - pgm3: Google-Weather-Api added. Display of all Logs including the
+ FS20-devices (grep on fhem.log) The status of the batteries of FHT and HMS
+ are shown in the graphics. php4 disabled. Now only php5 is supported. A
lot of examples of the UserDefs are added. The pgm3-section of fhem.html was
changed.
@@ -472,3 +472,6 @@
Webcam and Google-Weather. Output of html better formated and skinable --
change the colors.
+- Sat Feb 6 2010 (Boris)
+ - feature: on-for-timer added for X10 modules and bug fixed for overlapping
+ on-till and on-for-timer commands (Boris)
\ No newline at end of file
diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html
index d400e2f05..822713cf9 100644
--- a/fhem/docs/commandref.html
+++ b/fhem/docs/commandref.html
@@ -500,7 +500,7 @@ A line ending with \ will be concatenated with the next one, so long lines
<devspec>.
If value is specified, then output this property (like DEF, TYPE, etc) or
- reading (actuator, measured-temp) for all devices from the devspec.
+ reading (actuator, measured-temp) for all devices from the devspec.
Example:
fhem> list
@@ -788,7 +788,7 @@ A line ending with \ will be concatenated with the next one, so long lines
- autoload_undefined_devices
- If set, automatically load the corresponding module when a message
+ If set, automatically load the corresponding module when a message
of this type is received. This is used by the
autocreate device, to automatically create a fhem device upon
receiving a corresponding message.
@@ -1521,7 +1521,7 @@ A line ending with \ will be concatenated with the next one, so long lines
CUL_FHTTK
- This module handles messages from the FHT80 TF "Fenster-Tür-Kontakt" (Window-Door-Contact)
+ This module handles messages from the FHT80 TF "Fenster-T�r-Kontakt" (Window-Door-Contact)
which are normally only acted upon by the FHT80B. With this module,
FHT80 TFs are in a limited way (see Wiki
for detailed explanation of TF's mode of operation) usable similar to HMS100 TFK. The name
@@ -2322,6 +2322,7 @@ A line ending with \ will be concatenated with the next one, so long lines
off
on
on-till # Special, see the note
+ on-for-timer # Special, see the note
Examples:
set lamp1,lamp2 off
set pump off
set lamp2 on-till 19:59
set lamp2 on-for-timer 00:02:30
on-for-timer
requires a relative time in the "at" format
+ (HH:MM:SS, HH:MM) or { <perl code> }, where the perl code
+ returns a time specification).
+ owserver-ip:port
is called none
, then
- no device will be opened, so you can experiment without hardware attached.present
(read-only)DS18S20
.DS18S20
.templow
(read-write)temphigh
(read-write)temperature
(read-only)set <NAME> DEL <FHEM-DEVICENAME>