Expand catalog of units and registers, fix some and use decimals#8
Expand catalog of units and registers, fix some and use decimals#8
Conversation
| @@ -117,6 +117,12 @@ | |||
| 62: "days", | |||
| 63: "RTC-Q", | |||
| 64: "Datetime", | |||
There was a problem hiding this comment.
you can also add:
65: "imp/L",impulses per liter66: "L/imp",liters per impulse
There was a problem hiding this comment.
Thanks! I'll adopt it lowercase as other liters are denoted with lowercase-l, is that OK?
|
Re commit cd15365 and some bits in the commit message:
This is indeed Q_p for V1. There's also reg. 260 which is Q_p for V2.
That's correct and documented by the vendor in another document (that I cannot share).
I do not see this in the docs, but my original guess is as good as it was before. You might also want to squash commit 8786735 in there (registers cfg no 3 and cfg no 4). |
6cdb0cb to
647aa45
Compare
|
I think I've incorporated all now. 😃 I would prefer to merge #7 first, then doing the remaining TODO on the changelog. |
647aa45 to
6aff223
Compare
jktjkt
left a comment
There was a problem hiding this comment.
Ooops, I'm getting some error in the test suite, let me investigate. Sorry for noise.
6aff223 to
2497571
Compare
The vast majority of the vendor-provided documentation uses decimal numbers as the primary format -- and so does this tool in its default output. I only found a couple of documents which used hex numbers, and in these cases they were always accompanied with the decimal equivalent. I saw no instance of hexadecimal with no decimal equivalents.
"Kelvin degrees" is an ancient way to denote the Kelvin unit of temperature. The unit name "degree kelvin" was changed to "kelvin" in 1967 (13th CGPM, Resolution 3). See also: https://physics.nist.gov/cuu/pdf/sp330.pdf (page 34) Co-Authored-By: Gert van Dijk <github@gertvandijk.nl>
Unit ID 21 is stated as W (watts) in the "58101758_B1_GB_02.2021" document (Modbus register mapping, Modbus RTU, Modbus/KMP TCP/IP"). It also makes sense, looking at the pattern of the order-of-magnitude scales in the table of units. The error appears to be coming from other KMP reader implementations: - bsdphk/PyKamstrup@3ca8785 - esphome/esphome@64a47f8#diff-244b855ce21060b07df0fb916a2d2541e6814ca7312a5dc91c05935f3e076c15R70
This is speculative (I have no KMP-speaking electricity meter with an IEC optical port), but given that the "kvar" is already defined, and looking at the other units seeing a pattern of the order-of-magnitude scale, this is very likely a typo. See also the parent commit here for a similar unit scale error corrected.
IDs 85-90 come from the "58101758_B1_GB_02.2021" document (Modbus register mapping, Modbus RTU, Modbus/KMP TCP/IP"). I have not seen them in my meters, but given that all the other values match, I would say there is a good chance that they are correct.
Some of these calculators support multiple flow meters, so let's identify which "channel" this is using.
… 110 The datasheet has this information, so let's include it in the source code.
Almost all of these were cross-checked against a number of PDFs which I found on the web. The exceptions are documented in the code: - 259 & 260 are very likely the Q_p, aka the nominal flow, for V1 and V2 respectively. - 675 is only present on our wireless M-Bus enabled Multical 303 which were procured with a transmission interval of 96 seconds that seems to match the register value.
These were provided by Benny Lyne Amorsen and cross-checked against Poul-Henning Kamp's bsdphk/PyKamstrup repository: https://github.com/bsdphk/PyKamstrup/blob/f5692d29180024d9a59aa35a075f380ca8018276/kamstrup.py References: #2
2497571 to
6e77910
Compare
So that was in #9 right? ✅ |
| @@ -117,6 +117,12 @@ | |||
| 62: "days", | |||
| 63: "RTC-Q", | |||
| 64: "Datetime", | |||
This is mostly cherry-picking @jktjkt's commits from PR #4 in a slightly different order and with some updated commit messages and code comments.
I would like to ask @jktjkt to review the state of this PR given my edits to their commits.
TODOs:
Pressure P1).