briis / hass-weatherflow2mqtt

WeatherFlow to MQTT for Home Assistant. Use UDP to get local weather data in to Home Assistant using MQTT Discovery
MIT License
129 stars 29 forks source link

visibility unit shows nmi? #235

Open hmjgriffon1 opened 1 year ago

hmjgriffon1 commented 1 year ago

Home Assistant Version?

2023.8.4

Add-On or Self Hosted?

HA Supervised (Add-On)

Weatherflow2MQTT version?

3.2.0

What happened?

I am getting an error in my log that I don't think I saw before the update to 3.2.0 of the addon. I cannot find a way to change the unit of measurement for visibility myself or if I should even need to.

Relevant log output

Logger: homeassistant.components.sensor
Source: components/sensor/__init__.py:659
Integration: Sensor (documentation, issues)
First occurred: 5:35:42 PM (1 occurrences)
Last logged: 5:35:42 PM

Entity sensor.tempest_st_00113901_visibility (<class 'homeassistant.components.mqtt.sensor.MqttSensor'>) is using native unit of measurement 'nmi' which is not a valid unit for the device class ('distance') it is using; expected one of ['mi', 'in', 'mm', 'ft', 'yd', 'km', 'cm', 'm']; Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+mqtt%22
GlennGoddard commented 1 year ago

That probably was a home assistant change. When I get a chance, I will change the units km and mi from nautical mile. It may actually be in miles but did not get the units updated. I know I based the calculation off a NOAA survey of visibility compared to humidity and air pressure (I did not utilize the air pressure portion); then later I took into account station elevation for visibility.

hmjgriffon1 commented 1 year ago

That probably was a home assistant change. When I get a chance, I will change the units km and mi from nautical mile. It may actually be in miles but did not get the units updated. I know I based the calculation off a NOAA survey of visibility compared to humidity and air pressure (I did not utilize the air pressure portion); then later I took into account station elevation for visibility.

Awesome, thanks man, I don't see a problem with nautical miles myself and yeah it might actually be in miles but I guess HA doesn't like it haha.

hmjgriffon1 commented 1 year ago

How's it going Glenn? Just wondering if there is anything else I can do to help. :)

GlennGoddard commented 1 year ago

It is returning the value at km or mi; I missed updating the imperial unit from nautical mile to mile. The value is miles thou. I should have a PR to fix it soon.

hmjgriffon1 commented 1 year ago

Awesome.

On Fri, Sep 8, 2023 at 3:59 PM Glenn @.***> wrote:

It is returning the value at km or mi; I missed updating the imperial unit from nautical mile to mile. The value is miles thou. I should have a PR to fix it soon.

— Reply to this email directly, view it on GitHub https://github.com/briis/hass-weatherflow2mqtt/issues/235#issuecomment-1712160454, or unsubscribe https://github.com/notifications/unsubscribe-auth/A47NQ2BABEJ55PF3PV623B3XZN2JBANCNFSM6AAAAAA4DTTZVQ . You are receiving this because you authored the thread.Message ID: @.***>

GlennGoddard commented 1 year ago

PR is in @briis I updated the imperial unit of measurement for visibility. It is in miles, but the unit of measure never got updated before.