Wind Speed/Direction in Base Pack/Weather Details Kompakt

Hello. I am trying to use/make sense of this Komponent. I have compared the wind speed/direction show on the Open Weathermap site for my primary location and these simply do not match what is shown in the browser. This persists even after I force a weather update. One would think that doing that would make things identical. But at least in this case, it does not. The info shown for all the other weather parameters seem about right.

What's up with this?

Also, if I purchase Pro, do I get to use other weather sources in the plugin for free? Or must I still subscribe to them?

Thanks

I believe I have figured out what is going wrong here. And maybe it is just a semantic thing whereby the author of this base pack komponent defines wind direction and how the arrow should point differently than the way I do. But I follow this definition for wind direction: "Wind direction is generally reported by the direction from which it originates." And I expect the arrow to point the way the air is moving. So wind from the south is labeled south and the arrow points to the north.

To accomplish this, I had to make some changes to the kode for the text field creating the direction label:

$if(
gv(info)=wind, if(
(wi(wdir) + 180 % 360) <= 45, South,
(wi(wdir) + 180 % 360) <= 135, West,
(wi(wdir) + 180 % 360) <= 225, North,
(wi(wdir) + 180 % 360) <= 315, East, South
+ -wi(wdir))
gv(info)=pressure, Pressure,
gv(info)=humidity, Humidity,
gv(info)=rain, wf(rain, 0) + "mm",
gv(info)=sunrise,Sunrise,
gv(info)=sunset,Sunset,
gv(info)=feelslike,Feels Like,
gv(info)=now,wi(cond),
gv(info)=today,wf(cond, 0)
)$

And to the kode to determine rotation for the arrow:

$(wi(wdir) + 180) % 360 $

This gives me what I expect. Your mileage may vary.

Or better still (and more accurate/complete), the kode for the text field:

$if(
gv(info)=wind, if(
(wi(wdir) >= 349 & wi(wdir) <= 10), N -wi(wdir),
(wi(wdir) >= 11 & wi(wdir) <= 32), NNE -wi(wdir),
(wi(wdir) >= 33 & wi(wdir) <= 55), NE -wi(wdir),
(wi(wdir) >= 56 & wi(wdir) <= 100), ENE -wi(wdir),
(wi(wdir) >= 101 & wi(wdir) <= 122), E -wi(wdir),
(wi(wdir) >= 123 & wi(wdir) <= 145), SE -wi(wdir),
(wi(wdir) >= 146 & wi(wdir) <= 168), SSE -wi(wdir),
(wi(wdir) >= 167 & wi(wdir) <= 191), S -wi(wdir),
(wi(wdir) >= 192 & wi(wdir) <= 213), SSW -wi(wdir),
(wi(wdir) >= 214 & wi(wdir) <= 236), SW -wi(wdir),
(wi(wdir) >= 237 & wi(wdir) <= 258), WSW -wi(wdir),
(wi(wdir) >= 259 & wi(wdir) <= 281), W -wi(wdir),
(wi(wdir) >= 282 & wi(wdir) <= 303), WNW -wi(wdir),
(wi(wdir) >= 304 & wi(wdir) <= 326), NW -wi(wdir),
(wi(wdir) >= 327 & wi(wdir) <= 348), NNW -wi(wdir),
Unknown -wi(wdir)),
gv(info)=pressure, Pressure,
gv(info)=humidity, Humidity,
gv(info)=rain, wf(rain, 0) + "mm",
gv(info)=sunrise,Sunrise,
gv(info)=sunset,Sunset,
gv(info)=feelslike,Feels Like,
gv(info)=now,wi(cond),
gv(info)=today,wf(cond, 0)
)$

And change the icon for wind from Arrow-long-up to Arrow-long-down and the the kode to determine rotation for the arrow:

$wi(wdir)$

Cheers

Sorry but:

(wi(wdir) >= 349 & wi(wdir) <= 10), N -wi(wdir)

should actually be:

(wi(wdir) >= 349 | wi(wdir) <= 10), N -wi(wdir)

Regards the inaccuracy of wind speeds from Open Weather (when imperial units are to be displayed)...
This is due to requests NOT being made for imperial units AND errors in conversion of metric units as demonstrated below:
1. in usa. so units auto should = imperial (same happens if units are explicitly set to imperial).
2. use open weather provider.
3. force update.
4. in logcat see api call specifies metric. this is done regardless of unit setting in app (auto or imperial).
https://api.openweathermap.org/data/2.5/forecast/daily?mode=json&lat=47.9572&lon=-122.2394&units=metric&lang=en&cnt=14&APPID=K00
the api allows &units=imperial but not being used it seems.
5. wind speed in metric (meters/sec) is returned as 1.79. 1.79 meters/sec = 4.00 mph. but KWLP shows 2!
6. I believe this is due to improper rounding or truncating of the metric result to an integer value of 1. 1 meter/sec = 2.23 mph which is then rounded or truncated to 2.
This kind of inaccuracy is just not acceptable. it is easy to get accurate results. just append &units=imperial instead of &units=metric and do no converting. round as needed after. This will reduce the workload on KLWP and give accurate results!

This works perfectly. Just what I've been looking for. The original code is just too inaccurate and like you say ends up being the opposite to what it should be. I also noticed that it would get stuck in south for days on end and then today, with no alteration to the code, the worded direction vanished altogether . Not entirely sure why.

Anyway this has all been sorted out by your code, so thank you very much for sharing 😁

So what is the correct code for wind speed in mph? I've been having to cope with kph for some time now 🤷🏻‍♂️

Any help very much appreciated 😁😁