Expose Homematic Heating Group to homekit

Hello,

I have homematic devices in my openhab and I want to expose them via homeKit Integration.

This is one of my things for a homematic heatingroup example:

UID: homematic:HmIP-HEATING:****************************:INT0000005
label: tHeizgruppeBad
thingTypeUID: homematic:HmIP-HEATING
configuration:
  HMP_1_P3_ENDTIME_SATURDAY_6: 1440
  HMP_1_P3_ENDTIME_SATURDAY_5: 1440
  HMP_1_P3_ENDTIME_SATURDAY_8: 1440
  HMP_1_P5_ENDTIME_SUNDAY_10: 1440
  HMP_1_P3_ENDTIME_SATURDAY_7: 1440
  HMP_0_ROUTER_STATIC_ROUTE_OM_PORTABLE_DEVICE_30: false
  HMP_1_P3_ENDTIME_SATURDAY_9: 1440
  HMP_1_P6_ENDTIME_WEDNESDAY_8: 1440
  HMP_1_P6_ENDTIME_WEDNESDAY_7: 1440
  HMP_1_P6_ENDTIME_WEDNESDAY_9: 1440
  HMP_1_P5_ENDTIME_FRIDAY_5: 1440
  HMP_1_P5_ENDTIME_FRIDAY_6: 1440
  HMP_1_P5_ENDTIME_FRIDAY_7: 1440
.........
.........
bridgeUID: homematic:bridge:*******************************

How can I expose channels to home kit and assign this device to a specific room for homekit?
I tried to follow the homekit intergration manual but I have not quite figured it out

important - you dont exposes things but items to homekit.
so, take items linked homematic channels and add homekit metadata to them.

one more note, apple does not allow room assignment by the bridge/server. rooms can be only assigned directly in home app.

Hello eugen,

thanks for you reply. How can I link different Items to one “homekit thing”? E.G. the set, target temperature and humidity of a thermostat?

regards

here is an example from my setup (i have KNX thermostats). I have a group of items and the group itself is tagged with homekit=“Thermostat” and the items in the group have tagging for different characteristics, e.g. homekit=“Thermostat.CurrentTemperature”

heating.items

Group gKitchenhermostat "Kitchen heating"                                                                                       {homekit="Thermostat"}
Number kitchenThermostatCurrentTemp "Current Temperature [%.1f ]"    (gKitchenhermostat) {homekit="Thermostat.CurrentTemperature", channel="knx:device:scn_ip:GT2T_kitchen:temperature"}
Number kitchenThermostatTargetTemperature "Target Temperature [%.1f C]" (gKitchenhermostat) {homekit="Thermostat.TargetTemperature",  channel="knx:device:scn_ip:AKH800_01:channel_d"}
String kitchenCurrentThermostatMode "Current Mode"                       (gKitchenhermostat) {homekit="Thermostat.CurrentHeatingCoolingMode" [OFF="OFF", HEAT="HEAT"]}
String kitchenTargetThermostatMode "Target Mode"                   (gKitchenhermostat) {homekit="Thermostat.TargetHeatingCoolingMode" [OFF="OFF", HEAT="HEAT"]}

you can also have multiple homekit metadata at a single item. e.g.

Dimmer    livingroom_tv_light         "Livingroom Light  [%s]"         {homekit="Lighting, Lighting.OnState, Lighting.Brightness", channel="knx:device:scn_ip:AKD_1:channel_a"}

it depends what your thermostat supports

Thank you eugene, I just need one more thing to point me in the right direction.
Do I have to set this unter item → metadata → Apple Homekit.
There under code it is:
value: “”
config: {}

i assumed you do you config using text config. but sure, you can do it using UI.
you dont need to put anything in the “code” tab. just link items at group item and click “Update group members”
it looks like this on my side

1 Like

unfortunatly the gui isnt working for me, after setting the mapping of the group members and clicking on “update group members” and also clicking on save, the change isnt saved.

Where can I do the textual config? In the item? Do I have to do it in the shell?

I click on Update and save:


Afterwards the settings are gone. Unfortunatly Im only allowed to post one picture.

This error is in the dev tools in the browser:
app.b85df14c3a7ad94c41f1.js:7

   TypeError: Cannot read properties of undefined (reading 'homekit')
at i.updateLinkedItem (16.app.b85df14c3a7ad94c41f1.js:1:133237)
at change (16.app.b85df14c3a7ad94c41f1.js:1:136231)
at qe (app.b85df14c3a7ad94c41f1.js:7:11319)
at HTMLSelectElement.n (app.b85df14c3a7ad94c41f1.js:7:13064)
at Za.r._wrapper (app.b85df14c3a7ad94c41f1.js:7:48339)
at e.trigger (app.b85df14c3a7ad94c41f1.js:1:9716)
at HTMLInputElement.b (app.b85df14c3a7ad94c41f1.js:7:311033)
at HTMLDivElement.l (app.b85df14c3a7ad94c41f1.js:1:7529)

Openhab is in the newest stable version 3.4.0

ok. need to investigate why it is not working in oh3.4
but you can do it also at single item level, i.e.

go to every item on you list separately and add homekit metadata,
e.g. go to tHeizgruppeBuero_ActualTemperature and add homekit metadata “CurrentTemperature”, then go to tHeizgruppeBuero_setPointTemperature and add “TargetTemprature”, etc

hi eugene, this is also not working. the log shows the following when I want to add the metadata to a single item:

Cannot create accessory Item:tHeizgruppeKueche_SetPointTemperature (Type=NumberItem, State=21 °C, Label=Set Point Temperature, Category=Temperature, Tags=[Point], Groups=[tHeizgruppeKueche]) HomeKit type: 'Thermostat' characteristic: 'Empty'

I also tried to uninstall and reinstall openhab…

this is all good.
Apple thermostat has mandatory items and without them it cannot create thermostat. so, you need to add homekit to all of them and to the group, so that apple knows they all belongs to the same thermostat.

the list of mandatory items you can find in the second column of this table

for thermostat they are:

  • CurrentTemperature
  • TargetTemperature
  • CurrentHeatingCoolingMode
  • TargetHeatingCoolingMode

so, please add all of them and the group, ignore the error in the logs until then

Hello eugen, on my first screenshot you can see that I added all mandatory items.
When I add the metadata to a single item, e.g. Current temperature to Thermostat.CurrentTemperature I see this in the logs:

22:14:43.985 [WARN ] [l.accessories.HomekitAccessoryFactory] - Accessory of type Thermostat must have following characteristics [CurrentHeatingCoolingMode, TargetHeatingCoolingMode, CurrentTemperature, TargetTemperature]. Found only [Item:tHeizgruppeSchlafzimmerEltern_ActualTemperature (Type=NumberItem, State=17.9 °C, Label=                                                    Actual Temperature, Category=Temperature, Tags=[Point], Groups=[tHeizgruppeSchlafzimmerEltern])  HomeKit type: 'Thermostat' characteristic: 'CurrentTemperature']
22:14:43.987 [WARN ] [omekit.internal.HomekitChangeListener] - Cannot create accessory Item:tHeizgruppeSchlafzimmerEltern_ActualTemperature (Type=NumberItem, State=17.9 °C, Label=Actual Temperature, Category=Temperature, Tags=[Point], Groups=[tHeizgruppeSchlafzimmerEltern])  HomeKit type: 'Thermostat' characteristic: 'Empty'

![image|690x139](upload://vfgMuBQMNPfQ2Qd7zBGTgDQQvol.png)

ignore error. just keep doing it. so, go to next item and add homekit data, one by one and then the group

the error also tells - “Thermostat must have following characteristics [CurrentHeatingCoolingMode, TargetHeatingCoolingMode, CurrentTemperature, TargetTemperature]”

add all of them and then openhab homekit will be able to create it

1 Like

Thank you, your hint led me to the solution.

I just want to point out, that it is important to add the items first and THEN adding the meta attribute to the group.

1 Like