garbled1 / homeassistant_ecowitt

Ecowitt Weather Station integration for homeassistant
Apache License 2.0
142 stars 70 forks source link

Wind sensors #41

Open Boss-man opened 3 years ago

Boss-man commented 3 years ago

Love this integration. Using it with my Ventus 830 weatherstation.

Would it be possible to get windspeed/windgust in ms units (meters per second)? And wind direction in letter format ('N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSV','SV','VSV','V','VNV','NV','NNV')?

I had a PHP file before using this integration. The code for wind direction is:

$degrees = @$weather_data['winddir'];
$directions = array('N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSV','SV','VSV','V','VNV','NV','NNV','N2');
$cardinal = $directions[round($degrees / 22.5)];
if($cardinal == 'N2'){$cardinal='N';}
@$weather_data['winddir_cardinal'] = $cardinal;

and to calculate ms for windspeed, it is just doing "windspeed_in_mph * 0.44704"

Would be nice if this would be added :)

garbled1 commented 3 years ago

I think it does this already? I think you just need to change your windspeed units from imperial to metric in the options for the integration. Or do I only have kph?

Boss-man commented 3 years ago

There is only kph..

garbled1 commented 3 years ago

Ahh.. so pyecowitt does calculate ms for windspeed, but the integration ignores it. In theory I would just need to make a new variable for that one, like IMPERIAL_MS or something, and then bring the values in.. I will take a look at how to wire this in..