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

Todays Info #25

Closed
cgmckeever opened this issue Feb 19, 2022 · 2 comments
Closed

Todays Info #25

cgmckeever opened this issue Feb 19, 2022 · 2 comments

Comments

@cgmckeever
Copy link

cgmckeever commented Feb 19, 2022

Im probably reading this wrong, you use the first daily element to define today

owmDaily = owm?.daily != null ? (List)owm.daily : null
BigDecimal t_p0 = (owmDaily==null || !owmDaily[0]?.rain ? 0.00 : owmDaily[0].rain.toBigDecimal()) + (owmDaily==null || !owmDaily[0]?.snow ? 0.00 : owmDaily[0].snow.toBigDecimal())
myUpdData('rainToday', (Math.round((myGetData(sRMETR) == 'in' ? t_p0 * 0.03937008 : t_p0) * mult_r) / mult_r).toString())

But it appears that the first element is actually tomorrow (for posterity, this was written on Sat Feb 19th)

"daily": [
{
"dt": 1645336800,
"sunrise": 1645318743,
"sunset": 1645357667,
"moonrise": 1645371900,
"moonset": 1645325640,
"moon_phase": 0.62,

where dt: 1645336800 is Sunday, February 20, 2022 https://www.epochconverter.com/
I suck with date math, so I could very well be wrong here

request URL

https://api.openweathermap.org/data/2.5/onecall?lat=19.8968&lon=155.5828&exclude=minutely,hourly&mode=json&units=imperial&appid=API_KEY
@cgmckeever
Copy link
Author

more info

current has todays timestamp

"current": {
"dt": 1645295216,

dt": 1645295216 is Saturday, February 19, 2022

@cgmckeever
Copy link
Author

Digging into this more, it looks like that timestamp is the time of end-of-day so it is in fact today

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

1 participant