I want to transform a Thing via JSONPATH and get only null as Tranform response.
The Json-String (its from vzlogger, I fetch a s0-meter via a GPIO and want to get the Watt) looks like this:
{ “version”: “0.6.1”, “generator”: “vzlogger”, “data”: [ { “uuid”: “da700390-af1a-11e6-bc58-2d548e76e54c”, “last”: 1507031721882, “interval”: -1, “protocol”: “s0”, “tuples”: [ [ 1507031721882, 2714.9316893122327 ] ] } ] }
The value I want to get is the 2714.9316893122327.
My things-file:
Thing exec:command:stromzaehlertest [command=“curl -G --silent http://192.168.0.60:8081”, interval=5, timeout=1, transform=“JSONPATH($[‘data’].[‘tuples’].[1])”]
I tested the JSONPATH-part via http://jsonpath.com/ and it looks right for me, but in the DEBUG-Log it looks like this:
2017-10-03 18:51:59.010 [DEBUG] [hab.binding.exec.handler.ExecHandler] - Exec [OUTPUT]: '{ “version”: “0.6.1”, “generator”: “vzlogger”, “data”: [ { “uuid”: “da700390-af1a-11e6-bc58-2d548e76e54c”, “last”: 1507049517452, “interval”: -1, “protocol”: “s0”, “tuples”: [ [ 1507049517452, 2714.9316893122327 ] ] } ] }'
2017-10-03 18:51:59.610 [DEBUG] [hab.binding.exec.handler.ExecHandler] - Transformed response is ‘null’
Does anybody can help me? I don’t know what to do now and got a few hours spent on it.
PS: I got the Openhab Snapshotversion from last week (end of september 2017)