Closed mtl010957 closed 3 years ago
climate source climate issues climate recent changes (message by IssueLinks)
Digging a bit deeper, I find that all temperature units are converted internally to Celsius, so I think the easy way to handle this is to just send "temp_unit:" "C"
in the discovery message always, there is no need to expose it to allow any other value. I will submit a PR.
Operating environment/Installation (Hass.io/Docker/pip/etc.):
Both Hass.io and Ubuntu pip install
ESP (ESP32/ESP8266, Board/Sonoff):
Generic D1 Mini
ESPHome version (latest production, beta, dev branch)
dev
Affected component:
Climate Core
Description of problem: In my case, HA is setup with Imperial units, making the MQTT Thermostat automatically display in Fahrenheit temperature units. I am creating a Bang-Bang temperature controller with a DS18B20 sensor, which is reading temperature in Celsius units. I need to make HA know that the sensor is in Celsius so it can automatically convert to Fahrenheit and display correctly. I am using MQTT, so I found the Bang-Bang controller is being represented in HA by an MQTT HVAC component. That component can accept a variable called
temperature_unit
with a value ofC
orF
.Problem-relevant YAML-configuration entries:
Logs (if applicable):
Additional information and things you've tried: Adding
"temperature_unit": "C"
to the discovery message fixes the problem. I will work on a PR to add a configuration variable to the Climate Corevisual:
section (similar totemperature_step:
), which seems to be the proper way to handle this. Please let me know if there is some better approach.