Units of Measurements (Volkszähler connected via MQTT) -> scale is wrong

Hey, when trying to implement volkszähler (basically a smart meter integration for all kind of meters and gateways), I am experiencing some issues.
I wanted to use the MQTT implementation. This sends numbers, in case of the first channel, thats watt-hours (Wh) for the value “positive active energy” / OBIS 1.8.0:

So i will get kWh instead of Wh


Where or how can i specify, what unit (Wh, kW etc.) i want to use for a certain channel/item?

Thanks for your support!

You have to set the unit parameter.

Thing topic smartmeter "Smartmeter" @ "Basement"
{
    Channels :
        //1.8.0: Zählerstand Bezug
        Type string : chn0_id        "Chn 0 ID"      [stateTopic="RPI/smartmeter/chn0/id"]
        Type string : chn0_uuid      "Chn 0 uuid"    [stateTopic="RPI/smartmeter/chn0/uuid"]
        Type number : chn0_timestamp "Chn 0 Update"  [stateTopic="RPI/smartmeter/chn0/agg", transformationpattern="JSONPATH:$.timestamp" ]
        Type number : chn0_reading   "Chn 0 Reading" [stateTopic="RPI/smartmeter/chn0/agg", transformationpattern="JSONPATH:$.value", unit="Wh" ]
    Channels :
        //2.8.0: Zählerstand Lieferung
        Type string : chn1_id        "Chn 1 ID"      [stateTopic="RPI/smartmeter/chn1/id"]
        Type string : chn1_uuid      "Chn 1 uuid"    [stateTopic="RPI/smartmeter/chn1/uuid"]
        Type number : chn1_timestamp "Chn 1 Update"  [stateTopic="RPI/smartmeter/chn1/agg", transformationpattern="JSONPATH:$.timestamp" ]
        Type number : chn1_reading   "Chn 1 Reading" [stateTopic="RPI/smartmeter/chn1/agg", transformationpattern="JSONPATH:$.value", unit="Wh" ]
    Channels :
        //16.7.0: Leistung (momentan)
        Type string : chn2_id        "Chn 2 ID"      [stateTopic="RPI/smartmeter/chn2/id"]
        Type string : chn2_uuid      "Chn 2 uuid"    [stateTopic="RPI/smartmeter/chn2/uuid"]
        Type number : chn2_timestamp "Chn 2 Update"  [stateTopic="RPI/smartmeter/chn2/agg", transformationpattern="JSONPATH:$.timestamp" ]
        Type number : chn2_reading   "Chn 2 Reading" [stateTopic="RPI/smartmeter/chn2/agg", transformationpattern="JSONPATH:$.value", unit="W" ]
}
1 Like

Perfect, that’s it!