mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
HMS parsing from Peter
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@417 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
96a1536bc2
commit
bcde81c197
@ -747,13 +747,17 @@ CUL_Read($)
|
|||||||
} elsif($fn eq "H" && $len >= 13) { # Reformat for 12_HMS.pm
|
} elsif($fn eq "H" && $len >= 13) { # Reformat for 12_HMS.pm
|
||||||
|
|
||||||
my $type = hex(substr($dmsg,6,1));
|
my $type = hex(substr($dmsg,6,1));
|
||||||
|
my $stat = $type > 1 ? hex(substr($dmsg,7,2)) : hex(substr($dmsg,5,2));
|
||||||
my $prf = $type > 1 ? "02" : "05";
|
my $prf = $type > 1 ? "02" : "05";
|
||||||
my $bat = $type > 1 ? hex(substr($dmsg,5,1))+1 : 1;
|
my $bat = $type > 1 ? hex(substr($dmsg,5,1))+1 : 1;
|
||||||
$dmsg = sprintf("81%02x04xx%s%x%xa001%s0000%s",
|
my $HA = substr($dmsg,1,4);
|
||||||
$len/2+8, # Packet-Length
|
my $values = $type > 1 ? "000000" : substr($dmsg,7);
|
||||||
|
$dmsg = sprintf("81%02x04xx%s%x%xa001%s0000%02x%s",
|
||||||
|
$len/2+8, # Packet-Length
|
||||||
$prf, $bat, $type,
|
$prf, $bat, $type,
|
||||||
substr($dmsg,1,4), # House-Code
|
$HA, # House-Code
|
||||||
substr($dmsg,5)); # Values
|
$stat,
|
||||||
|
$values); # Values
|
||||||
$dmsg = lc($dmsg);
|
$dmsg = lc($dmsg);
|
||||||
|
|
||||||
} elsif($fn eq "K" && $len >= 5) {
|
} elsif($fn eq "K" && $len >= 5) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user