gysmo38 / mitsubishi2MQTT

Mitsubishi to MQTT with ESP8266 module
GNU Lesser General Public License v2.1
393 stars 141 forks source link

No support for Fahrenheit, which is needed for locales who use imperial scale #22

Closed shampeon closed 4 years ago

shampeon commented 4 years ago

Unlike an HA custom component, which can set the display scale to follow the unit system of HA, an autodiscovered MQTT hvac device can't be configured to use Fahrenheit to display and set the temperature. HA assumes that all devices follow the scale set if you set unit_system in your configuration.

homeassistant:
  unit_system: imperial

Since I live in the US, installing mistsubishi2MQTT displays the climate component in HA as if the values were Fahrenheit when they are actually Celsius.

Screen Shot 2019-12-31 at 3 50 34 PM

The code assumes the use of metric scale, probably since the SwiCago library and the Mitsubishi units themselves use Celsius internally.

The sketch should have a configurable option for displaying and processing Fahrenheit values and converting them to and from Celsius when interacting with the SwiCago library.

shampeon commented 4 years ago

Added https://github.com/gysmo38/mitsubishi2MQTT/pull/23 to fix this issue.

shampeon commented 4 years ago

Fixed with #23.

shampeon commented 4 years ago

@gysmo38 Your latest commit (https://github.com/gysmo38/mitsubishi2MQTT/commit/6391f332991ab0dbc1afa11b935481d7e826546e) overwrote all the Fahrenheit code you merged in with #23.

gysmo38 commented 4 years ago

Ok sorry about that. I maybe made a mistake. I will put your code again.

gysmo38 commented 4 years ago

I push a new commit with your Fahrenheit code :) Hope it is ok now.

shampeon commented 4 years ago

Ok, thanks.

shampeon commented 4 years ago

Spoke too soon, you forgot the HA config templates that were altered to support F. Fixed in #24.

gysmo38 commented 4 years ago

Thank you for your PR. I have the idea to add a Unit menu under Setup. In this page we will able to choose between metrecis and fahrenheit.