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 support for Kamstrup 303 #808

Closed
sveneb opened this issue Jan 16, 2023 · 14 comments
Closed

Add support for Kamstrup 303 #808

sveneb opened this issue Jan 16, 2023 · 14 comments

Comments

@sveneb
Copy link

sveneb commented Jan 16, 2023

I get the following output from a new meter that I have just added:

[2023-01-16_23:50:24] (meter) 82835301: meter detection did not match the selected driver unknown! correct driver is: unknown!
(meter) Not printing this warning again for id: 82835301 mfct: (KAM) Kamstrup Energi (0x2c2d) type: Heat volume at inlet meter (0x0c) ver: 0x40
Can you help me to get this meter working?
Do you need more info, just let me know how to get it

Thanks in advance
Sveneb

@sveneb sveneb changed the title Add support for camstrup Add support for Kamstrup 303 Jan 16, 2023
@BIBOLV
Copy link
Collaborator

BIBOLV commented Jan 17, 2023

Please record a few telegrams and post them here.

@sveneb
Copy link
Author

sveneb commented Jan 17, 2023

Here are a few records:
Received telegram from: 82835301
manufacturer: (KAM) Kamstrup Energi (0x2c2d)
type: Heat volume at inlet meter (0x0c) encrypted
ver: 0x40
device: amb8465[00000000]
rssi: -85 dBm
driver: unknown!
telegram=|_3C442D2C01538382400C8D202D60ED2120651E8C98F01CD4CEF4D8660E6BF200C04C487D62C82F0928FDB528EC652818D61191AD3345063102B03F0AE9|+23

(...)
telegram=|_3C442D2C01538382400C8D202E80ED212032A75A0184D5BB8692B9B2CDCCC937CAD39D27E25942A52D819E5FAD3995F7DB58C5C61E91E012E36A406AF0|+120

(...)
telegram=|_53442D2C01538382400C8D202FA0ED2120823CCEF93020A9668B38774786A744FF8CEDB33F13586D4A36321EC96E98B5C1F29CD6882BA58182EC40FFCD32FC4E7F6F4187ABD0165DABEE258629A6C64B891083EE|+217

(...)
telegram=|_3C442D2C01538382400C8D2030B0ED2120205F0AC35D07240DAF7CF350DF4E2A6C57217489DF1D2615F33D6368071F70AE310414F8153043F7AD4775F0|+313

Let me know if this is what you need, or you need more information
Thanks in advance
Sveneb

@BIBOLV
Copy link
Collaborator

BIBOLV commented Jan 18, 2023

Those telegrams looks to be encrypted. Do you have decryption key? Can you post decrypted telegrams?

@SebastiaanBreedveld
Copy link

SebastiaanBreedveld commented Jan 20, 2023

I proposed this update last week.

Diff:

*** 42,47 ****
 -- 42,48 ----
          di.addDetection(MANUFACTURER_KAM, 0x0d,  0x30); // 302
          di.addDetection(MANUFACTURER_KAM, 0x0c,  0x30); // 302
          di.addDetection(MANUFACTURER_KAM, 0x04,  0x40); // 303
+ 	di.addDetection(MANUFACTURER_KAM, 0x0c,  0x40); // 303
          di.addDetection(MANUFACTURER_KAM, 0x0a,  0x34); // 403
          di.addDetection(MANUFACTURER_KAM, 0x0b,  0x34); // 403
          di.addDetection(MANUFACTURER_KAM, 0x0c,  0x34); // 403

A telegram:
(TPL) decrypted "2F2F0405352B00000413A906070004FF07F255020004FF08553502000259470B025D0A0A023B9F0502FF220000026CF42144052F000000441302AD0000426CE1212F2F2F2F2F2F2F2F2F2F2F2F2F2F2F"

Processed output:
(shell) env "METER_JSON={"media":"heat volume at inlet","meter":"kamheat","name":"Kamstrup","id":"82848073","status":"OK","total_energy_consumption_kwh":1106.1,"total_volume_m3":460.457,"volume_flow_m3h":1.439,"t1_temperature_c":28.87,"t2_temperature_c":25.7,"forward_energy_m3c":153074,"return_energy_m3c":144725,"meter_date":"2023-01-20","target_energy_kwh":4.7,"target_volume_m3":44.29,"target_date":"2023-01-01","timestamp":"2023-01-20T20:14:15Z","device":"rtlwmbus[00000001]","rssi_dbm":134}"

Let me know if you need more info!

@BIBOLV
Copy link
Collaborator

BIBOLV commented Jan 20, 2023

Thanks, could you post few more telegrams - this one does not parse for some reason.

@SebastiaanBreedveld
Copy link

Sure!

(TPL) decrypted "2F2F0405342B000004137806070004FF07E555020004FF084835020002598B08025D700A023B9B0502FF220000026CF42144052F000000441302AD0000426CE1212F2F2F2F2F2F2F2F2F2F2F2F2F2F2F"

(TPL) decrypted "2F2F0405342B000004137806070004FF07E555020004FF084835020002598B08025D700A023B9B0502FF220000026CF42144052F000000441302AD0000426CE1212F2F2F2F2F2F2F2F2F2F2F2F2F2F2F"

(TPL) decrypted "2F2F0405631800000413A499040004FF07587C010004FF08246B010002594B05025D5205023B000002FF220000026CEF2144052F000000441302AD0000426CE1212F2F2F2F2F2F2F2F2F2F2F2F2F2F2F"

@BIBOLV
Copy link
Collaborator

BIBOLV commented Jan 20, 2023

Can you post telegram=| lines?

@SebastiaanBreedveld
Copy link

Here is a full packet:

(serial) received ascii "T1;1;1;2023-01-20 20:57:07.000;134;133;82848073;0x5e442d2c73808482400c7af40050257b771b91c39e5dc8b68abfb33782dc738b0d3c0483f36622ea856c3fdc4bd4590d782d727d91f6240bf89cf81b62a76afce1512a39ef6e45ba8eca17c7a8cead706ec502964d61a7c65b23e39ee96d02<0A>"
(rtlwmbus) checkRTLWMBusFrame "T1;1;1;2023-01-20 20:57:07.000;134;133;82848073;0x5e442d2c73808482400c7af40050257b771b91c39e5dc8b68abfb33782dc738b0d3c0483f36622ea856c3fdc4bd4590d782d727d91f6240bf89cf81b62a76afce1512a39ef6e45ba8eca17c7a8cead706ec502964d61a7c65b23e39ee96d02
<0A>"
(rtlwmbus) received full frame
(wmbus) parseDLL @0 95
(wmbus) parseELL @10 85
(wmbus) parseNWL @10 85
(wmbus) parseAFL @10 85
(wmbus) parseTPL @10 85
(meter) Kamstrup: for me? 82848073 in 82848073
(meter) Kamstrup: yes for me
(meter) Kamstrup(1) kamheat  handling telegram from 82848073
(meter) Kamstrup 82848073 "5E442D2C73808482400C7AF40050257B771B91C39E5DC8B68ABFB33782DC738B0D3C0483F36622EA856C3FDC4BD4590D782D727D91F6240BF89CF81B62A76AFCE1512A39EF6E45BA8ECA17C7A8CEAD706EC502964D61A7C65B23E39EE96D02"
(wmbus) parseDLL @0 95
(telegram) DLL L=5e C=44 (from meter SND_NR) M=2c2d (KAM) A=82848073 VER=40 TYPE=0c (Heat volume at inlet meter) (driver kamheat) DEV=rtlwmbus[00000001] RSSI=134
(wmbus) parseELL @10 85
(wmbus) parseNWL @10 85
(wmbus) parseAFL @10 85
(wmbus) parseTPL @10 85
(TPL) num encrypted blocks 5 (80 bytes and remaining unencrypted 0 bytes)
(TPL) AES CBC IV decrypting "7B771B91C39E5DC8B68ABFB33782DC738B0D3C0483F36622EA856C3FDC4BD4590D782D727D91F6240BF89CF81B62A76AFCE1512A39EF6E45BA8ECA17C7A8CEAD706EC502964D61A7C65B23E39EE96D02"
(TPL) IV 2D2C73808482400CF4F4F4F4F4F4F4F4
(TPL) decrypted  "2F2F04056B2B00000413B70A070004FF078157020004FF08B536020002594C0E025D7F0E023BAF0502FF220000026CF42144052F000000441302AD0000426CE1212F2F2F2F2F2F2F2F2F2F2F2F2F2F2F"
(telegram) TPL CI=7a ACC=f4 STS=00 CFG=2550 (synchronous AES_CBC_IV nb=5 cntn=0 ra=0 hc=0)
(meters) trying field info on_time(Time)[0]...
(meters) trying field info status(Text)[1]...
(meters) trying field info total_energy_consumption(Energy)[2]...
(meters) using field info total_energy_consumption(Energy)[2] to extract 0405 at offset 19
(meter) AnyEnergyVIF total_energy_consumption_kwh decoded kwh default kwh value 1111.5
(meters) trying field info total_volume(Volume)[3]...
(meters) using field info total_volume(Volume)[3] to extract 0413 at offset 25
(meter) Volume total_volume_m3 decoded m3 default m3 value 461.495
(meters) trying field info volume_flow(Flow)[4]...
(meters) using field info volume_flow(Flow)[4] to extract 023B at offset 53
(meter) VolumeFlow volume_flow_m3h decoded m3h default m3h value 1.455
(meters) trying field info power(Power)[5]...
(meters) trying field info max_power(Power)[6]...
(meters) trying field info t1_temperature(Temperature)[7]...
(meters) using field info t1_temperature(Temperature)[7] to extract 0259 at offset 45
(meter) FlowTemperature t1_temperature_c decoded c default c value 36.6
(meters) trying field info t2_temperature(Temperature)[8]...
(meters) using field info t2_temperature(Temperature)[8] to extract 025D at offset 49
(meter) ReturnTemperature t2_temperature_c decoded c default c value 37.11
(meters) trying field info max_flow(Flow)[9]...
(meters) trying field info forward_energy(Energy)[10]...
(meters) using field info forward_energy(Energy)[10] to extract 04FF07 at offset 32
(meter) Any forward_energy_m3c decoded m3c default m3c value 153473
(meters) trying field info return_energy(Energy)[11]...
(meters) using field info return_energy(Energy)[11] to extract 04FF08 at offset 39
(meter) Any return_energy_m3c decoded m3c default m3c value 145077
(meters) trying field info meter_date(Text)[12]...
(meters) using field info meter_date(Text)[12] to extract 026C at offset 62
(meters) trying field info target_energy(Energy)[13]...
(meters) using field info target_energy(Energy)[13] to extract 4405 at offset 66
(meter) AnyEnergyVIF target_energy_kwh decoded kwh default kwh value 4.7
(meters) trying field info target_volume(Volume)[14]...
(meters) using field info target_volume(Volume)[14] to extract 4413 at offset 72
(meter) Volume target_volume_m3 decoded m3 default m3 value 44.29
(meters) trying field info target_date(Text)[15]...
(meters) using field info target_date(Text)[15] to extract 426C at offset 78
(kamheat) 000   : 5e length (94 bytes)
(kamheat) 001   : 44 dll-c (from meter SND_NR)
(kamheat) 002   : 2d2c dll-mfct (KAM)
(kamheat) 004   : 73808482 dll-id (82848073)
(kamheat) 008   : 40 dll-version
(kamheat) 009   : 0c dll-type (Heat volume at inlet meter)
(kamheat) 010   : 7a tpl-ci-field (EN 13757-3 Application Layer (short tplh))
(kamheat) 011   : f4 tpl-acc-field
(kamheat) 012   : 00 tpl-sts-field (OK)(OK)
(kamheat) 013   : 5025 tpl-cfg 2550 (synchronous AES_CBC_IV nb=5 cntn=0 ra=0 hc=0 )
(kamheat) 015   : 2f2f decrypt check bytes (OK)
(kamheat) 017   : 04 dif (32 Bit Integer/Binary Instantaneous value)
(kamheat) 018   : 05 vif (Energy 10² Wh)
(kamheat) 019 C!: 6B2B0000 ("total_energy_consumption_kwh":1111.5)
(kamheat) 023   : 04 dif (32 Bit Integer/Binary Instantaneous value)
(kamheat) 024   : 13 vif (Volume l)
(kamheat) 025 C!: B70A0700 ("total_volume_m3":461.495)
(kamheat) 029   : 04 dif (32 Bit Integer/Binary Instantaneous value)
(kamheat) 030   : FF vif (Manufacturer specific)
(kamheat) 031   : 07 vife (?)
(kamheat) 032 C!: 81570200 ("forward_energy_m3c":153473)
(kamheat) 036   : 04 dif (32 Bit Integer/Binary Instantaneous value)
(kamheat) 037   : FF vif (Manufacturer specific)
(kamheat) 038   : 08 vife (?)
(kamheat) 039 C!: B5360200 ("return_energy_m3c":145077)
(kamheat) 043   : 02 dif (16 Bit Integer/Binary Instantaneous value)
(kamheat) 044   : 59 vif (Flow temperature 10⁻² °C)
(kamheat) 045 C!: 4C0E ("t1_temperature_c":36.6)
(kamheat) 047   : 02 dif (16 Bit Integer/Binary Instantaneous value)
(kamheat) 048   : 5D vif (Return temperature 10⁻² °C)
(kamheat) 049 C!: 7F0E ("t2_temperature_c":37.11)
(kamheat) 051   : 02 dif (16 Bit Integer/Binary Instantaneous value)
(kamheat) 052   : 3B vif (Volume flow l/h)
(kamheat) 053 C!: AF05 ("volume_flow_m3h":1.455)
(kamheat) 055   : 02 dif (16 Bit Integer/Binary Instantaneous value)
(kamheat) 056   : FF vif (Manufacturer specific)
(kamheat) 057   : 22 vife (?)
(kamheat) 058 C?: 0000
(kamheat) 060   : 02 dif (16 Bit Integer/Binary Instantaneous value)
(kamheat) 061   : 6C vif (Date type G)
(kamheat) 062 C!: F421 ("meter_date":"2023-01-20")
(kamheat) 064   : 44 dif (32 Bit Integer/Binary Instantaneous value storagenr=1)
(kamheat) 065   : 05 vif (Energy 10² Wh)
(kamheat) 066 C!: 2F000000 ("target_energy_kwh":4.7)
(kamheat) 070   : 44 dif (32 Bit Integer/Binary Instantaneous value storagenr=1)
(kamheat) 071   : 13 vif (Volume l)
(kamheat) 072 C!: 02AD0000 ("target_volume_m3":44.29)
(kamheat) 076   : 42 dif (16 Bit Integer/Binary Instantaneous value storagenr=1)
(kamheat) 077   : 6C vif (Date type G)
(kamheat) 078 C!: E121 ("target_date":"2023-01-01")
(kamheat) 080   : 2F skip
(kamheat) 081   : 2F skip
(kamheat) 082   : 2F skip
(kamheat) 083   : 2F skip
(kamheat) 084   : 2F skip
(kamheat) 085   : 2F skip
(kamheat) 086   : 2F skip
(kamheat) 087   : 2F skip
(kamheat) 088   : 2F skip
(kamheat) 089   : 2F skip
(kamheat) 090   : 2F skip
(kamheat) 091   : 2F skip
(kamheat) 092   : 2F skip
(kamheat) 093   : 2F skip
(kamheat) 094   : 2F skip
(meters) render field status(Text)[1] without dventry
(meters)             "status":"OK"
(meters) render field total_energy_consumption(Energy kwh)[2] with dventry @19 key 0405 data 6B2B0000
(meters)             "total_energy_consumption_kwh":1111.5
(meters) render field total_volume(Volume m3)[3] with dventry @25 key 0413 data B70A0700
(meters)             "total_volume_m3":461.495
(meters) render field volume_flow(Flow m3h)[4] with dventry @53 key 023B data AF05
(meters)             "volume_flow_m3h":1.455
(meters) render field t1_temperature(Temperature c)[7] with dventry @45 key 0259 data 4C0E
(meters)             "t1_temperature_c":36.6
(meters) render field t2_temperature(Temperature c)[8] with dventry @49 key 025D data 7F0E
(meters)             "t2_temperature_c":37.11
(meters) render field forward_energy(Energy m3c)[10] with dventry @32 key 04FF07 data 81570200
(meters)             "forward_energy_m3c":153473
(meters) render field return_energy(Energy m3c)[11] with dventry @39 key 04FF08 data B5360200
(meters)             "return_energy_m3c":145077
(meters) render field meter_date(Text txt)[12] with dventry @62 key 026C data F421
(meters)             "meter_date":"2023-01-20"
(meters) render field target_energy(Energy kwh)[13] with dventry @66 key 4405 data 2F000000
(meters)             "target_energy_kwh":4.7
(meters) render field target_volume(Volume m3)[14] with dventry @72 key 4413 data 02AD0000
(meters)             "target_volume_m3":44.29
(meters) render field target_date(Text txt)[15] with dventry @78 key 426C data E121
(meters)             "target_date":"2023-01-01"
(shell) exec "/bin/sh"
(shell) arg "-c"
(shell) arg "/home/sebastiaan/scripts/kamstrup_updates.py"
(shell) env "METER_JSON={"media":"heat volume at inlet","meter":"kamheat","name":"Kamstrup","id":"82848073","status":"OK","total_energy_consumption_kwh":1111.5,"total_volume_m3":461.495,"volume_flow_m3h":1.455,"t1_temperature_c":36.6,"t2_temperature_c":37.11,"forward_energy_m3c":153473,"return_energy_m3c":145077,"meter_date":"2023-01-20","target_energy_kwh":4.7,"target_volume_m3":44.29,"target_date":"2023-01-01","timestamp":"2023-01-20T20:57:07Z","device":"rtlwmbus[00000001]","rssi_dbm":134}"
(shell) env "METER_ID=82848073"
(shell) env "METER_NAME=Kamstrup"
(shell) env "METER_MEDIA=heat volume at inlet"
(shell) env "METER_TYPE=kamheat"
(shell) env "METER_TIMESTAMP=2023-01-20T20:57:07Z"
(shell) env "METER_TIMESTAMP_UTC=2023-01-20T20:57:07Z"
(shell) env "METER_TIMESTAMP_UT=1674248227"
(shell) env "METER_TIMESTAMP_LT=2023-01-20 21:57.07"
(shell) env "METER_DEVICE=rtlwmbus[00000001]"
(shell) env "METER_RSSI_DBM=134"
(shell) env "METER_ON_TIME_Hour=null"
(shell) env "METER_STATUS=OK"
(shell) env "METER_TOTAL_ENERGY_CONSUMPTION_KWH=1111.5"
(shell) env "METER_TOTAL_VOLUME_M3=461.495"
(shell) env "METER_VOLUME_FLOW_M3H=1.455"
(shell) env "METER_POWER_KW=null"
(shell) env "METER_MAX_POWER_KW=null"
(shell) env "METER_T1_TEMPERATURE_C=36.6"
(shell) env "METER_T2_TEMPERATURE_C=37.11"
(shell) env "METER_MAX_FLOW_M3H=null"
(shell) env "METER_FORWARD_ENERGY_M3C=153473"
(shell) env "METER_RETURN_ENERGY_M3C=145077"
(shell) env "METER_METER_DATE=2023-01-20"
(shell) env "METER_TARGET_ENERGY_KWH=4.7"
(shell) env "METER_TARGET_VOLUME_M3=44.29"
(shell) env "METER_TARGET_DATE=2023-01-01"
(shell) waiting for child 802438 to complete.
(shell) /bin/sh: return code 0

Was compiled with a checkout on 13 January, with the only change being the addition of (0x0c, 0x40).

@BIBOLV
Copy link
Collaborator

BIBOLV commented Jan 20, 2023

Sorry for troubling you but could you set logtelegrams=true, restart service and post few telegram=|. Those interim strings I can`t process.

@SebastiaanBreedveld
Copy link

Ah sorry, I thought the telegrams were anyway logged in debug mode. Here is some more:

telegram=|5E442D2C73808482400C7A620050252F2F_04056C2B000004138A0B070004FF07C657020004FF08FD3602000259B209025D6A09023B000002FF220000026CF42144052F000000441302AD0000426CE1212F2F2F2F2F2F2F2F2F2F2F2F2F2F2F|+28

telegram=|5E442D2C73808482400C7A6E0050252F2F_04056C2B000004138A0B070004FF07C657020004FF08FD36020002594B09025DFA08023B000002FF220000026CF42144052F000000441302AD0000426CE1212F2F2F2F2F2F2F2F2F2F2F2F2F2F2F|+216

@BIBOLV
Copy link
Collaborator

BIBOLV commented Jan 20, 2023

Perfect, tnx!

BIBOLV added a commit to BIBOLV/wmbusmeters that referenced this issue Jan 20, 2023
Adding new meter version to driver - wmbusmeters#808
@SebastiaanBreedveld
Copy link

Thanks!

@BIBOLV
Copy link
Collaborator

BIBOLV commented Jan 21, 2023

Could you confirm that everything is working so we could close this issue?

@SebastiaanBreedveld
Copy link

Did a fresh clone, and it all works!

@BIBOLV BIBOLV closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants