Get JSON value in Vis

Beiträge: 1
Registriert: 17.02.2018, 23:51

Get JSON value in Vis

Beitrag von PlumBum » 17.02.2018, 23:55

how do i get an value from an JSON string to display in an text field

if i select an object id then i get the whole Json string i want just one value

Beiträge: 58
Registriert: 10.04.2015, 18:46

Re: Get JSON value in Vis

Beitrag von bondrogeen » 21.03.2018, 12:23

Disassemble the string using ioBroker.javascript and create a separate variable

Beiträge: 87
Registriert: 21.11.2017, 22:09

Re: Get JSON value in Vis

Beitrag von Karl_999 » 01.04.2018, 17:36

Some days ago I had the same question viewtopic.php?f=20&t=13136&p=138325 (in German)
My solution is based on the systeminfo adapter as described in using the filter

Code: Alles auswählen

nodes[?( == 'mynames')][name,lastcontact,status,loadavg]
This searches in a list (of nodes) for the entry with'mynames' and extracts from that entry the properties name, lastcontact, status and loadavg.
In case you would like to have names instead of numbered variables you might define the variable name as

Code: Alles auswählen


Beiträge: 1
Registriert: 03.05.2018, 17:40

Re: Get JSON value in Vis

Beitrag von tomganleylee » 03.05.2018, 17:43

This has been a really useful thread for me however i am still a little stuck:

I have some mqtt data coming in in JSON format the data looks like this: {"Cistern":1,"Capacity":1160}

ive installed the Systeminfo and tried adding the json to the _data.json file however i cant seem to get it to come out as a varable to use in the vis.

would you be able to guide me in what steps i need to take?

Many thanks