Homekit using Celsius instead of Fahrenheit?

Hi-
I am trying to setup a Thermostat using openHAB 3.0.0 and the homekit integration. I have configured homekit to use Fahrenheit. I am also able to see the Thermostat in the home app but the temperature is wrong.

org.openhab.homekit:useFahrenheitTemperature=true

I turned on tracing and HomekitAccessoryUpdater is getting the temperature in Fahrenheit. But io.github.hapjava is converting it to Celsius before generating the following warning and sending the wrong value to the home app?

Item value is 95.0 F but io.github.hapjava is reporting 35.0 is out of range. Since 95.0 F == 35.0C it seems like it is getting converted before io.github.hapjava is reporting the warning.

2021-01-04 11:02:01.118 [TRACE] [kit.internal.HomekitAccessoryUpdater] - Received subscription request for BalboaIPUnit_CurrentTemperature (Type=NumberItem, State=95.0 °F, Label=Current Temperature, Category=temperature, Tags=[Temperature], Groups=[BalboaIPUnit]) / CurrentTemperature
2021-01-04 11:02:01.118 [TRACE] [kit.internal.HomekitAccessoryUpdater] - Adding subscription for BalboaIPUnit_CurrentTemperature (Type=NumberItem, State=95.0 °F, Label=Current Temperature, Category=temperature, Tags=[Temperature], Groups=[BalboaIPUnit]) / CurrentTemperature
2021-01-04 11:02:01.119 [TRACE] [impl.connections.SubscriptionManager] - Added subscription to class io.github.hapjava.characteristics.impl.thermostat.CurrentTemperatureCharacteristic for 1259166491
2021-01-04 11:02:01.119 [TRACE] [kit.internal.HomekitAccessoryUpdater] - Received subscription request for BalboaIPUnit_TargetTemperature (Type=NumberItem, State=95.0 °F, Label=Target Temperature, Category=temperature, Tags=[Temperature], Groups=[BalboaIPUnit]) / TargetTemperature
2021-01-04 11:02:01.119 [TRACE] [kit.internal.HomekitAccessoryUpdater] - Adding subscription for BalboaIPUnit_TargetTemperature (Type=NumberItem, State=95.0 °F, Label=Target Temperature, Category=temperature, Tags=[Temperature], Groups=[BalboaIPUnit]) / TargetTemperature
2021-01-04 11:02:01.119 [TRACE] [impl.connections.SubscriptionManager] - Added subscription to class io.github.hapjava.characteristics.impl.thermostat.TargetTemperatureCharacteristic for 1259166491
2021-01-04 11:02:01.120 [TRACE] [impl.connections.SubscriptionManager] - Added subscription to class io.github.hapjava.characteristics.impl.thermostat.TemperatureDisplayUnitCharacteristic for 1259166491

2021-01-04 11:02:01.514 [WARN ] [istics.impl.base.FloatCharacteristic] - Detected value out of range 35.0. Returning min value instead. Characteristic io.github.hapjava.characteristics.impl.thermostat.CurrentTemperatureCharacteristic@16ec8531
2021-01-04 11:02:01.515 [WARN ] [istics.impl.base.FloatCharacteristic] - Detected value out of range 35.0. Returning min value instead. Characteristic io.github.hapjava.characteristics.impl.thermostat.TargetTemperatureCharacteristic@45a3b3cc
2

items

Number:Temperature BalboaIPUnit_CurrentTemperature "Current Temperature" <temperature> (BalboaIPUnit) ["Temperature"] {channel="balboa:balboa-ip:cb364e02de:current-temperature",homekit="Thermostat.CurrentTemperature"  [minValue=80, maxValue=104]}
Number:Temperature BalboaIPUnit_TargetTemperature  "Target Temperature"  <temperature> (BalboaIPUnit) ["Temperature"] {channel="balboa:balboa-ip:cb364e02de:target-temperature",homekit="Thermostat.TargetTemperature" [minValue=80, maxValue=104]}

HomeKit internally works only with C (see screenshot below),
means OpenHAB would convert F->C and sends C to HomeKit, home app would then convert C->F for displaying purposes.

the minValue and maxValue are also in C.
can you try to remove min/maxValue?


@yfre Well that was it. I changed the min/max values to Celsius and its working… Thanks

Number:Temperature BalboaIPUnit_CurrentTemperature "Current Temperature" <temperature> (BalboaIPUnit) ["Temperature"] {channel="balboa:balboa-ip:cb364e02de:current-temperature",homekit="Thermostat.CurrentTemperature"  [minValue=26.7, maxValue=40.0]}
Number:Temperature BalboaIPUnit_TargetTemperature  "Target Temperature"  <temperature> (BalboaIPUnit) ["Temperature"] {channel="balboa:balboa-ip:cb364e02de:target-temperature",homekit="Thermostat.TargetTemperature" [minValue=26.7, maxValue=40.0]}
1 Like