PeteRager / lennoxs30

Home Assistant Lennox S40 / S30 / E30 / M30 integration
MIT License
88 stars 13 forks source link

C vs F units #345

Open graveland opened 4 hours ago

graveland commented 4 hours ago

Is your feature request related to a problem? Please describe. I'm in Canada and I prefer metric values. The reported temperatures are in C, but all the configuration values are F. For example, right now it says the outdoor temperature is 4.5°C, but upstairs_par_Aux_Heating_Activation_Threshold is asking for °F.

Describe the solution you'd like This integration determines the display values by looking at HA's config.units, and sets is_metric. It should use that for the settings input values as well as the display values.

Details of your HVAC system (e.g heat pump, gas furnace, boiler, AC, external ventilation) Two S40's, one upstairs and one downstairs, both with the same issue.

Additional context HA version 2024.10.3, lennoxs30 version 2024.8.0

PeteRager commented 4 hours ago

That doesn't seem optimal.

Unlike thermostat temperature and outdoor temperature which Lennox sends in both metric and Celsius.

Lennox is only sending the values in F for parameters and diagnostics. Example for one of parameters

https://github.com/PeteRager/lennoxs30api/blob/9f9f92504ed972f6c147aa7416ea7dbc3740830e/tests/messages/equipments_lcc_singlesetpoint.json#L2341

In there are the valid ranges and the step size which are valid.

Are your equipment diagnostic values being translated to C?

Here's an example:

https://github.com/PeteRager/lennoxs30api/blob/9f9f92504ed972f6c147aa7416ea7dbc3740830e/tests/messages/equipments_lcc_singlesetpoint.json#L5180

I think HA is supposed to translate values transparently to the correct units. Perhaps this isn't working for input_numbers.

If you could turn on message logging and post some snippets (or the entire message log) of a parameter and a diagnostic that are temperatures, then we can verify what Lennox is sending.

PeteRager commented 2 hours ago

I think the issue is the device_class is not being set for the number entity and HA will only do the units conversion if the device class indicates its a temperature.

https://github.com/home-assistant/core/blob/4cbac3a864e0724ad353aa3f4fc159cc8f402ae8/homeassistant/components/number/__init__.py#L380-L385