tommasomarchionni / homebridge-openHAB

Homebridge plugin for openHAB
Apache License 2.0
49 stars 18 forks source link

itemLabel not showing up in homekit apps #9

Closed Oggerschummer closed 8 years ago

Oggerschummer commented 8 years ago

Having a sitemap with multiple light switches it is likely that some of them are named the same (e.g. "ceiling light"). So using the label is name is not working as it would not be unique and I want to use itemLabel in the customAttributes.

Example: Having a item in openHab named "EG_KUE_LichtDecke" I switched off the label usage ("useLabelForName": false) and added custom attributes for the item, e.g.:

"customAttrs": [ { "itemName":"EG_KUE_LichtDecke", "itemLabel":"Ceiling Light", "itemType":"LightbulbItem", "itemManufacturer": "MDT", "itemModel": "KNX Aktor", "itemSerialNumber":"1.1.1.A" } ]

In the homekit apps I see this item labeled "EG_KUE_LichtDecke" instead of "Ceiling light" as I´d expect. The name and everything else is considered. So the questions are: If I define an item in the items with the name XYZ, add it to the sitemap, switch off using labelsfornames and add custom attributes where itemName=XYZ and itemLabel=ABC

A bit more documentation details on how to name and link items to custom attributes would be great, currently it is a bit of a lucky guessing.

tommasomarchionni commented 8 years ago

If you set useLabelForName to false each item in your sitemap is initialized with the item's name (itemLabel is not considered) otherwise if you set useLabelForName to true each item is initialized with the item's label of your sitemap (each label of your sitemap must be unique). If you want customize item's label of your sitemap you can set itemLabel attribute (this attribuite is valid only when useLabelForName=true). Remember that item's label must be unique when you set useLabelForName=true.

Oggerschummer commented 8 years ago

Hello Thommaso, thanks for your reply.

So the label overrules the sitemaps item name as "accessory ID" if you set "useLabelForName" to true, either picking it from the sitemap or the custom attributes you supply. Set to false the items name from the sitemap is being picked as ID in homekit/homebridge.

What would be good is a custom attribute that allows to set the ID in homekit to some unique value, but have the label being displayed in homekit.

As you have multiple items in a house that in real world are e.g. called "ceiling light" this should be reflected in homekit as well. Lights are assigned to rooms, which makes it easy to address them like "Turn off ceiling light in the living room".

Usually to name and structure openHAB items one follows more or less a personal naming convention like in my case (e.g. KNX_HOUSE_FLOOR1_BATH_LIGHT1) where the items label is the real world name one would give it (e.g. "ceiling light", "Garage door", "Shutter"). Which neither item name nor item label makes a usefull or unique name when it come to using Siri with homekit - the technical item name is not usefull to the end user and the label is likely not unique.

From my point of view a separation between item name and/or label from the acessory ID / label is important if it is technically possible to supply both of these values to homekit/bridge as custom attribute.

Wishing you a Happy New Year as only a few hours of 2015 are left... Thomas

tommasomarchionni commented 8 years ago

Hi Thomas, for now it's impossible to do because Siri use accessory's name and these must be unique. So if you want to pronounce the accessories with Siri you should use name as "Garage door" and not as "House1_Garage_door".

Oggerschummer commented 8 years ago

Thanks for looking into this. From my perspective this is a clear gap in apples homekit / siri combination. They mix up technical IDs with everyday language used to control accessories using Siri. Closing this as it´s an Apple issue that can´t be fixed on your side.