MQTT feed multiplier is wrong

Hello,

I'm really enjoying how easy energy monitoring seems to have become with SMETS2. I've got quite far with Home Assistant and various glowing (!) reviews of Hildebrand Glow led me to get a SMETS2 CAD to replace my ancient Current Cost CC128.

All seems to be going well, except the multiplier on the MQTT feed appears to be wrong. The CAD and Bright app both display the right values (eg. 314 Watts) but the feed InstantaneousDemand reading is coming in 10 * higher.

When I installed the Hildebrand Glow Integration in Home Assistant I didn't seem to get any usable values, so I followed the Gist at https://gist.github.com/ndfred/5bb51b567f8cfaf2bb06da6393169321 to template the MQTT feeds using configuration.yaml

I have a feeling I'm hitting some form of firmware bug described here: https://gist.github.com/ndfred/5bb51b567f8cfaf2bb06da6393169321?permalink_comment_id=3885291#gistcomment-3885291 but I can't figure out why the CAD and app would be fine but the MQTT feed not. Perhaps the SummationFormatting (E3) is a clue?

{
    "elecMtr": {
        "0702": {
            "00": {
                "00": "000006F8A91F",
                "01": "000000000000",
                "02": "000000000000",
                "07": "00000000",
                "14": "02"
            },
            "02": {
                "00": "11"
            },
            "03": {
                "00": "00",
                "01": "00000001",
                "02": "00002710",
                "03": "E3",
                "04": "E3",
                "06": "00",
                "07": "2000009246020",
                "08": "19M1239488"
            },
            "04": {
                "00": "00000CD1",
                "01": "023F3C",
                "30": "023F3C",
                "40": "2E397A"
            }
...

FYI the template looks like this, which appears to take into account multiplier and divisor attributes for Summation. I added the divide by 10 myself to fix the instantaneous readings.

  - platform: mqtt
    name: "Home Instant Electricity"
    unique_id: sensor.home_instant_electricity1
    state_topic: "SMART/HILD/<MAC>"
    unit_of_measurement: "W"
    value_template: "{{ value_json['elecMtr']['0702']['04']['00']|int(base=16) / 10 }}"
    icon: "mdi:flash"
  - platform: mqtt
    name: "Home Electricity"
    state_topic: "SMART/HILD/<MAC>"
    unit_of_measurement: "kWh"
    value_template: "{{ value_json['elecMtr']['0702']['00']['00']|int(base=16) * value_json['elecMtr']['0702']['03']['01']|int(base=16) / value_json['elecMtr']['0702']['03']['02']|int(base=16) }}"
    icon: "mdi:flash"

Any help would be appreciated. I can manually mangle this back to normal, but thought I'd try to understand it rather than bodge it. 🤷‍♂️

Thanks

Ben

Comments

  • edited March 2022

    To explain this comment: "When I installed the Hildebrand Glow Integration in Home Assistant I didn't seem to get any usable values" since revisiting the config I have the same multiplier issue with this HACS Hildebrand integration as I do with the MQTT feed template method.

    Only the CAD and app (and luckily, Octopus!) seem to get the right multiplier.

  • sounds like this is from the meter's themselves maybe the integrations just need to apply their own multipler (or have a setting to add this).

Sign In or Register to comment.