Please be aware that the line of code is not valid as the quotes have to be escaped.
By the way: I’m using volkszähler, too, and I get the raw values via mqtt rather than http. Can be configured in vzlogger.conf, I’m getting one topic per channel, like this:
This does not work. I got this error. JSONPATH seems to create a String with scientific notation?! Any further ideas?
Type mismatch: cannot convert from String to Double;
I also thought about MQTT. I do not have Mosquitto installed yet, but this should not be the issue. My problem is rather that MQTT would send e.g. every 1 minute, but I would only persist every hour at xx:59:30. So there is a possible time gap of max. 1 minute between MQTT value and persisting. Did you solve this issue? At the moment I think it is not possible to persist with a timestamp.
I have done some testing. The JSONPath transform seems to always do an internal conversion with scientific notation and returns a String back. The problem here is that there is a loss of precision. Why does this happen?
Of course I can convert the returned String to Double and then back to String like this, but as said only with loss of precision.
In fact, even the “34746388.600000001” is not correct (no, vzlogger can’t measure sub-sub Watts where there aren’t)
But the behavior of transform seems to be very strange. I’ve checked here and I can confirm.
Did you tryout a direct transformation yet? (i.e. build a channel and convert directly in the channel)