2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-03 13:45:36 +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: add timestamp to inform
- 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",
"version" => "V",
"time" => "t",
"raw" => "",
"ccconf" => "=",
);
my %sets = (
"eeprom" => "W",
"rawFS20" => "F",
"rawFHT" => "T",
"raw" => "",
"verbose" => "X",
"freq" => "=",
"bandwidth" => "=",
@ -200,7 +200,8 @@ GOTBW:
} 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");
Log GetLogLevel($name,4), "set $name $type $arg";
CUL_Write($hash, $sets{$type}, $arg);
@ -383,7 +384,7 @@ CUL_Write($$$)
###################
# 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
$fn = "F";
$msg = substr($msg,6);
@ -558,7 +559,7 @@ CUL_Read($)
} elsif($fn eq "K") {
if($len == 15) { # Reformat for 13_KS300.pm
if($len == 99) { # Reformat for 13_KS300.pm
my @a = split("", $dmsg);
$dmsg = sprintf("81%02x04xx4027a001", $len/2+6);
for(my $i = 0; $i < 14; $i+=2) { # Swap nibbles.

View File

@ -23,7 +23,7 @@ CUL_WS_Initialize($)
# Message is like
# K41350270
$hash->{Match} = "^K.....\$";
$hash->{Match} = "^K.....";
$hash->{DefFn} = "CUL_WS_Define";
$hash->{UndefFn} = "CUL_WS_Undef";
$hash->{ParseFn} = "CUL_WS_Parse";
@ -58,7 +58,7 @@ sub
CUL_WS_Undef($$)
{
my ($hash, $name) = @_;
delete($defptr{$hash->{CODE}});
delete($defptr{$hash->{CODE}}) if($hash && $hash->{CODE});
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
FS20/HMS/etc event, then you'll see a line of the form
"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
"on-for-timer 60". In this case you'll see: FS20 piri on-for-timer 60
<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
against the DEVICENAME and against the DEVICENAME:EVENT strings. If they
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
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>

View File

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