Hi everybody. I started to study OpenHAB2, but don’t understand how to work with JSON transformation.
In Paper UI, “JSONPath Transformation” is installed.
I wrote python script, that return string:
When I try to see control, I look in Commad panel this text: JSONPATH($.name).
There is an impression that JSONPATH doesn’t work correctly.
Please tell me how to solve the problem? Or any recommendations on what to read are very welcome.
Following the docs you need to place a %s formatter to define that the return value from the jsonpath request is placed as string to the label.
I think your Item should look like this:
Thanks for your reply. I try to add “:%s”, but result was unexpected. In control panel appear all string such: { “fw”: “3.1.8”, “name”: “Flower care”, “temperature”: 24.0, “moisture”: 10.0, “light”: 61.0, “conductivity”: 37.0, “battery”: 99.0 }.
I check syntax JSON FORMAT, all this right.
Any idea why?