Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KFM5KAIFA support #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iec62056/grammar.lark
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ DATETIME : DIGIT~12
DST : "S"
| "W"

CHARACTER : "A".."Z" | "a".."z" | "0".."9" | "." | "-" | "_"
CHARACTER : "A".."Z" | "a".."z" | "0".."9" | "." | "-" | "_" | " "
STRING : CHARACTER+

// we don't need CRLF. Besides, Kamstrup multical lacks trailing CRLF on last object
Expand Down
2 changes: 1 addition & 1 deletion iec62056/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def factory(cls, reference, timestamp, raw, unit):
value = vcls(raw)
name = n
return cls(reference, name, timestamp, value, unit)
raise NotImplementedError('OBIS reference {} is not implemented'.format(repr(eeference)))
raise NotImplementedError('OBIS reference {} is not implemented'.format(repr(reference)))

def __repr__(self):
if self.timestamp is not None:
Expand Down
2 changes: 1 addition & 1 deletion iec62056/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def profilegeneric(self, tree):
n = int(tree.pop(0))
reference = tree.pop(0)
entries = tree
assert len(entries) == n
#assert len(entries) == n
return [iec62056.objects.Register.factory(reference, timestamp, value, unit) for timestamp, value, unit in entries]

def log(self, tree):
Expand Down
58 changes: 58 additions & 0 deletions iec62056/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,61 @@
b'!83A5\r\n'
)
ALL.append(('ZIV_5CTA3', ZIV_5CTA3))

KFM5KAIFA = (
'/KFM5KAIFA-METER\r\n'
'\r\n'
'1-3:0.2.8(40)\r\n'
'0-0:1.0.0(150117185916W)\r\n'
'0-0:96.1.1(0001)\r\n'
'1-0:1.8.1(000671.578*kWh)\r\n'
'1-0:1.8.2(000842.472*kWh)\r\n'
'1-0:2.8.1(000111.000*kWh)\r\n'
'1-0:2.8.2(000000.111*kWh)\r\n'
'0-0:96.14.0(0001)\r\n'
'1-0:1.7.0(00.333*kW)\r\n'
'1-0:2.7.0(00.000*kW)\r\n'
'0-0:17.0.0(999.9*kW)\r\n'
'0-0:96.3.10(1)\r\n'
'0-0:96.7.21(00008)\r\n'
'0-0:96.7.9(00007)\r\n'
'1-0:99.97.0(1)(0-0:96.7.19)\r\n'
'1-0:32.32.0(00001)\r\n'
'1-0:52.32.0(00002)\r\n'
'1-0:72.32.0(00003)\r\n'
'1-0:32.36.0(00004)\r\n'
'1-0:52.36.0(00005)\r\n'
'1-0:72.36.0(00006)\r\n'
'0-0:96.13.1(short message)\r\n'
'0-0:96.13.0(long message 0000000000000000000000000000000000000000000000000000000000000000000000000000)\r\n'
'1-0:32.7.0(380.000*V)\r\n'
'1-0:52.7.0(381.000*V)\r\n'
'1-0:72.7.0(382.000*V)\r\n'
'1-0:31.7.0(003*A)\r\n'
'1-0:51.7.0(002*A)\r\n'
'1-0:71.7.0(001*A)\r\n'
'1-0:21.7.0(00.332*kW)\r\n'
'1-0:41.7.0(00.333*kW)\r\n'
'1-0:61.7.0(00.334*kW)\r\n'
'1-0:22.7.0(00.010*kW)\r\n'
'1-0:42.7.0(00.020*kW)\r\n'
'1-0:62.7.0(00.030*kW)\r\n'
'0-1:24.1.0(003)\r\n'
'0-1:96.1.0(GAS0000000000000000000000000000000)\r\n'
'0-1:24.2.1(150117160000W)(00473.789*m3)\r\n'
'0-1:24.4.0(1)\r\n'
'0-3:24.1.0(003)\r\n'
'0-3:96.1.0(HEAT000000000000000000000000000000)\r\n'
'0-3:24.2.1(150117170000W)(00473.789*GJ)\r\n'
'0-3:24.4.0(1)\r\n'
'0-2:24.1.0(003)\r\n'
'0-2:96.1.0(WATER000000000000000000000000000000)\r\n'
'0-2:24.2.1(150117180000W)(00473.789*m3)\r\n'
'0-2:24.4.0(1)\r\n'
'0-4:24.1.0(003)\r\n'
'0-4:96.1.0(SLAVE00000000000000000000000000000)\r\n'
'0-4:24.2.1(150117190000W)(00473.789*m3)\r\n'
'0-4:24.4.0(1)\r\n'
'!E6FF\r\n'
)
ALL.append(('KFM5KAIFA', KFM5KAIFA))