How to get new item (thermostat) into HomeKit?

Hi,

This is probably a stupid beginner question: I have been using the HomeKit binding for some time now, with only one item, a garage door opener. Now I added another item, a thermostat. Since I added the metadata one by one, there were initially errors in the log file that not all mandatory characteristics were present, but in the end it seems it was created successfully. However, I do not see the new device in the Home app on my iPhone.

Is there anything specific I need to do for HomeKit to update the devices available via the openHAB accessory?

2024-01-10 21:19:17.065 [WARN ] [.accessories.HomekitAccessoryFactory] - Accessory of type Thermostat must have following characteristics [CurrentHeatingCoolingMode, TargetHeatingCoolingMode, CurrentTemperature, TargetTemperature]. Found only [Item:Heat_OG_BL_Power (Type=SwitchItem, State=OFF, Label=Thermostat Power, Category=heating, Tags=[Point, Power], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'CurrentHeatingCoolingMode', Item:Heat_OG_BL_Power (Type=SwitchItem, State=OFF, Label=Thermostat Power, Category=heating, Tags=[Point, Power], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'TargetHeatingCoolingMode']
2024-01-10 21:19:17.065 [WARN ] [mekit.internal.HomekitChangeListener] - Cannot create accessory Item:Heat_OG_BL_Power (Type=SwitchItem, State=OFF, Label=Thermostat Power, Category=heating, Tags=[Point, Power], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'Empty'
2024-01-10 21:19:39.055 [WARN ] [.accessories.HomekitAccessoryFactory] - Accessory of type Thermostat must have following characteristics [CurrentHeatingCoolingMode, TargetHeatingCoolingMode, CurrentTemperature, TargetTemperature]. Found only [Item:Heat_OG_BL_Power (Type=SwitchItem, State=OFF, Label=Thermostat Power, Category=heating, Tags=[Point, Power], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'CurrentHeatingCoolingMode', Item:Heat_OG_BL_Power (Type=SwitchItem, State=OFF, Label=Thermostat Power, Category=heating, Tags=[Point, Power], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'TargetHeatingCoolingMode']
2024-01-10 21:19:39.055 [WARN ] [mekit.internal.HomekitChangeListener] - Cannot create accessory Item:Outlet_OG_BL (Type=GroupItem, Members=4, State=NULL, Label=Heizung, Category=heating, Tags=[RadiatorControl], Groups=[SM_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'Empty'
2024-01-10 21:21:45.187 [WARN ] [.accessories.HomekitAccessoryFactory] - Accessory of type Thermostat must have following characteristics [CurrentHeatingCoolingMode, TargetHeatingCoolingMode, CurrentTemperature, TargetTemperature]. Found only [Item:Heat_OG_BL_Power (Type=SwitchItem, State=OFF, Label=Thermostat Power, Category=heating, Tags=[Point, Power], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'CurrentHeatingCoolingMode', Item:Heat_OG_BL_Power (Type=SwitchItem, State=OFF, Label=Thermostat Power, Category=heating, Tags=[Point, Power], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'TargetHeatingCoolingMode', Item:Heat_OG_BL_CurrentTemp (Type=NumberItem, State=22.3 °C, Label=Thermostat Current Temperature, Category=Temperature, Tags=[Measurement, Temperature], Groups=[Outlet_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'CurrentTemperature']
2024-01-10 21:21:45.188 [WARN ] [mekit.internal.HomekitChangeListener] - Cannot create accessory Item:Outlet_OG_BL (Type=GroupItem, Members=4, State=NULL, Label=Heizung, Category=heating, Tags=[RadiatorControl], Groups=[SM_OG_BL])  HomeKit type: 'Thermostat' characteristic: 'Empty'
2024-01-10 21:22:15.496 [WARN ] [istics.impl.base.FloatCharacteristic] - Detected value out of range 0.0. Returning min value instead. Characteristic io.github.hapjava.characteristics.impl.thermostat.CurrentTemperatureCharacteristic@7a70947b
2024-01-10 21:22:15.524 [WARN ] [istics.impl.base.FloatCharacteristic] - Detected value out of range 0.0. Returning min value instead. Characteristic io.github.hapjava.characteristics.impl.thermostat.TargetTemperatureCharacteristic@4aa699ed
2024-01-10 21:22:15.526 [INFO ] [mekit.internal.HomekitChangeListener] - Created 2 HomeKit items in instance 1.

One thing I am not sure if I did it right, I wanted to map both the CurrentHeatingCoolingMode and TargetHeatingCoolingMode to the same point in openHAB. Is this a problem?

Here is how the metadata config for the thermostat item looks like:

And here the metadata code for the one switch that both current and target modes are mapped to:

value: Thermostat.CurrentHeatingCoolingMode,Thermostat.TargetHeatingCoolingMode
config:
  HEAT: ON
  OFF: OFF

Regards, Robert

I don’t use HomeKit, but I’m guessing that you need to use a string item. From the documentation under Thermostat modes:

These modes are mapped to string values of openHAB items

Hmmm, I thought that also a switch has the string values of “ON” and “OFF”, to which I mapped the HomeKit values “HEAT” and “OFF” in the metadata. Since it seems the HomeKit items were created on the OpenHAB side I thought this was accepted by the binding and that my issue is more that HomeKit does not recognize the new accessory for some reason.

So my main question is if new items should appear automatically in the Apple Home app, or if there is anything I need to do for that to happen.

Now tried to create two separate string points for current and target mode, but the issue remains the same. The log file shows that the HomeKit items are created, but they do not show up in the Home app.

OK, after restarting the HomeKit bundle on the Karaf console the new item showed up in the Home app.

However, now I face another issue, that was shown already in the log files above. For both the current temperature and the target temperature, HomeKit detects a value of “0.0”, despite the points having actual values.

Here is the entry from the log file:

2024-01-11 16:27:12.213 [WARN ] [istics.impl.base.FloatCharacteristic] - Detected value out of range 0.0. Returning min value instead. Characteristic io.github.hapjava.characteristics.impl.thermostat.TargetTemperatureCharacteristic@72d9b58a

Here is the point that has the target temperature metadata:

And here is the code for it:

label: Thermostat Target Temperature
type: Number:Temperature
category: temperature
groupNames:
  - Outlet_OG_BL
tags:
  - Temperature
  - Point

Any idea of what I could be doing wrong? From what I see my point should be in line with what is expected by the HomeKit add-on for thermostat target temperature.The same point works fine for the Alexa add-on, only the HomeKit add-on has this issue.

OK, was able to fix that as well. I entered 0.5 as step value, which was rounded down to 0, which seems to have caused this issue. With a step value of 1 it now works as expected. :partying_face:

Glad you got it working. Just to clarify, did the switch item work, or did you need a string item?

The switch item works with the mapping of the HomeKit states to „ON“ and „OFF“. Also mapping both current and target state to that one switch item seems to be working fine.

1 Like

Hi,

I have the same problem with homekit and Thermostat.TargetHeatingCoolingMode. If I use OH Web and select program “Manuale” work fine. When I use Homekit I set the tag “Manuale” on OH the value is changed but the thermostat it doesn’t turn on. The OFF command work fine.

value: Thermostat.TargetHeatingCoolingMode
config:
HEAT: Manuale
OFF: OFF

I have solved with HEAT: MANUAL