fix: display BME280 ambient temperature in Fahrenheit, not Celsius

sensors.yaml formatted the raw BME280 reading directly with no unit
conversion, inconsistent with the dial setpoints and weather widget, which
are already Fahrenheit. Converts at the only point this sensor's value
reaches the UI (shared by every display variant); climate.yaml's internal
Celsius values are untouched since ESPHome's climate component always
operates in Celsius regardless of display unit.
This commit is contained in:
pyr0ball 2026-07-12 14:26:27 -07:00
parent 91f47be62a
commit a0734891ad
3 changed files with 12 additions and 8 deletions

View file

@ -222,7 +222,7 @@ lvgl:
text_font: montserrat_20 text_font: montserrat_20
- label: - label:
id: home_temp_label id: home_temp_label
text: "-- °C" text: "-- °F"
text_font: montserrat_48 text_font: montserrat_48
- button: - button:
align: bottom_left align: bottom_left
@ -334,7 +334,7 @@ lvgl:
widgets: widgets:
- label: - label:
id: sensors_temp_label id: sensors_temp_label
text: "Temperature: -- °C" text: "Temperature: -- °F"
text_font: montserrat_28 text_font: montserrat_28
- label: - label:
id: sensors_humidity_label id: sensors_humidity_label

View file

@ -23,7 +23,7 @@ lvgl:
widgets: widgets:
- label: - label:
id: home_temp_label id: home_temp_label
text: "-- °C" text: "-- °F"
text_font: montserrat_48 text_font: montserrat_48
- label: - label:
id: home_mode_label id: home_mode_label
@ -84,7 +84,7 @@ lvgl:
widgets: widgets:
- label: - label:
id: sensors_temp_label id: sensors_temp_label
text: "Temperature: -- °C" text: "Temperature: -- °F"
text_font: montserrat_28 text_font: montserrat_28
- label: - label:
id: sensors_humidity_label id: sensors_humidity_label

View file

@ -8,16 +8,20 @@ sensor:
id: bme280_temperature id: bme280_temperature
on_value: on_value:
then: then:
# BME280 reports Celsius natively; converted to Fahrenheit here (the only place
# this sensor's value reaches the UI) to match the dial setpoints and weather
# widget, which are already Fahrenheit. Not a dynamic HA unit-system sync — ESPHome
# has no standard entity exposing that setting — just a fixed display convention.
- lvgl.label.update: - lvgl.label.update:
id: home_temp_label id: home_temp_label
text: text:
format: "%.1f °C" format: "%.1f °F"
args: ["x"] args: ["x * 9.0f / 5.0f + 32.0f"]
- lvgl.label.update: - lvgl.label.update:
id: sensors_temp_label id: sensors_temp_label
text: text:
format: "Temperature: %.1f °C" format: "Temperature: %.1f °F"
args: ["x"] args: ["x * 9.0f / 5.0f + 32.0f"]
humidity: humidity:
name: "Ambient Humidity" name: "Ambient Humidity"
id: bme280_humidity id: bme280_humidity