From b76c6e12f4cc03ec38e6f02e13541ef3abd18cbd Mon Sep 17 00:00:00 2001 From: Joe Rouvier Date: Mon, 5 Sep 2022 18:14:16 -0700 Subject: [PATCH] Create protocol-meter-reading.md --- docs/protocol-meter-reading.md | 79 ++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docs/protocol-meter-reading.md diff --git a/docs/protocol-meter-reading.md b/docs/protocol-meter-reading.md new file mode 100644 index 0000000..2456a5b --- /dev/null +++ b/docs/protocol-meter-reading.md @@ -0,0 +1,79 @@ +# Meter Response Payload + +The meter reading response contains 152 bytes of payload, most of which seems to always be zeros. The below table details the payload format. +Blank cells have never been seen to be anything other than zero. Note the table is zero-indexed + + + + + + + + + + + + + + + + + +
0123
0
4 EnergyVal
...
44 MeterDiv
48 EnergyCostUnit
52 Unknown 1
56 PowerVal
...
148 MeterTS
+ +## Known Fields + +### EnergyVal + +Bytes 4 to 8, 32 bit int, unknown if signed, MSB + +Energy Meter totalizer in watts, in other words, cumulative watt-hours consumed. Unknown when this value resets to zero, +might reset monthly or on start of new billing cycle. + +Sometimes, an invalid number greater than `0x00400000` is returned, it is not understood when or why this happens. + +### MeterDiv + +At least byte 47, maybe as large as bytes 44 to 47 + +Some meters report values not in watts and watt hours but in a multiple of those values. `EnergyVal` and `PowerVal` should +be divided by `MeterDiv` to determine the real value. Usually this is 1, but have also seen a value of 3. + +### EnergyCostUnit + +Bytes 50 and 51 MSB(?) + +Usually `0x03E8`, which is 1000. Theorized to be how many `EvergyVal` units per "cost unit" (a value we don't appear to have). +Since people are typically charged per kWh, this value is typically 1000. + +This value is not currently used in the code + +### PowerVal + +Bytes 57 to 59 (24 bit signed int, MSB) + +The power being consumed at the moment in Watts. If you have a grid-tie solar / wind / battery system, then this value can go negative. +Negative values are returned in 1's complement notation (if left most bit is 1, then flip all the bits then multiply by -1) + +"Data Missing" / "Unknown" is denoted as max negative, `0x800000` + +### MeterTS + +Bytes 148 to 151 (32 bit unsigned int, LSB) + +Number of milliseconds since an unknown event. Could be time since `EnergyVal` was reset, or could just be a free-running timer. +Will roll over every 49 days. + +Only reported as a debugging value, not used in calculations. + +### Unknown 1 + +Bytes 52 and 53 + +The meaning of the values in these fields is completely unknown. They appear to be static for each meter. Some of the observed values from users include: +``` +fbfb +2c2b +3133 +``` +Random uneducated guess is that this is a bit field with flags about the meter configuration.