I’m trying to figure out why my transformation does not work:
Type number : StromzaehlerstandBezug "Zählerstand Bezug" [ stateTopic="devices/SMLReader/sensor/1/obis/1-0:1.8.0/255/value", transformationPattern="JS:| parseFloat(input) / 1000"]
Type number : StromzaehlerstandEinspeisung "Zählerstand Einspeisung" [ stateTopic="devices/SMLReader/sensor/1/obis/1-0:2.8.0/255/value", transformationPattern="JS:| parseFloat(input) / 1000"]
Messages on this topic are a single float value (i.e. “1234.5”), but those are Wh, while I would prefer kWh (i.e. “1.2345”).
Sender is SMLReader running on a ESP8266 sitting on my new smart meter.
The transformation seems to have no effect at all, but there is no error message visible neither in openhab.log nor events.log (which shows the change to the non transformed value).
Javascript-Transformation ( binding/addon ) is installed ?
Is your code an excerpt of a things file ? See this thread for a similar discussion:Inline JS transformation not working
Thanks @Wolfgang_S for those hints. The really strange thing is, that this is just a few lines above, and it works:
Type number : battery_soc "Batteriestand" [ stateTopic="devices/rctPower/battery.soc", transformationPattern="JS:| parseFloat(input) * 100" ]
So I think the surrounding conditions (JS transformation installed, MQTT binding can potentially do this, …) are fulfilled.
Really no clue what is wrong this time…