Question about OH3, Homekit, and a Temp Sensor

but you have mentioned that you have to map to 0 or 1 values
so, put them in OFF and HEAT fields and remove mapping from others, i.e.

The screenshots are of the last values I tried. I previously tried using numbers instead of names. Both with and without entries for cool, cooling, and auto. Nothing seems to work. Here’s a summary of the 4 sets of values tried.

hm. do you see any messages in the log files related to heating modes?
if you put empty value for “cool” for target mode it should disappear in the home app from the list of possible modes. please check it. so we check whether the mapping is working in general

Yes, putting values for Off and Heat will only show a circle instead of a list. Adding Cool and/or Auto values will add those modes and show the selection list.

When I select heat in the Home app, I get this message in the log. It doesn’t matter if the values are numbers or text.

2022-02-21 14:14:40.786 [WARN ] [ssories.AbstractHomekitAccessoryImpl] - Unsupported item type for characteristic TARGET_HEATING_COOLING_STATE at accessory Downstairs_Thermostat. Expected class org.openhab.core.library.items.StringItem, got class org.openhab.core.library.items.NumberItem

right, the homekit binding expect a String item type for modes and does not support Number.

not sure whether you can just replace “Number” with “String”. probably your thing channel need a number. in such case the only way is to introduce one additional “virtual” item of type string and have a rule that keep “Number” item linked to Thing and “String” item linked to homekit in sync.

here is example from my setup.
i have

  • item called “valve_workroom” which is Number and express how much heating valve is open. it is linked to a corresponding KNX device via a Thing. it has no homekit metadata
  • item call “workCurrentThermostatMode” which is String and has no channel / Thing linked to it. it has homekit metadata

and then i have this rule. it is older one done without UI but i hope you get the idea. the rule in my case is one-directional - from openHAB to homekit as i cannot set a mode on my physical thermostat. you would need to have a similar one for homekit → device mapping

rule "Map Workroom Heating Mode for Homekit"
when
        Item valve_workroom received update
then
     if (valve_workroom.state > 0) {
                workCurrentThermostatMode.postUpdate("HEAT")
                workTargetThermostatMode.postUpdate("HEAT")
        } else {
                workCurrentThermostatMode.postUpdate("Off")
                workTargetThermostatMode.postUpdate("Off")
}
end

Thanks for your help. I was able to get this working using a proxy. However, there’s still an issue with synchronizing the mode, since it can be changed from both HomeKit and OH. I will end up with an endless loop using rules. Any suggestions?

important is to select sendCommand or postUpdate correctly. sendCommand triggers rules, postUpdate not.