Homekit temperature sensor won't go below 10°C

Found that out earlier on when adding other items to homekit with the metadata tags. Until now I solved that by restarting the openhab service, when restarting the items then get added to homekit. Unfortunately this didn’t work for this.

I got the exact same issue. Temp stays at 10°C with logged error „ Detected value out of range“.
So the only solution to show negative temperatures in HomeKit is to update to OH3?

yes, OH2 does not support negative values in items xml.
other tried to set negative values from karaf or via REST API without success.

Ok… then I will wait a few more weeks or months and update to OH3.
So when the next winter will come I am prepared to show negative values :slight_smile:

Edit: Maybe you can help how I can decrease the min Temp to 0°C via Rest api? This is better than 10°C.
Thanks

Is this correct?
Metadata [key=homekit:Wetterdaten_temp, value=TemperatureSensor, configuration=[minValue=0.0, maxValue=100.0]]

i don’t use REST API so cannot help here. i use only the items text file configuration.
but your metadata looks correct.
you would need to reload the home app the get new value sync with home app

Reload the home app like a refresh/reopen or like a uninstall and reinstall on phone?
Or a complete new pairing?

Thank you!

Just close the home app, wait a little and open again

Also adding, removing or renaming of HomeKit items in openhab will force home app to reload all accessories

A change of metadata alone does not trigger the accessories reload . So, it must be item name change or complete removal/add of items.

Home app always reload all accessories, it is enough to change one item to reload all.

Ok… removed an another item and added it again.
Everything got a refresh. But the 10°C is still there :frowning:
Also the log in OH still warns me:“ [WARN ] [istics.impl.base.FloatCharacteristic] - Detected value out of range 2.8. Returning min value instead. Characteristic io.github.hapjava.characteristics.impl.thermostat.CurrentTemperatureCharacteristic@935de3“

Looks like I have to add this item via file and not via paperUi. (Never done this before, everything else is working fine with gui created items)

It is also strange that the item get removed from HomeKit when I remove the HomeKit Tag. With only the Metadata for HomeKit the item will not be visible in HomeKit. When I add the tag it is visible in HomeKit again.
So maybe there is also a problem with my Metadata for HomeKit.

hi,

i just stumbled on the same problem, but i did not find a way to paste the config in OH3. when inputting and saving, when i come back, the config is gone. what is the format to use for OH3 “code” view ?

Hey,
Just add the min and max value at the items state description via meta data and it should work fine.

i gave this a try, but it did not seemed to work. temperature still shows as 10degrees. let’s just wait for the spring :slight_smile:

After you changed the min max values try to delete and add the item again to HomeKit. Then Homekit will check the new values.

i put the min and max in all my temperature sensors (tried different value, like -20 to 60, or 0 to 100 for different sensors). i deleted the bridge in the Home application on my phone, and added it again. event restarted openhab.
temperatures as still locked in the range 10 to 38 degrees.

This is really strange. Adding the min value (for me -30) changed the behavior of HomeKit and I am able to see temperatures with negative values.

this is indeed strange. are you sure you have not added “minValue” as metadata in homekit namespace?

this is my state description for the item:

value: " "
config:
max: “100”
min: “0”

and temperature are still clipped in the range 10 - 38.

i tried to add meta data min/max_value in homekit namespace. but then i get:
2020-12-30 21:10:27.303 [WARN ] [istics.impl.base.FloatCharacteristic] - Detected value out of range 50.1. Returning max value instead. Characteristic io.github.hapjava.characteristics.impl.thermostat.CurrentTemperatureCharacteristic@73c16
(i did not get this message until i set the homekit meta data min/max_value)

given the range i gave is 0 to 100… i tried to give 1000 as max. same result. that is odd.

also, the type of meta data i used is not thermostat, but rather TemperatureSensor.CurrentTemperature.

can you try to add this metadata

value: " "
config:
    minValue: 0

i.e. start with minValue only

1 Like

i have this now:

value: TemperatureSensor.CurrentTemperature
config:
minValue: 0

edit: okay, that seems to work! Thanks! But then the next problem is that the upper limit, for the sensors i use for my heater etc, are limited to 38 degrees.

edit2: adding in homekit meta data, minValue or maxValue in the config, worked also for fixing temperatures above 38!

2 Likes

I can confirm that temperatures below 0°C are working now with openHAB3.
e.g.:

Group gNetatmo_Outdoor "Balkon Temperatur" { homekit="TemperatureSensor" }
Number Netatmo_Outdoor_Temperature "Balkon Temperatur" <temperature> (gNetatmo_Outdoor) { homekit="TemperatureSensor.CurrentTemperature" [minValue=-20, maxValue=60], channel = "netatmo:NAModule1:home:outside:Temperature" }

After removing/ adding these two items a test temperature of -10°C was shown in the Home app.

3 Likes

I too was having a similar issue with my temperature not displaying correctly. In my case my thermostat (Nest) is set to read in Fahrenheit as well as Openhab’s default temperature, and I changed the settings in Home App to Fahrenheit as well. but I just couldn’t get the temperature to display correctly.

I Tried using the “Use Fahrenheit Temperature” Option inside the homekit add-on settings, only seem to make things worse (Number more incorrect). As well as it seems when Saving the settings for the homekit add-on the homekit.config file sometimes loses some of the saved settings. In my case I would typically lose the user or mac address or everything from the .config file forcing me to remove the bridge from homekit and start over reading openhab3 as a bridge and setting up each device (I have over 50 so its a pain). So for the moment it appears I will avoid using the save feature inside homekit add-on’s settings, and instead start manually editing the homekit.config (found on my system (macOS) in $OPENHAB_USERDATA/config/org/openhab/).

It appears that homekit requires the number to be sent in Celsius and supposedly the binding is to convert Fahrenheit to Celsius automaticly but somewhere in the middle it appears it fails to compute properly. (Best Guess) Seems to me like the temperature in F first being tested to make sure its within the bounds of reasonable temperature range but that range is being provided by HomeKit not OpenHab thus we are being given a range of for Celsius temperatures (something like minValue=10 maxValue=28 not 100% what exactly that is by default), when that is done it is found to be out of bounds and clipped down or up depending on offense. Then the binding converts the number to Celsius (Which is now the wrong temperature) and sends that to Homekit as the Celsius temperature of the thermostat. Which in my case Homekit then reconverts it back to Fahrenheit and is still the wrong value obviously.

I was able to work around this by doing the following:

  1. I created additional items for each temperature value I am sending to HomeKit (set_point, current_temperature etc.).

  2. Install the Javascript Transformation Add-on (if not already done)

  3. Create a javascript file containing JavaScript code to convert from F to C. create a new file in the $OPENHAB_CONF/transform/ directory such as convertToC.js

  4. Inside the file convertToC.js

  (function(i) {
    var array = i.split(" ");
    return(((parseFloat(array[0])-32)*(5/9)).toFixed(1));
  })(input)
  1. I linked those items to the channels for my things that are displayed in Fahrenheit (I now have 2 links per channel because I still want to use the Fahrenheit Values since everything else is in Fahrenheit and used in other rules etc. This item is only used to facilitate the temperature state to HomeKit).

  2. Finally I added the proper HomeKit Metadata to each of the new items.

Note This is correctly working with the “Use Fahrenheit Temperature” Option inside the homekit add-on settings = false.

And now it appears most of not all of the functions for thermostats in HomeKit are working with my Nest Thermostat that is connected via the HomeKit Binding for Openhab3. I can now use Siri to control my Nests, and receive and display the correct temperature values from other temperature sensors as well.