iobroker-community-adapters / ioBroker.weatherunderground

ioBroker Adapter to load weather forecast from Weather Underground
MIT License
18 stars 12 forks source link

(null) values in forecast for current day / day 0 #250

Open schlaubstar opened 4 months ago

schlaubstar commented 4 months ago

Describe the bug
In the objects view in IoBroker (weatherunderground.0.forecast.0d.tempMax) but also other data points I frequently have "null" as value. This only happens for day 0 (1-5 are ok) although the response of the API looks correct.

To Reproduce
Steps to reproduce the behavior: Install Adapter, enter Data (in my case StationID IRHEIN152), retrieve data, and look at the IoBroker Objects.

Expected behavior
that e.g.: weatherunderground.0.forecast.0d.tempMax contains the right "maximum temperature" for the current day.

Screenshots & Logfiles
How it looks in IoBroker: IoB_nullvaluesOnDay0

debug_logOfResults.txt

Looking at the pretty printed data of the log reveals, that some, day0 specific arrays (cloudCover, dayOrNight, daypartName etc.) seem to return null value for day 0, but contain data for the other days. However: Min/Max Temperature values are available for every day.

Versions:

Additional context
Add any other context about the problem here.

Apollon77 commented 4 months ago

Please have a look ... Does it directly happen in the morning? There ere cases where data got null when the time was "gone" on that day? Please have an eye on it when it is/gets null and such. In fact it is about "starting a certain time the current day is no longer "a forecast" because the time reached that day

schlaubstar commented 4 months ago

I just enabled logging to the database for the values of 0d and 1d so I can give you some details but currently (at 9:10PM) I also have a null value for weatherunderground.0.forecast.0d.tempMax

bikejoco commented 3 months ago

Same Problem

schlaubstar commented 3 months ago

@bikejoco Although I assume a portion of this issue should be handled by the adapter I found a solution: I logged the raw data provided by the station I had selected to compare the values from weatherunderground and what the adapter shows and found out: the issue is the station. So I did query other stations nearby and selected one a little further away, where the operator was either a high-school, an official authority or a local airport and the issue never re-occured. In the meantime, I assume that smaller, in particular private stations do not reliably deliver all values. This could be a suggestion to either weather underground to give you a "station reliability rating" or to the adapter, to at least indicate something like "the station you selected seems to not reliably deliver measurements for all data points etc." Try selecting another station nearby operated by someone "reliable" and check the results.

mcm1957 commented 3 months ago

@schlaubstar Thanks for this info. Do you have eventually still an exmple of the data showing the differnece / missing data? If not - well you infomation is a good info to direct the investigations.

schlaubstar commented 3 months ago

@bikejoco I have to appologize. It is an issue in the adapter somehow. It did not occur after I switched the station but today it is there and reproducable

My comparison: To tribute the home of IoBroker I selected IKARLS137 as station, and used my API key. Attached you find the (already beautified but 100%) JSON Response of Weather underground.

JSON_Responseof_Wu.txt

The interesting section in the JSON response is: " "daily_forecast": { "calendarDayTemperatureMax": [ 27, 29, 34, 24, 24, 27 ], "calendarDayTemperatureMin": [ 11, 13, 15, 14, 12, 12 ],"

So it is obvious that valid data was submitted for temperature Max and temperature Min for the next days. But as you can clearly see in IoBroker there are two errors :

TempMin is 13°C and TempMax is (null), which are actually two errors. day(0) is today. So it actually should be TempMin = 11°C and TempMax = 27°C according to the response

To me it seems that TempMin is taken from tomorrow (and should be in day (1) and not day(0)) and there are complete touples of data (TempMin and TempMax) for each day in the prediction.

2024-08-22 22_24_41-objects - iobroker — Mozilla Firefox

@Apollon77 : Could you please be so kind and have a look at this ? Maybe it's just a a shift in the allocation of days because at least all subsequent days have valid TempMin and TempMax values, except for day (0) ... and to my understanding of the response from wu I'd assume that it should look like: TempMin Today = 11, TempMax Today = 27 TempMin Tomorrow = 13, TempMax Tomorrow = 29 etc.