2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-04 14:13:18 +00:00

CUL_WS / CUL changes

git-svn-id: https://svn.fhem.de/fhem/trunk@255 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2008-10-12 15:07:46 +00:00
parent 193cd5af42
commit a1222b948d
5 changed files with 17 additions and 12 deletions

View File

@ -433,4 +433,4 @@
- feature: FHT internal modifications (better protocol understanding) - feature: FHT internal modifications (better protocol understanding)
- feature: add timestamp to inform - feature: add timestamp to inform
- feature: The strange stty settings in 00_FHEM.pm are optional - feature: The strange stty settings in 00_FHEM.pm are optional
- bugfix: webpgm2 iPhone fix

View File

@ -39,13 +39,13 @@ my %gets = (
"eeprom" => "R", "eeprom" => "R",
"version" => "V", "version" => "V",
"time" => "t", "time" => "t",
"raw" => "",
"ccconf" => "=", "ccconf" => "=",
); );
my %sets = ( my %sets = (
"eeprom" => "W", "eeprom" => "W",
"rawFS20" => "F", "raw" => "",
"rawFHT" => "T",
"verbose" => "X", "verbose" => "X",
"freq" => "=", "freq" => "=",
"bandwidth" => "=", "bandwidth" => "=",
@ -200,7 +200,8 @@ GOTBW:
} else { } else {
return "Expecting a 0-padded hex number" if((length($arg)&1) == 1); return "Expecting a 0-padded hex number"
if((length($arg)&1) == 1 && $type ne "raw");
$initstr = "X$arg" if($type eq "verbose"); $initstr = "X$arg" if($type eq "verbose");
Log GetLogLevel($name,4), "set $name $type $arg"; Log GetLogLevel($name,4), "set $name $type $arg";
CUL_Write($hash, $sets{$type}, $arg); CUL_Write($hash, $sets{$type}, $arg);
@ -383,7 +384,7 @@ CUL_Write($$$)
################### ###################
# Rewrite message from FHZ -> CUL # Rewrite message from FHZ -> CUL
if(length($fn) == 1) { # CUL Native if(length($fn) <= 1) { # CUL Native
} elsif($fn eq "04" && substr($msg,0,6) eq "010101") { # FS20 } elsif($fn eq "04" && substr($msg,0,6) eq "010101") { # FS20
$fn = "F"; $fn = "F";
$msg = substr($msg,6); $msg = substr($msg,6);
@ -558,7 +559,7 @@ CUL_Read($)
} elsif($fn eq "K") { } elsif($fn eq "K") {
if($len == 15) { # Reformat for 13_KS300.pm if($len == 99) { # Reformat for 13_KS300.pm
my @a = split("", $dmsg); my @a = split("", $dmsg);
$dmsg = sprintf("81%02x04xx4027a001", $len/2+6); $dmsg = sprintf("81%02x04xx4027a001", $len/2+6);
for(my $i = 0; $i < 14; $i+=2) { # Swap nibbles. for(my $i = 0; $i < 14; $i+=2) { # Swap nibbles.

View File

@ -23,7 +23,7 @@ CUL_WS_Initialize($)
# Message is like # Message is like
# K41350270 # K41350270
$hash->{Match} = "^K.....\$"; $hash->{Match} = "^K.....";
$hash->{DefFn} = "CUL_WS_Define"; $hash->{DefFn} = "CUL_WS_Define";
$hash->{UndefFn} = "CUL_WS_Undef"; $hash->{UndefFn} = "CUL_WS_Undef";
$hash->{ParseFn} = "CUL_WS_Parse"; $hash->{ParseFn} = "CUL_WS_Parse";
@ -58,7 +58,7 @@ sub
CUL_WS_Undef($$) CUL_WS_Undef($$)
{ {
my ($hash, $name) = @_; my ($hash, $name) = @_;
delete($defptr{$hash->{CODE}}); delete($defptr{$hash->{CODE}}) if($hash && $hash->{CODE});
return undef; return undef;
} }

View File

@ -330,7 +330,7 @@ messages from my FHT80b. How to switch back to the actuator:0% messages?
localhost 7072) and issue the command "inform on". If there is an localhost 7072) and issue the command "inform on". If there is an
FS20/HMS/etc event, then you'll see a line of the form FS20/HMS/etc event, then you'll see a line of the form
"TYPE DEVICENAME EVENT". Some devicetypes generate more than one trigger "TYPE DEVICENAME EVENT". Some devicetypes generate more than one trigger
message for one event, (E.g. HMS or KS300.<br> message for one event, e.g. HMS or KS300.<br>
Example: you have an FS20 device named piri, which sends a command Example: you have an FS20 device named piri, which sends a command
"on-for-timer 60". In this case you'll see: FS20 piri on-for-timer 60 "on-for-timer 60". In this case you'll see: FS20 piri on-for-timer 60
<br><br> <br><br>
@ -338,11 +338,15 @@ messages from my FHT80b. How to switch back to the actuator:0% messages?
Now define your notify/filelog. The regexp specified will be tested Now define your notify/filelog. The regexp specified will be tested
against the DEVICENAME and against the DEVICENAME:EVENT strings. If they against the DEVICENAME and against the DEVICENAME:EVENT strings. If they
match, then the action will be executed. For our example this would be: match, then the action will be executed. For our example this would be:
define piri_ntfy piri:on.* some_command<br><br> define piri_ntfy notify piri:on.* some_command<br><br>
You can test the notify/filelog with the trigger command: issue "trigger You can test the notify/filelog with the trigger command: issue "trigger
DEVICENAME EVENT" in the telnet prompt, and check if your notify/filelog DEVICENAME EVENT" in the telnet prompt, and check if your notify/filelog
works as designed. Example: trigger piri on-for-timer 60<br><br> works as designed. Example: trigger piri on-for-timer 60<br>
Tip: you can test a new setup without a connected FHZ1x00. Create a new
config file, set the FHZ1x00 device to none, and generate events via
trigger.
<br><br>
</ul> </ul>

View File

@ -48,4 +48,4 @@ table.FHEMWEB tr.odd { background: #F0F0F0; }
#hdr { position:absolute; top:10px; left:10px; } #hdr { position:absolute; top:10px; left:10px; }
#left { position:absolute; top:50px; left:10px; width:130px; } #left { position:absolute; top:50px; left:10px; width:130px; }
#right { position:absolute; top:50px; left:160px; #right { position:absolute; top:50px; left:160px;
right:10px; bottom:10px; overflow:auto; } right:10px; overflow:auto; }