tlskinneriv / awnet_local

Enables local support for Ambient Weather personal weather stations.
28 stars 5 forks source link

Issue with converting mph to km/h #13

Closed bsrishi closed 1 year ago

bsrishi commented 1 year ago

Hi @tlskinneriv,

The latest update works like a charm. But, however, just a couple of sensors are having issues with the unit conversion to km/h.

Wind Speed Max Gust

These both sensors, don't change to km/h even if you try changing in the UI.

Please assist.

Thanks, Rishi B S

tlskinneriv commented 1 year ago

What version of HA are you running? The latest update (v0.3.0) was tested with 2023.1. Where are you trying to change the unit?

Where I was able to change the value and validate that the conversion occurred was in the entity settings UI (click entity in UI, click the "Settings" tab, then change "Unit of Measurement" to "km/h"). On the next state update the value was converted.

Screenshot of settings page:

image

Screenshot of entity with changed unit in Lovelace:

image

That particular value is shown for when the device sent exactly 1.0 mph as the value

bsrishi commented 1 year ago

My bad, forgot to remove the code in customize.yaml, the one I had a seperate sensor added and unit of measurement defined.

Kudos. Working great

bsrishi commented 1 year ago

Hourly Rain rate alone comes only in "in/h". Irrespective of whatever value I convert.

Please check this

tlskinneriv commented 1 year ago

Looks like there may not be a built-in conversion for that unit in HA currently. It appears that the UnitOfVolumetricFlux unit enum is not currently covered in HA unit_system.py. Will take a look at this later and see what can be done.

tlskinneriv commented 1 year ago

Looks like both UnitOfVolumetricFlux and UnitOfIrradiance are the units that are unable to be converted at this time automatically via HA.

bsrishi commented 1 year ago

Oh okay ! And just noticed that Feels like temperature is missing for the indoor and additionally added units but available on AWN.

Also, lightning detected in "Distance" missing

tlskinneriv commented 1 year ago

Please open a new feature request for these extra sensors. Thanks!

tlskinneriv commented 1 year ago

Closing this issue since UnitOfVolumetricFlux and UnitOfIrradiance are not supporting conversion in HA yet. Not something to be done in this integration and will work when HA supports it. Looks like UnitOfVolumetricFlux will be supported in 2023.3. I see no implementation of conversion for UnitOfIrradiance in unit_conversion.py yet, which would be required to use it in unit_system.py.