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

OneCall updates #256

Closed
mrmike8887 opened this issue May 19, 2024 · 5 comments
Closed

OneCall updates #256

mrmike8887 opened this issue May 19, 2024 · 5 comments

Comments

@mrmike8887
Copy link

I did try to update to the new onecall API, but received all 0's for a reply. I did decipher some of the data coming back, and making changed to common.h for this, but I am not proficient enough to finish. here is what I have done so far:
under
" if (Type == "weather") { "
the roots had to change, some from main to current, or some root had to be added
under the forecast, change root["list"] to root["hourly"]
I am having issues how to deal with forecasts with the new api

common.txt

@mrmike8887
Copy link
Author

mrmike8887 commented May 19, 2024

I now get most responses on the serial monitor with the exception of rain. Cleaned up and deleted my api key. Ihaven't tried this on a display, yet
common.txt

@G6EJD
Copy link
Owner

G6EJD commented May 20, 2024

Well done, all that looks OK.
Rain is in the API, but if there's none it's omitted, is that what your seeing.
The differences aren't that great.

@mrmike8887
Copy link
Author

It was raining most of the day yesterday. I wasn't getting any reading on the serial monitor.
Attached is a text file of the different responses. It's weird
debug.txt

@G6EJD
Copy link
Owner

G6EJD commented May 20, 2024

For some reason the json library decoder isn’t always converting some variables to type float, so this accounts for the 0 values, it’s almost certainly choosing type integers instead of floats. I’ll look at the json source code to see what’s happening.

@G6EJD
Copy link
Owner

G6EJD commented May 22, 2024

You’ll need to use the directives .as(); to convert some of the json data to the correct variable type. So for the two errant rain and s is types use .as(); or .as();

I see the OneCall does not provide hourly high/low temperatures and only 48-hours of the rest, plus daily values are limited to 7-days, so actually quite a lot of change and a lot has to change. I’m still thinking through how to make the transition as easy as possible.
also, it’s an https / secure client call, so not as straightforward anymore. Plus I’m seeing memory is very short now because the json response is huge to get the same data, not that smart a change really, I think they were too obsessed with mirroring the DarkSky API, then DarkSky was purchased by Apple snd access was removed from their API, so it turned out to be a somewhat futile change with no apparent benefit!

@G6EJD G6EJD closed this as completed Oct 11, 2024
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

2 participants