HomeKit Tags (working) vs. Metadata (not working)


I’m using openhab (2.5.9) as home automation server to expose control elements and sensor data easily to familimembers all of them using apple iPhones I’m trying to add homekit= metadata to relevant items this seems not to work in my case when using [“lighting”], [“TemperatureSensor”], [ “CurrentHumidity” ], [ “ContactSensor” ] it works fine.
I’m using Tradfri, Xiaomi Mi, Dresden Electronics Conbee etc.

My Items are configured in an Item File as follows

Contact Xi_TFS_Schlafzimmer_OpenStatus “Schlafzimmer” (gTFS) [ “ContactSensor” ] { channel=“mihome:sensor_magnet:xxx:isOpen” }

Number:Temperature Xi_HT_Schlafzimmer_Temperature “Schlafzimmer” (gTemperature) [“TemperatureSensor”] { channel=“mihome:sensor_weather_v1:xxx:temperature” }
Number:Dimensionless Xi_HT_Schlafzimmer_Humidity “Schlafzimmer” (gHumidity) [ “CurrentHumidity” ] { channel=“mihome:sensor_weather_v1:xxx:humidity” }
Number:Pressure Xi_HT_Schlafzimmer_Pressure “Schlafzimmer” { channel=“mihome:sensor_weather_v1:xxx:pressure” }

Switch Tr_Li_Schlafzimmer_Switch “Schlafzimmer” (gLampen, pSimH) { channel=“tradfri:0210:gwxxx:Tr_Li_Schlafzimmer:color” }
Dimmer Tr_Li_Schlafzimmer_Farbtemperatur “Schlafzimmer_Farbtemperatur” { channel=“tradfri:0210:gwxxx:Tr_Li_Schlafzimmer:color_temperature” }
Color Tr_Li_Schlafzimmer_Farbe “Schlafzimmer_Farbe” { channel=“tradfri:0210:gwxxx:Tr_Li_Schlafzimmer:color” }
Number Tr_FB_Schlafzimmer_Batterieladung “Tr_FB_Schlafzimmer [%d %%]” (gBattery) { channel=“tradfri:0830:gwxxx:Tr_FB_Schlafzimmer:battery_level” }

I was using homekit=“Lighting, Lighting.Brightness, Lighting.ColorTemperature” and homekit=“CurrentTemperature” etc.

Are there specialities for Tradfri and Xiaomi etc.?

What I am doing wrong…

Thanks Jan

Hi Jan,
no, there is not specific for Tradfri or any. other vendors. HomeKit interacts with openHAB items and does not know what device is behind, if at all.
tag and metadata are handled in the same way. there must something wrong with the syntax you are using for metadata.
try this one
Contact Xi_TFS_Schlafzimmer_OpenStatus “Schlafzimmer” (gTFS) {homekit=“ContactSensor”, channel=“mihome:sensor_magnet:xxx:isOpen” }

Hej Eugen

Thanks a lot… I just tried it and it seems to work.
Maybe my problem is that I had the homekit metadata after channel and not before?

I will test it in more depth this evening after work!



Tested Xiaomi Mi HT Sensors as well unfortunately they do not work like ContactSensor.

do not work

Number:Dimensionless Xi_HT_Dachzimmer_Humidity “Bastelzimmer” (gHumidity) { homekit=“RelativeHumidity”, channel=“mihome:sensor_ht:xxx:humidity” }
Number:Temperature Xi_HT_Dachzimmer_Temperature “Dachzimmer” (gTemperature) { homekit=“CurrentTemperature”, channel=“mihome:sensor_ht:xxx:temperature” }

do work

Number:Dimensionless Xi_HT_Dachzimmer_Humidity “Bastelzimmer” (gHumidity) [ “CurrentHumidity” ] { channel=“mihome:sensor_ht:xxx:humidity” }
Number:Temperature Xi_HT_Dachzimmer_Temperature “Dachzimmer” (gTemperature) [“TemperatureSensor”] { channel=“mihome:sensor_ht:xxx:temperature” }

what can this be?

Thanks Jan

What editor are you using?

Try Vs code with the openhab addon.

Number:Dimensionless  Xi_HT_Dachzimmer_Humidity     "Bastelzimmer"  (gHumidity)     { homekit="RelativeHumidity", channel="mihome:sensor_ht:xxx:humidity"}
Number:Temperature    Xi_HT_Dachzimmer_Temperature  "Dachzimmer"    (gTemperature)  { homekit="CurrentTemperature", channel="mihome:sensor_ht:xxx:temperature"}

Hej Denominator

Im currently using Vs code on a Mac with the add-on… don’t know why the formatting has not been taken over …


So then… it works like this…

Number:Dimensionless Xi_HT_Dachzimmer_Humidity "Dachzimmer" <humidity> (gHumidity) { homekit="HumiditySensor", channel="mihome:sensor_ht:xxx:humidity" }
Number:Temperature Xi_HT_Dachzimmer_Temperature "Dachzimmer" <temperature> (gTemperature) { homekit="TemperatureSensor", channel="mihome:sensor_ht:xxx:temperature" }

Thanks for your help…


1 Like