werthdavid / homebridge-weather

OpenWeatherMap Plugin for Homebridge
MIT License
104 stars 7 forks source link

Windspeed is still broken #27

Closed thoschworks closed 4 years ago

thoschworks commented 4 years ago

As mentioned in issue #22 (in this comment) winspeed is (still) broken.

if (!error && value != null {humidityService.setCharacteristic(Characteristic.CurrentRelativeHumidity, value);

In version 1.12.1 the broken line 111 is still unchanged.

Regards

Thomas

werthdavid commented 4 years ago

Am I this stupid? Will fix it tmrw!

werthdavid commented 4 years ago

Ok so the Code is correct. The value in line 109 is taken from getStateWindspeed It is published as Humidity-sensor. Does that cause any problems? I don't know if there is a dedicated wind-speed sensor

thoschworks commented 4 years ago

First I was confused cause it is shown as humid sensor. But if this is intended...

At the beginning I got zero values. Now I get - sometimes* - values, but I don't know how to interpret a humidity windspeed of 91%. 🤔

werthdavid commented 4 years ago

Okay.. have you taken a look at the OWM Api on how to interpret the values? The (metric) unit is meter/second. So 91% would be 91meter/second I would say. Does that make sense? Any suggestions on what would fit more than humidity? Here is a list of available services besides humidity: https://github.com/KhaosT/HAP-NodeJS/blob/master/src/lib/Service.ts

Problem with humidity is that it's maximum value is 100 of course. But what do we take from values more than 100meter/sec?

thoschworks commented 4 years ago

No, 91m/s doesn’t make any sense. 12 Beaufort, the highest value of the Beaufort scale, is defined by a windspeed of more that 32.92 m/s.

Next weekend I will take a look into the documentation.

werthdavid commented 4 years ago

Okay I see.. OWM API states the following:

wind.speed Wind speed. Unit Default: meter/sec, Metric: meter/sec, Imperial: miles/hour.

thoschworks commented 4 years ago

I looked into the service-definitions and it looks like HomeKit doesn't know the strange concept of air-motion called "wind". 👿

As mentioned a windspeed of 91 doesn't make sense in these days. Perhaps a decade later. 😈

I decided to ignore the windspeed. 🤷‍♂️