mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-28 11:01:59 +00:00
70_PylonLowVoltage: contrib 1.2.0
git-svn-id: https://svn.fhem.de/fhem/trunk@29200 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2bd71f301b
commit
c9bd3c0487
@ -121,6 +121,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern (Versions history by Heiko Maaz)
|
# Versions History intern (Versions history by Heiko Maaz)
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
|
"1.2.0" => "05.10.2024 _composeAddr: bugfix of effective battaery addressing ",
|
||||||
"1.1.0" => "25.08.2024 manage time shift for active gateway connections of all defined devices ",
|
"1.1.0" => "25.08.2024 manage time shift for active gateway connections of all defined devices ",
|
||||||
"1.0.0" => "24.08.2024 implement pylon groups ",
|
"1.0.0" => "24.08.2024 implement pylon groups ",
|
||||||
"0.4.0" => "23.08.2024 Log output for timeout changed, automatic calculation of checksum, preparation for pylon groups ",
|
"0.4.0" => "23.08.2024 Log output for timeout changed, automatic calculation of checksum, preparation for pylon groups ",
|
||||||
@ -392,9 +393,9 @@ sub Define {
|
|||||||
return "The group number must be an integer from 0 to 7";
|
return "The group number must be an integer from 0 to 7";
|
||||||
}
|
}
|
||||||
|
|
||||||
$hash->{BATADDRESS} = $$a[3] // 1;
|
$hash->{HELPER}{BATADDRESS} = $$a[3] // 1;
|
||||||
$hash->{GROUP} = $h->{group} // 0;
|
$hash->{HELPER}{GROUP} = $h->{group} // 0;
|
||||||
$hash->{HELPER}{AGE1} = 0;
|
$hash->{HELPER}{AGE1} = 0;
|
||||||
|
|
||||||
my $params = {
|
my $params = {
|
||||||
hash => $hash,
|
hash => $hash,
|
||||||
@ -554,7 +555,7 @@ sub manageUpdate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log3 ($name, 4, "$name - START request cycle to battery number >$hash->{BATADDRESS}<, group >$hash->{GROUP}< at host:port $hash->{HOST}:$hash->{PORT}");
|
Log3 ($name, 4, "$name - START request cycle to battery number >$hash->{HELPER}{BATADDRESS}<, group >$hash->{HELPER}{GROUP}< at host:port $hash->{HOST}:$hash->{PORT}");
|
||||||
|
|
||||||
if ($timeout < 1.0) {
|
if ($timeout < 1.0) {
|
||||||
$hash->{HELPER}{GWSESSION} = 1;
|
$hash->{HELPER}{GWSESSION} = 1;
|
||||||
@ -687,7 +688,7 @@ sub finishUpdate {
|
|||||||
delete $hash->{HELPER}{GWSESSION};
|
delete $hash->{HELPER}{GWSESSION};
|
||||||
|
|
||||||
if ($success) {
|
if ($success) {
|
||||||
Log3 ($name, 4, "$name - got data from battery number >$hash->{BATADDRESS}<, group >$hash->{GROUP}< successfully");
|
Log3 ($name, 4, "$name - got data from battery number >$hash->{HELPER}{BATADDRESS}<, group >$hash->{HELPER}{GROUP}< successfully");
|
||||||
|
|
||||||
additionalReadings ($readings); # zusätzliche eigene Readings erstellen
|
additionalReadings ($readings); # zusätzliche eigene Readings erstellen
|
||||||
$readings->{state} = 'connected';
|
$readings->{state} = 'connected';
|
||||||
@ -1471,15 +1472,14 @@ return $cmd;
|
|||||||
sub _composeAddr {
|
sub _composeAddr {
|
||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
|
|
||||||
my $baddr = $hash->{BATADDRESS} + 1; # Master startet mit "02"
|
my $ba = sprintf "%02x", ($hash->{HELPER}{BATADDRESS} + 1); # Master startet mit "02"
|
||||||
my $gaddr = $hash->{GROUP};
|
my $ga = sprintf "%02x", $hash->{HELPER}{GROUP};
|
||||||
|
my $ad = sprintf "%02x", (hex ($ga) * hex (10) + hex ($ba));
|
||||||
|
|
||||||
my $addr = sprintf "%02x", (hex $baddr + hex $gaddr * hex '0x10');
|
my $name = $hash->{NAME};
|
||||||
|
Log3 ($name, 5, "$name - Addressing (HEX) - Bat: $ba, Group: $ga, effective Bat address: $ad");
|
||||||
|
|
||||||
#my $name = $hash->{NAME};
|
return $ad;
|
||||||
#Log3 ($name, 1, "$name - ADDRR: $addr");
|
|
||||||
|
|
||||||
return $addr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################
|
###############################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user