diff --git a/fhem/FHEM/10_FS20.pm b/fhem/FHEM/10_FS20.pm index 43d477795..dd248a89f 100755 --- a/fhem/FHEM/10_FS20.pm +++ b/fhem/FHEM/10_FS20.pm @@ -109,7 +109,7 @@ FS20_Initialize($) $hash->{DefFn} = "FS20_Define"; $hash->{UndefFn} = "FS20_Undef"; $hash->{ParseFn} = "FS20_Parse"; - $hash->{AttrList} = "IODev follow-on-for-timer:1,0 do_not_notify:1,0 ignore:0,1 dummy:1,0 showtime:1,0 model;fs20hgs,fs20hgs,fs20pira,fs20piri,fs20s20,fs20s8,fs20s4,fs20s4a,fs20s4m,fs20s4u,fs20s4ub,fs20sd,fs20sn,fs20sr,fs20ss,fs20str,fs20tfk,fs20tfk,fs20tk,fs20uts,fs20ze,fs20as1,fs20as4,fs20di,fs20du,fs20ls,fs20ms2,fs20rst,fs20sa,fs20sig,fs20st,fs20sv,fs20usr loglevel:0,1,2,3,4,5,6"; + $hash->{AttrList} = "IODev follow-on-for-timer:1,0 do_not_notify:1,0 ignore:0,1 dummy:1,0 showtime:1,0 model;fs20hgs,fs20hgs,fs20pira,fs20piri,fs20s20,fs20s8,fs20s4,fs20s4a,fs20s4m,fs20s4u,fs20s4ub,fs20sd,fs20sn,fs20sr,fs20ss,fs20str,fs20tfk,fs20tfk,fs20tk,fs20uts,fs20ze,fs20as1,fs20as4,fs20di,fs20du,fs20ls,fs20ms2,fs20rst,fs20sa,fs20sig,fs20st,fs20sv,fs20usr exchange_on_off loglevel:0,1,2,3,4,5,6"; } @@ -162,6 +162,14 @@ FS20_Set($@) return "no set value specified" if($na < 2 || $na > 3); return "Readonly value $a[1]" if(defined($readonly{$a[1]})); + if($attr{$a[0]} && $attr{$a[0]}{exchange_on_off}) { + if($a[1] =~ m/off/) { + $a[1] =~ s/off/on/; + } else { + $a[1] =~ s/on/off/; + } + } + my $c = $fs20_c2b{$a[1]}; if(!defined($c)) { @@ -339,7 +347,7 @@ FS20_Parse($$) my $dur = 0; my $cx = hex($cde); - if($cx & 0x20) { + if($cx & 0x20) { # Timed command $dur = hex(substr($msg, 26, 2)); my $i = ($dur & 0xf0) / 16; my $j = ($dur & 0xf); @@ -351,6 +359,7 @@ FS20_Parse($$) $v = "unknown_$cde" if(!defined($v)); $v .= " $dur" if($dur); + my $def = $modules{FS20}{defptr}{"$dev $btn"}; if($def) { my @list; @@ -358,6 +367,14 @@ FS20_Parse($$) my $lh = $def->{$n}; $n = $lh->{NAME}; # It may be renamed + if($attr{$n} && $attr{$n}{exchange_on_off}) { + if($v =~ m/off/) { + $v =~ s/off/on/; + } else { + $v =~ s/on/off/; + } + } + return "" if(IsIgnored($n)); # Little strange. $lh->{CHANGED}[0] = $v; diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index de2217d5b..dace4f1b9 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -1300,7 +1300,13 @@ A line ending with \ will be concatenated with the next one, so long lines list command (only if it is explicitely asked for it), nor will it appear in commands which use some wildcard/attribute as name specifiers (see devspec). You still get them with the - "ignored=1" special devspec. + "ignored=1" special devspec. +
+ + +
  • exchange_on_off
    + Exchange on and off (and on-for-timer, etc). Both reception and sending + is exchanged.
  • diff --git a/fhem/docs/fhem.html b/fhem/docs/fhem.html index 457790f43..4025124ab 100644 --- a/fhem/docs/fhem.html +++ b/fhem/docs/fhem.html @@ -241,6 +241,12 @@
  • Linux driver installation: http://www.koeniglich.de/fhem/linux.html
  • +
  • Misc USB problems: + + http://www.koeniglich.de/fhem/USB.html
  • +
  • Russels Blog for Windows user: + + http://www.eclipcecreate.co.uk/category/FHEM.aspx
  • Windows driver installation: http://fhz4linux.info/tiki-index.php?page=Driver%20installation