Timzone issues in custom parser
I have created a custom parser, and I am adding the data in UTC time (also tried rmCurrentTimestamp() with the same results), but in the weather graph it is showing incorrectly (looks like the diff between timezone and UTC time). I wanted to confirm if this is still an issue in the graphing per the below thread or do I need to do something differently?
-
Nicholas can you please confirm if the data added with addValue should use a UTC or local timestamp? As George mentioned above I've been adding it with UTC timestamps but the the data I get back from /parser/{uid}/data doesn't seem right. Eg:
I add the forecast for 2019-02-03 using UTC timestamp 2019-02-02 13:00:00Z (which is 2019-02-03 00:00:00 local). The API shows this:
"day": "2019-02-02 00:00:00",
"hourlyValues": [
{
"hour": "2019-02-02 13:00:00",
"temperature": null,
"minTemperature": 23,
"maxTemperature": 37,
...I.e. the "hour" is correct (if that's UTC) but the "day" is wrong even in UTC.
-
Ok I guess the "day" above is just a bin, but after looking at the parser and mixer output from the API something still isn't right.
The mixer output for the above is:
{
"day": "2019-02-02 00:00:00",
...
"minTemp": 23,
"maxTemp": 37,
...I.e. there is no "hour" entry in the mixer so regardless of if the above "day" stamp is taken as UTC or local it's wrong. 37 is the forecast for 2019-02-03 so if "day" in the mixer is UTC then it's 13 hours behind and if it's local it's 24 hours behind.
What's going on here?
-
Thanks Nicholas, but it appears the mixer is taking the wrong day value. 2019-02-02 13:00:00 UTC is not the forecast for 2019-02-02, it's the forecast for 2019-02-03 (local time). It looks like the mixer is working with UTC days by mistake somewhere.
Truncating the datetime object to 00:00 would work for negative timezones such as North America but not positive time zones.
-
I'm not using rmCurrentTimestamp() no. The timestamp used to add the data is the timestamp of the data from the BoM xml feed (E.g. 2019-02-02 13:00:00 UTC). Then yes when I get the mixer data from the API (using Postman) it's showing 2019-02-02 00:00:00 (which appears to be UTC) when it should be 2019-02-03 00:00:00.
My current timezone is +11 (in DST at the moment).
-
Still an issue running latest firmware
Firmware version
4.0.1129Web UI Version
1.14I have raised on github, happy to take some direction here too
https://github.com/sprinkler/rainmachine-web-ui/issues/351
also a call to the parser below via api/4/parser/17/data?format showing the data is fine, its just the graph that is wrong
Note this is not the Ausstralia BOM from the library - i am working on getting a completely free Aus parser working (WillyWeather definitely has better data but)
Please sign in to leave a comment.
Comments
12 comments