Json Object import

Hi,

I will read some values from a mower.

If I send a reqest to the mower : http://192.168.178.35/json?cmd=status
than I’ve got following answer:
{“successful”: true, “name”: “Robi”, “status”: {“status”: 17, “stopped”: false, “duration”: 3656, “mode”: 0, “battery”: 100, “hours”: 205}, “timer”: {“status”: 1, “next”: {“date”: “02.05.2017”, “time”: “07:00:00”, “unix”: 1493708400}}, “wlan”: {“signal”: -78}}

Now I create a String Item:

String AutoMowerRawData "AutoMower RAW Data"      (Robi)     { http="<[http://192.168.178.35/json?cmd=status:60000:JS(getvalue.js)]" }

and following transform (name: getvalue.js)

JSON.parse(input).name;

unfortunely I got only a empty String.

what is wrong?

How about:

String AutoMowerRawData "AutoMower RAW Data"      (Robi)     { http="<[http://192.168.178.35/json?cmd=status:60000:JSONPATH($.name)]" }

Thx

String AutoMowerRawData "AutoMower RAW Data   [%s]"      (Robi)     { http="<[http://192.168.178.35/json?cmd=status:60000:JSONPATH($.name)]" }

It’s still working :slight_smile: