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

Scale value problem for cumulative data #43

Open
StarkJohan opened this issue Aug 29, 2022 · 7 comments
Open

Scale value problem for cumulative data #43

StarkJohan opened this issue Aug 29, 2022 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@StarkJohan
Copy link

  • Kamstrup 6841138AN243101090 (Kamstrup_V0001) in Sweden
  • Binary data captured directly on the meter and sent unaltered via MQTT

With the default config dialog scale value of 1 all sensors report correctly (power, current, voltage) except the cumulative values that in my case would need a scale value of 0.1. E.g. the meter has used 38062 kWh in total (as read on the display) but the "Cumulative hourly active import energy (A+) (Q1+Q4)" reports 380620 kWh. As this is the sensor I would like to use as the total consumption for the Energy dashboard in HA this setup does not currently work for this meter.

Not sure what the best solution would be but if the meter reports "incorrect" values maybe more than one scale value is needed in the configuration dialog? I.e. one general scale value and one for the cumulative measurements?

For now I've changed the scale values in sensor.py to fit my needs as a workaround.

@toreamun toreamun self-assigned this Aug 31, 2022
@toreamun toreamun added the bug Something isn't working label Aug 31, 2022
@toreamun
Copy link
Owner

Are you able to provide raw sample data from MQTT topic?

@toreamun
Copy link
Owner

@StarkJohan Are you able to provide raw sample data from MQTT topic?

@StarkJohan
Copy link
Author

StarkJohan commented Oct 12, 2022

Sorry for not getting back to you on this Tore. I've had to prioritize other things. I would be able to provide data but I've been using AmsToMqttBridge which has been spot on for the hourly data for 4-5 weeks at this point. As it "just works" (after a few code adjustments to fit my needs, e.g. the above mentioned scale values) I will have to return to help you get this sorted at a later date.
BTW I'm pretty sure this is not a bug in your code but an error in Kamstrups ability to conform to the standards as I have the exact same issue when decoding the data with AmsToMqttBridge or the HAN python library.

@papaste
Copy link

papaste commented Apr 17, 2023

image

@toreamun Just installed. What an amazing integration! I am also getting incorrectly scalead cumulative values. It would be correct with a scaling of 0.1. Everything else is scaled properly.

@eribi
Copy link

eribi commented Oct 16, 2023

I do have the same issue. How can I help to solve this?

@papaste
Copy link

papaste commented Oct 16, 2023

@eribi Here is a the workaround I am using:
Disable the faulty entities:
image

Add the following to your configuration.yaml:

sensor:
  - platform: integration
    source: sensor.kamstrup_active_power_import
    name: Energy import (kWh)
    unit_prefix: k
    round: 2
  - platform: integration
    source: sensor.kamstrup_active_power_export
    name: Energi export (kWh)
    unit_prefix: k
    round: 2

@epideme
Copy link

epideme commented Feb 22, 2024

@toreamun Here's a snippet of a hex dump of the hourly data packet over MQTT from Kamstrup_V0001:
Raw file and hex translation also attached.
Kamstrup_V0001-pulse-mqtt.zip

00000dc0: 7ea1 2c2b 2113 fc04 e6e7 000f 0000 0000  ~.,+!...........
00000dd0: 0c07 e802 1604 1000 37ff 8000 0002 230a  ........7.....#.
00000de0: 0e4b 616d 7374 7275 705f 5630 3030 3109  .Kamstrup_V0001.
00000df0: 0601 0100 0005 ff0a 1035 3730 3635 3637  .........5706567
00000e00: 3334 3631 3533 3335 3409 0601 0160 0101  346153354....`..
00000e10: ff0a 1236 3834 3131 3338 424e 3234 3531  ...6841138BN2451
00000e20: 3031 3039 3209 0601 0101 0700 ff06 0000  01092...........
00000e30: 0c8a 0906 0101 0207 00ff 0600 0000 0009  ................
00000e40: 0601 0103 0700 ff06 0000 05aa 0906 0101  ................
00000e50: 0407 00ff 0600 0000 0009 0601 011f 0700  ................
00000e60: ff06 0000 0258 0906 0101 3307 00ff 0600  .....X....3.....
00000e70: 0001 e709 0601 0147 0700 ff06 0000 01c8  .......G........
00000e80: 0906 0101 2007 00ff 1200 e809 0601 0134  .... ..........4
00000e90: 0700 ff12 00ec 0906 0101 4807 00ff 1200  ..........H.....
00000ea0: ea09 0600 0101 0000 ff09 0c07 e802 1604  ................
00000eb0: 1000 37ff 8000 0009 0601 0101 0800 ff06  ..7.............
00000ec0: 0100 92b2 0906 0101 0208 00ff 0600 1c23  ...............#
00000ed0: 0d09 0601 0103 0800 ff06 003b b9eb 0906  ...........;....
00000ee0: 0101 0408 00ff 0600 1a5c 0d75 297e 0a    .........\.u)~.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants