Added divide by 3 to apator08.

pull/84/head
weetmuts 2020-02-23 18:41:21 +01:00
rodzic b608ae3220
commit 33952d803f
5 zmienionych plików z 25 dodań i 17 usunięć

Wyświetl plik

@ -192,6 +192,7 @@ Kamstrup Multical 21 (multical21)
Kamstrup flowIQ 3100 (flowiq3100)
Sontex Supercom 587 (supercom587)
Sensus iPERL (iperl)
Apator at-wmbus-08 (apator08) (non-standard protocol)
Apator at-wmbus-16-2 (apator162) (non-standard protocol)
Techem MK Radio 3 (mkradio3) (non-standard protocol)
Diehl/Sappel IZAR RC 868 I R4 PL (izar) (non-standard protocol)

Wyświetl plik

@ -109,3 +109,9 @@ telegram=|7B4479169977997730378C20F0900F002C2549EE0A0077C19D3D1A08ABCD7299779977
telegram=|5344A8159955995502028C201D900F002C250C390000ED176BBBB1591ADB7A1D003007102F2F|0700583B74020000000007803CBCD70200000000000728B070200000000000042092A406002F2F2F2F2F2F2F2F2F|
{"media":"electricity","meter":"ehzp","name":"Elen3","id":"55995599","total_energy_consumption_kwh":41.1718,"current_power_consumption_kw":2.126,"total_energy_production_kwh":0.1863,"on_time_h":120.929444,"timestamp":"1111-11-11T11:11:11Z"}
|Elen3;55995599;41.171800;2.126000;0.186300;1111-11-11 11:11.11
# Test water meter apator08
telegram=|73441486DD4444000303A0|B9E527004C4034B31CED0106FF01D093270065F022009661230054D02300EC49240018B424005F012500936D2500FFD525000E3D26001EAC26000B2027000300000000371D0B2000000000000024000000000000280000000000002C0033150C010D2F000000000000|
{"media":"water","meter":"apator08","name":"Vatten","id":"004444dd","total_m3":871.571,"timestamp":"1111-11-11T11:11:11Z"}
|Vatten;004444dd;871.571000;1111-11-11 11:11.11

Wyświetl plik

@ -93,6 +93,9 @@ void MeterApator08::processContent(Telegram *t)
if(findKey(MeasurementType::Unknown, ValueInformation::Volume, 0, 0, &key, &vendor_values))
{
extractDVdouble(&vendor_values, key, &offset, &total_water_consumption_m3_);
// Now divide with 3! Is this the same for all apator08 meters? Time will tell.
total_water_consumption_m3_ /= 3.0;
//Adding explanation have to wait since it assumes that the dvparser could do something, but it could not here.
//t->addMoreExplanation(offset, " total consumption (%f m3)", total_water_consumption_m3_);
}

Wyświetl plik

@ -81,10 +81,11 @@ Received telegram from: 77997799
Received telegram from: 55995599
manufacturer: (EMH) EMH metering formerly EMH Elektrizitatszahler
device type: Electricity meter
Received telegram from: 004444dd
manufacturer: (APT) Unknown
device type: Gas meter
EOF
EXPECTED=$(cat $LOGFILE_EXPECTED)
RES=$($PROG --logfile=$LOGFILE --t1 simulations/simulation_t1.txt 2>&1)
if [ ! "$RES" = "" ]
@ -97,35 +98,31 @@ then
exit 1
fi
GOT=$(cat $LOGFILE)
RES=$(diff $LOGFILE $LOGFILE_EXPECTED)
if [ ! "$GOT" = "$EXPECTED" ]
if [ ! -z "$RES" ]
then
echo ERROR: $TESTNAME
echo GOT--------------
echo $GOT
echo EXPECTED---------
echo $EXPECTED
echo -----------------
diff $LOGFILE $LOGFILE_EXPECTED
echo -----------------
exit 1
else
echo OK: $TESTNAME
fi
TESTNAME="Test listen and print any meter heard on stdout"
TESTRESULT="ERROR"
GOT=$($PROG --t1 simulations/simulation_t1.txt 2>&1)
$PROG --t1 simulations/simulation_t1.txt 2>&1 > $LOGFILE
if [ ! "$GOT" = "$EXPECTED" ]
RES=$(diff $LOGFILE $LOGFILE_EXPECTED)
if [ ! -z "$RES" ]
then
echo ERROR: $TESTNAME
echo GOT--------------
echo $GOT
echo EXPECTED---------
echo $EXPECTED
echo -----------------
diff $LOGFILE $LOGFILE_EXPECTED
echo -----------------
exit 1
else

Wyświetl plik

@ -26,7 +26,8 @@ METERS="MyWarmWater supercom587 12345678 NOKEY
Q400Water q400 72727272 AAA896100FED12DD614DD5D46369ACDD
Elen1 ebzwmbe 22992299 NOKEY
Elen2 esyswm 77997799 NOKEY
Elen3 ehzp 55995599 NOKEY"
Elen3 ehzp 55995599 NOKEY
Vatten apator08 004444dd NOKEY"
cat simulations/simulation_t1.txt | grep '^{' > $TEST/test_expected.txt
$PROG --format=json simulations/simulation_t1.txt $METERS > $TEST/test_output.txt