Skip to content

Conversation

@Pinkcommando
Copy link

@Pinkcommando Pinkcommando commented Nov 30, 2025

Summary

Fixes temperature display when Home Assistant is configured to use Fahrenheit. Previously, the component displayed
Celsius values with the °F symbol, causing confusion for users in Fahrenheit-using regions.

Relevant issue: #1042

Changes

  • Added automatic temperature unit conversion based on Home Assistant's configured unit
  • Auto-detects device temperature unit from JSON (Celsius or Fahrenheit)
  • Devices with minTemperature > 40 are inferred as Fahrenheit (e.g., General Electric models)
  • Future device files can explicitly specify "temperatureUnit": "°F" or "°C"

Implementation Details

  • Device temperatures (min/max/target from JSON) are stored in the device's native unit
  • Display temperatures are converted to Home Assistant's configured unit
  • User input is converted back to device unit before sending IR commands
  • Temperature sensor readings remain unconverted (already in HA's configured unit)

Supported Scenarios

Device Unit HA Config Behavior
Celsius Celsius No conversion (existing behavior)
Celsius Fahrenheit Converts C → F for display
Fahrenheit Fahrenheit No conversion
Fahrenheit Celsius Converts F → C for display

Added temperature unit conversion methods for display and device temperatures.
@Pinkcommando Pinkcommando changed the title Implement temperature unit conversion methods Fix temperature unit conversion for Fahrenheit display Nov 30, 2025
@adouglass
Copy link

When testing this change, I've noticed that restarting Home Assistant results in the initial set temperature of my climate entities to be unrealistically high (e.g. 167 degrees Fahrenheit).

My device uses code 2100 which has a minTemperature of 17 (Celsius). My Home Assistant is running in Imperial units.

@Pinkcommando
Copy link
Author

When testing this change, I've noticed that restarting Home Assistant results in the initial set temperature of my climate entities to be unrealistically high (e.g. 167 degrees Fahrenheit).

My device uses code 2100 which has a minTemperature of 17 (Celsius). My Home Assistant is running in Imperial units.

I pushed a potential fix for your issue, please let me know if this solves your problem.

Copy link

@adouglass adouglass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the issue I had found when HA starts and restores the previous state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants