home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.66k stars 29.95k forks source link

Ambient weather sensor not handling temperature units correctly #20665

Closed mbardeen closed 5 years ago

mbardeen commented 5 years ago

Home Assistant release with the issue:

0.86.3

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

Docker Component/platform:

https://www.home-assistant.io/components/sensor.ambient_station/

Description of problem: Home Assistant is setup with 'unit_system: metric', the data pulled from ambientweather.net is in Fahrenheit, but the unit listed on the temperature sensor data is °C. This inhibits the automatic conversion of units within the Home Assistant system.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


homeassistant:
  unit_system: metric

  - platform: ambient_station
    api_key: <REDACTED>
    app_key: <REDACTED>
    monitored_conditions:    
      - battout
      - tempf
      - tempinf
      - humidity
      - windspeedmph
      - winddir
      - humidityin
      - dailyrainin
      - baromrelin
      - uv
      - solarradiation
      - dewPoint
      - feelsLike

Traceback (if applicable):

Additional information:

mbardeen commented 5 years ago

Recasting the temperature variables as Fahrenheit with a template sensor solves this nicely, but is annoying to have to do for all sensors. Also, this screws up the history graph. The unit listed is Fahrenheit, but the values are converted to Celsius.


sensor:
      ambweath_indoor_temp:
        friendly_name: "Indoor Temperature"
        unit_of_measurement: "°F"
        value_template: '{{ states.sensor.inside_temp.state }}'
bachya commented 5 years ago

I recently re-architected the component in https://github.com/home-assistant/home-assistant/pull/20332; I'll take a look at whether this is still an issue and if so, get a fix in ASAP.