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

Reading the third level in a json array #434

Open
TerjeTM opened this issue Jan 30, 2025 · 6 comments
Open

Reading the third level in a json array #434

TerjeTM opened this issue Jan 30, 2025 · 6 comments
Assignees
Labels
datasource enhancement Feature request pending release part of the next release version
Milestone

Comments

@TerjeTM
Copy link

TerjeTM commented Jan 30, 2025

I want to read the third level of a json array.

Array example:
{
“code”: 0,
“msg”: “Erfolg”,
“time”: “1738221292”,
“data”: {
“outdoor”: {
“temperature”: {
“time”: “1738221165”,
“unit”: “℃”,
“value”: “0.0”
},
“feels_like”: {
“time”: “1738221165”,
“unit”: “℃”,
“value”: “0.0”
},
“dew_point”: {
“time”: “1738221165”,
“unit”: “℃”,
“value”: “-0.4”
},
},
“indoor”: {
“temperature”: {
“time”: “1738221165”,
“unit”: “℃”,
“value”: “22.5”

The following object path works, but takes some values in the lowest level “time,unit,value”:
data/outdoor{time,unit,value}

If I want to go to the third level under Object path "feels_like", I get the following message:

Object path:
data/outdoor/feels_like{time,unit,value}

Message:
Error: Cannot access offset of type string on string
Why?

How can I specifically read out the values of “feels_like, dew_point” etc.?

@Rello Rello self-assigned this Feb 1, 2025
@Rello Rello added enhancement Feature request datasource labels Feb 1, 2025
@Rello
Copy link
Owner

Rello commented Feb 1, 2025

Hello,
valid point. I made an adjustment in the code so it would extract as expected.

in your case I would recommend to use a description column and skip the unit for this. then use the unit in the report as header

data path: data/outdoor/feels_like{Feels Like,time,value}

Image

is this usable as expected?

@Rello Rello added the in progress development in progress label Feb 2, 2025
@TerjeTM
Copy link
Author

TerjeTM commented Feb 2, 2025

Hello

That would be great if the real name would be displayed for Object.
Date / time would have to be displayed in a readable way like 2025.02.02 12:05.

How can I test this, can I already download the customized version?

It would also be great if several values could be displayed in a table (graph). E.g. “current temperature” and “Feels_like”. To do this, the “unit” would have to be a unit again and there would have to be another column with the description. So you could display the individual or both values graphically in the legend, otherwise only one value can be displayed at a time (no comparison in the graphic). For example, with wind, it would be useful to be able to see the wind direction and wind force in a graph.
If that's possible, that would be brilliant!

Many thanks
Greetings Terje

Translated with DeepL.com (free version)

@Rello
Copy link
Owner

Rello commented Feb 2, 2025

Hi,

technically, if the mentioned fix works, the way would be to split the dataload into 2 loads into the same dataset. one for current, one for feel.
then you have Type/date/number in the data and you can combine them in a chart.

if you have values of different units, you can use the secondary y-axis for one of them e.g.

@TerjeTM
Copy link
Author

TerjeTM commented Feb 2, 2025

Hello

that would be absolutely awesome!
I'm looking forward to the release :-)

Please let me know when it's ready so I can test it.

Many thanks!
Terje

@TerjeTM
Copy link
Author

TerjeTM commented Feb 2, 2025

I have one more question;
Do you also make the change for NC version 29.0.X?
I am currently unable to upgrade to the new HUB V30 or V31.

Thank you very much!
Terje

@Rello
Copy link
Owner

Rello commented Feb 2, 2025

Do you also make the change for NC version 29.0.X?

Hello,
there is only a dependency to NC28 in a recent version. current works >=29

@Rello Rello added this to the 5.3.0 milestone Feb 2, 2025
@Rello Rello added pending release part of the next release version and removed in progress development in progress labels Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource enhancement Feature request pending release part of the next release version
Projects
None yet
Development

No branches or pull requests

2 participants