Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding JSON recusivly #9

Open
volkerrichert opened this issue Aug 29, 2018 · 6 comments
Open

Expanding JSON recusivly #9

volkerrichert opened this issue Aug 29, 2018 · 6 comments

Comments

@volkerrichert
Copy link

If you have an object inside an object like

{
status: "ok",
serverTime: "2018-08-29T11:34:34.930Z",
serverTimeEpoch: 1535542474930,
apiEnabled: true,
careportalEnabled: true,
boluscalcEnabled: true,
head: "02a02c7",
settings: {
units: "mg/dL",
timeFormat: 24,
theme: "default",
alarmUrgentHigh: true,
alarmUrgentHighMins: [30, 60, 90, 120]
}
}

i'm not able to populate the hole object. settings is just a string '{ units: "mg/dL", timeFormat: 24,...'. The top elements are processed correctly.

@frankjoke
Copy link
Collaborator

Can you explain what info you want and how you try to get it?

@volkerrichert
Copy link
Author

imagine a json like

{
a: {
b: 12,
c: { c1:'Hi', c2: true, ... }
},
d: [{
more objects/arrays
},{
also more objects/arrays
}
]
}

returned form a server via http. I try to import the hole json including all sub structure into ioBroker using

status.[*] | web | [URL] | (empty filter) | json | (no write) | */15 * * * *

i also test

status.* and different filters.

@frankjoke
Copy link
Collaborator

frankjoke commented Sep 5, 2018

Hi volkerrichert!
If you want the full json converted to an object and stored in variable then put (@) into filter (it returns the full object converted from json) and set no role/type

status| web | [URL] | (@) | json | (no type) | (no write) | */15 * * * *

if you want to get only the settings the use in filter (@.settings) or settings only should work as well if on main level.

otherwise the json itself is returned as a string ....

@volkerrichert
Copy link
Author

i did it and the status is just a single string

image

the config looks like

image

What's wrong?
Volker

@werde45
Copy link

werde45 commented Dec 15, 2018

Any news about this issue? Have same problem with other source: https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=en-US
Try to get the url from picture. It always returns a big string...

@volkerrichert
Copy link
Author

nope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants