Calculating Circular Mean for Wind Direction - JS Script

Wow - Thanks so much. That is so much easier to follow.

I think I will look to get my system to 5.1M4 when that comes out shortly, and then set aside some time to fully test it on there

Yeah - I should have known that!! I picked up that issue when I was trying to write some completely bogus (but kinda working) code to turn the target position, into timed relay actuation’s for the linear motor, and kept on running into that issue (And that was between runs of the code), so I started using the cache instead (Not applicable here, as we just using in the same execution run of the script). That was before I found out it was a complete waste of time, as there was pre-existing functionality in OpenHAB, which put my code in the bin

Good tip - I’m not a developer in my day job (I probably didn’t need to tell you that, I’m sure you already figured that one out with once glance at my code!!) , so slightly a fish out of water here. But any feedback like this on coding standards are appreciated

I was struggling to come up with a meaningful answer, which didn’t make me look like a complete idiot. Couldn’t really find a good one!! I think I was trying to round it to 0.5 increments and found an article which suggested this. Probably not the same article, but similar context:

https://stackoverflow.com/a/6138087

Thanks again