aukedejong / lovelace-windrose-card

Home Assistant Lovelace Windrose Card
104 stars 3 forks source link

Doesn't handle a fixed Wind Direction #102

Open gedger opened 1 week ago

gedger commented 1 week ago

I'm in the middle of storm Bert and the wind has been coming from a steady southerly direction for hours now. Unfortunately the windrose stops updating as I think the "no change" detection logic is seeing the none changing 180 degree direction and assuming something is wrong? If this is then case I think the detection logic needs to also consider the other entities as well and only not update when none of the entities has changed in the reporting period?

Edit: Have confirmed this is the case as I have swapped the wind_dir sensor which hasn't changed with a wind_gust_direction sensor which has had a few transitions in the last 3 hours and the windrose card is now displaying .

aukedejong commented 1 week ago

I need to investigate this one.

The rose leaves should update on a time interval, config: refresh_interval, default every 5 minutes. If the wind direction is constant, I think we need to change the matching strategy.

The time-frame option could fix this. You can read more details about this in the readme.

aukedejong commented 1 week ago

I'm thinking about adding a new strategy that calculates the duration of every wind speed and direction combination in seconds. It will make the logic more complex and maybe to hungry for CPU power.

gedger commented 1 week ago

I’ve changed the matching strategy to time frame and that has given a good result, I’ll monitor over the next day as the conditions change.

gedger commented 6 days ago

Been thinking about this and it's a hard one to have a matching strategy that works under all circumstances.

Having a fixed wind direction with a variable speed is valid. Having a fixed speed, typically zero during lulls or below the measuring capability of the anemometer but with a variable direction is valid Having zero speed and none changing direction is valid too.

Needs a ponder and a read....

https://www.nrcs.usda.gov/wps/portal/wcc/home/climateSupport/windRoseResources/windRoseExample#:~:text=To%20calculate%20the%20typical%20amount,in%20April%2C%20or%20720%20hours.

https://dwikita-ichsana.medium.com/meteorology-101-how-to-plot-windrose-e42f068a1bca