Running OH3 (under OpenHabian), and after having some issues migrating from 2.x to 3.x, I’m just now starting to dig into the new structure for HomeKit metadata associations.
Back on OH2, it was done with Tags, and sadly, with the upgrade to 3, that didn’t convert/carryover to Homekit in OH3, which wiped out all the HomeKit items, needing them to be manually re-added.
Once the metadata is added, they do populate again in HomeKit, but in the default room, so they still have to be manually moved and all automation/scene rules completely rebuilt.
In doing so, I discovered an oddity. We had a pool temp sensor (in OH2, the tag used was “CurrentTemperature”). In OH3, I’ve added the HomeKit metadata of “TemperatureSensor.CurrentTemperature”, as that seems the most logical match to the original.
Indeed, it now appears, but in OH2, this appeared as Fahrenheit. Now, in OH3, it’s showing as Celsius. On OH’s web portal the pool temp sensor shows 92 (as Fahrenheit is coming from the Omni alarm panel, which is the temp source), but in HomeKit, it’s showing 38 degrees. Still trying to understand the “config” options for a given HomeKit metadata item. Is there something I can add to the “code” section of that metadata that would make it force Fahrenheit? The system-wide option of UseFahrenheit is active but hasn’t seemed to have any affect on this figure.
This is the OmniLink Binding (HAI/Leviton Omni automation panel). v3.1.0
I’ve noticed the list of HomeKit options are far superior to the older OH2 options. I was pleased to see some actual security components - I might actually be able to do something with a virtual keypad for setting the alarm, so that’s exciting.
In terms of OH Item, it’s the original one that was built (from the upgrade) - that didn’t change, but it’s showing as:
Label: Pool Water Temperature
Semantic Class: None
I did change it to a type of: Number:Temperature, which just changed the display in OH to now add “F” at the end, but no change in HomeKit.
If you’re talking about the Global Homekit Option - yes, that’s already active. I even turned it off (save) then back on (save again), since that setting was actually part OH2 config that carried over.
The preferred display for us is F, and OH’s web portal is showing F, but ever since OH3, what HomeKit is receiving is now Celsius. The global option in HomeKit is set to display as F, so I’m not sure what you mean…
I have the same problem with HomeKit showing 38 degrees for temperature sensors. In my case, the sensors are reporting the correct temp in OpenHAB, and the temps are all different. What they have in common is they all have a decimal point in the value. It appears HomeKit doesn’t like the format and reports it as 38 degrees no matter what the value. Does anyone know if there’s a fix for this?
Thanks for the reply. I realized the resolution was not the problem. The sensor without a decimal point was only 29 degrees F. The others were over 38 degrees, so you are correct.
I already have Fahrenheit set in the HomeKit settings, so I tried adding the minValue/maxValue to the metadata. I’m using the GUI, so I added it to the Metadata:stateDescription. The code is as follows:
value: " "
Unfortunately this didn’t fix the problem. It’s still showing 38 degrees. Any idea what I’m doing wrong?
you need to add minValue and maxValue to homekit metadata.
if you use OH 3.2 then main ui has already input fields for min/max value so that you dont need to touch textual configuration.
here are the screenshots from my setup
just check the specification and implementation - fractions / decimals are fine. according to spec temperature can be float, i.e. with decimal, and the implementation also support it.
also works correctly for me
That was the problem, thanks! I should have noticed these settings in the HomeKit metadata. Just curious why the defaults are in Celsius? I understand the HomeKit protocol uses Celcius, however shouldn’t they be Fahrenheit values when “Use Fahrenheit Temperature” is selected? That would really simplify it for the user.
With regard to thermostats, I was able to get the correct temps by setting the min/max values for Thermostat.CurrentTemperature and Thermostat.TargetTemperature. However I can’t get the modes to work. I have a Leviton OmniPro and RC2000 thermostat (via OmniLink binding), so I added numbers (0,1,2,3) to the global HomeKit Heating/Cooling mappings. However this didn’t work. Any suggestions?
Also, this thermostat supports humidity, but there’s no support for thermostat humidity in HomeKit. So I decided to make it a separate humidity sensor. I tried adding HumiditySensor.RelativeHumidity to the thermostat humidity item in the thermostat equipment group, but it did not work. I had to create another item outside the group for it to work. Does this sound correct?
I needed to add min and max values for the HomeKit temperature items. (As I noted, my sensors were limited to 38 degrees max.) This doesn’t seem like it should be necessary if I already set the HomeKit global setting to Fahrenheit. OpenHAB should know this and adjust accordingly without the need to do anything else. That said, what’s the purpose of these limits anyway?
do you know which version of openHAB you have? actually the issue with default min/max not being converted to Fahrenheit was fixed recently and should work with OH3.2
if not, i would need to check it again.
Apple has defined max/min values for all characteristic and not only temperature. sometimes it helps to do proper visualisation in home app, e.g. gauge, sometimes it has no benefit.
regarding humidity at thermostats: this will be supported in the next release. currently you need to create humidity sensor outside of the thermostat group
regarding the modes:
settings should apply without restart, but just to be on safe side, please restart openhab
check in main UI which value the item for mode gets. is it 0,1,2,3? What home apps shows? if you change the mode in home app, what happens to value at openhab item?
I just installed it last week. It shows “3.2.0 Release Build” in the UI.
Good news about support for humidity. Thanks!
Regarding the thermostat modes, the current and target items are both numbers. They show the following in the UI:
Target Mode (0, 1) : Off, Heat
Current Mode (0, 1) : Idle, Heating
Note that I only have heat. (No AC)
After restart, the UI shows the correct status from the OmniPro (i.e. “Heat”). HomeKit shows the mode as “OFF”.
If I manually change the mode in HomeKit to anything other than “OFF” and then change the mode in the UI to anything (incl. “Off”), HomeKit will change it to “OFF”. Closing the Home app and reopening it also changes it back to “OFF”.
Changing the mode in HomeKit does not change the mode in openHAB.
Changing the mode in HomeKit to “HEAT” will show the setpoint temp. Changing the temp will change the set point in openHAB.