Skip to content

Commit

Permalink
Merge pull request #20 from homatec/master
Browse files Browse the repository at this point in the history
Parse Packet for the Belgian Gas meters
  • Loading branch information
ruudverheijden authored Feb 10, 2021
2 parents 627c113 + e16e703 commit 010d59b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/parsePacket.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ function parsePacket(packet) {

switch (line.obisCode) {
case "1-3:0.2.8":
case "0-0:96.1.4":
parsedPacket.version = line.value;
break;

Expand Down Expand Up @@ -320,6 +321,7 @@ function parsePacket(packet) {
case "0-2:96.1.0":
case "0-3:96.1.0":
case "0-4:96.1.0":
case "0-1:96.1.1":
parsedPacket.gas.equipmentId = line.value;
break;

Expand All @@ -334,6 +336,14 @@ function parsePacket(packet) {
parsedPacket.gas.unit = hourlyReading.unit;
break;

case "0-1:24.2.3":

const instantValue = line.value.substr(15,9);
const instantUnit = line.value.substr(25,2);
parsedPacket.gas.reading = parseFloat(instantValue);
parsedPacket.gas.unit = instantUnit;
break;

case "0-1:24.4.0":
case "0-2:24.4.0":
case "0-3:24.4.0":
Expand Down

0 comments on commit 010d59b

Please sign in to comment.