Ich habe mal ein diff erzeugt und noch ein PAAR KOMMENTARE
reingeschrieben:
diff -u 64_ESA2000.pm ../../fhem/FHEM/64_ESA2000.pm
--- 64_ESA2000.pm 2011-02-09 08:14:58.000000000 +0100
+++ ../../fhem/FHEM/64_ESA2000.pm 2011-09-04 23:44:15.352993173
+0200
@@ -13,6 +13,7 @@
my %codes = (
"19fa" => "ESA2000_LED",
+ "0178" => "ESA2000_LED", # HIER MUSS DANN DEIN NEUER CODE REIN ODER
EINE NEUE ZEILE EINFÜGEN
);
@@ -69,6 +70,17 @@
# 0123456789012345678901234567890123456789
# S0119FA011E00007D6E003100000007C9F9 ESA2000_LED
+
+# ESA2000 msg s290178011e000002ac000c00026c03e9 NUR EIN PASTE MEINES
LOGS
+# ESA2000 seq 29
+# ESA2000 device 011e
+# ESA2000 code 0178
+# sce0178011e000008f40004000c3503e9
+# ESA2000 seq ce
+# ESA2000 device 011e
+# ESA2000 code 0178
+
+
$msg = lc($msg);
my $seq = substr($msg, 1, 2);
my $cde = substr($msg, 3, 4);
@@ -87,6 +99,7 @@
$type = $codes{$c};
last;
}
+# $type = "ESA2000_LED"; # QUICK AND DIRTY, DAMIT WIRD JEDES DEVICE
UNABH. V. CODE ERKANNT
}
if(!defined($modules{ESA2000}{defptr}{$dev})) {
@@ -107,7 +120,7 @@
if($type eq "ESA2000_LED") {
- @txt = ( "repeat", "sequence", "total_ticks", "actual_ticks",
"ticks_kwh", "raw", "total_kwh", "actual_kwh", "diff_kwh", "diff_sec",
"diff_ticks", "last_sec", "raw_total_kwh", "max_kwh", "day_kwh",
"month_kwh", "year_kwh", "rate", "hr_kwh", "lr_kwh", "day_hr_kwh",
"day_lr_kwh", "month_hr_kwh", "month_lr_kwh", "year_hr_kwh",
"year_lr_kwh" );
+ @txt = ( "repeat", "sequence", "total_ticks", "actual_ticks",
"ticks_kwh", "raw", "total_kWh", "actual_kw", "diff_kwh", "diff_sec",
"diff_ticks", "last_sec", "raw_total_kwh", "max_kwh", "day_kwh",
"month_kwh", "year_kwh", "rate", "hr_kwh", "lr_kwh", "day_hr_kwh",
"day_lr_kwh", "month_hr_kwh", "month_lr_kwh", "year_hr_kwh",
"year_lr_kwh" ); # ICH DENKE ES WIRD NICHT ALLES RICHTIG DEKODIERT UND
HABE ANGEFANGEN ZU ÄNDERN, DA FEHLT ABER NOCH WAS
# Codierung Hex
@@ -115,7 +128,7 @@
$v[1] = hex($seq) % 128;
$v[2] = hex(substr($val,0,8));
$v[3] = hex(substr($val,8,4));
- $v[4] = hex(substr($val,18,4)) ^ 25; # XOR 25, whyever bit 1,4,5
are swapped?!?! Probably a (receive-) error in CUL-FW?
+ $v[4] = hex(substr($val,18,4)); #PAN ^ 25; # XOR 25, whyever
bit 1,4,5 are swapped?!?! Probably a (receive-) error in CUL-FW? DER
FIX IST BEI MIR NICHT NOTWENDIG UND VERFÄLSCHT DIE DATEN
$v[11] = time();
# check if low-rate or high-rate. note that this is different per
electricity company! (Here weekday from 6-20 is high rate)
Zum Erkennen hat bei mir der Code an der richtigen Stelle oder der
Quick and dirty Ansatz geholfen. Der Rest der Änderungen verbessert
dann nur die Ausgabewerte.
Hier noch mal alles zum ESA aus meiner fhem.cfg:
define EM_Total ESA2000 011e
attr EM_Total model ESA2000_LED
define EM_Total.log FileLog /var/tmp/EM_Total.log EM_Total:*.*
define EM_Total_act.log FileLog /var/tmp/EM_Total_act.log
EM_Total:.*actual_kw:.*
define EM_total_cum.log FileLog /var/tmp/EM_Total_cum.log
EM_Total:.*total_kWh:.*
Hope that helps ...:-)