Does OpenHAB support grouping HomeKit accessories in different types?

Hi,
I’m new to OH3 HomeKit but use the homebridge-openhab2 plugin for a while. I’d like to migrate to native HomeKit support in OH3, after reading the tutorials I don’t seem to find a way to group different type of accessories with OH3. With homebridge-openhab2 I can for example group a switch with a thermostat and a lock, would it be possible to do the same with native HomeKit add-on? Thank you!

if you want to have them as one accessory in home app, then this is currently not possible (but planned).

if you want to group them in openhab but you are ok to have 3 different accessories in home app then this is possible

Thank you for your reply!
I’d like to group them in Home app (to reduce the number of accessories), so I guess I will have to wait for the new version.
Do you know if it’s planned for 3.3?

i have it in my todo list already for a longer time. implementation is not that difficult but im not sure what is the best concept for configuration.

e.g.

  1. group of groups
Group mainGroup

Group lockGroup (mainGroup) {homekit="Lock"}
Switch  lockState (lockGroup) {homekit="LockCurrentState"}

Group tempGroup (mainGroup) {homekit="TemparatureSensor"}
Number currentTempState (tempGroup) { homekit="currentTemperature`}

  1. or one group but use accessory type name

Group LockTempGroup 
Switch  lockState (LockTempGroup ) {homekit="Lock.LockCurrentState"}
Number currentTempState (LockTempGroup ) {homekit="TemparatureSensor.currentTemperature`}

how you have configured it currently? do you have to use multiple groups and parent groups?

Hi, thank you for your reply! I don’t have any experience configuring it in OpenHAB as I currently use HomeBridge. In HomeBridge there is a special accessory type called “group” and I can basically put in any accessory into a group, for example:

              {
                    "type": "group",
                    "name": "Hot Water",
                    "model": "Nilan Compact P",
                    "items": [
                        {
                            "name": "Hot Water",
                            "type": "thermostat",
                            "currentTempItem": "VAL_DEV_TSENS11",
                            "targetTempItem": "prmUserTempDHW",
                            "heatingItem": "HomeKitHotWaterHeatingItem",
                            "tempUnit": "Celsius",
                            "maxTemp": 65,
                            "minTemp": 20,
                            "minTempStep": 1
                        },
                        {
                            "name": "Electric Heater Threshold",
                            "type": "thermostat",
                            "currentTempItem": "prmMinDHWTemp",
                            "targetTempItem": "prmMinDHWTemp",
                            "heatingItem": "VAL_DEV_DO2",
                            "tempUnit": "Celsius",
                            "maxTemp": 50,
                            "minTemp": 20,
                            "minTempStep": 1
                        },
                        {
                            "name": "Electric Heater",
                            "type": "switch",
                            "item": "prmDHW_HeaterEnable"
                        },
                        {
                            "name": "Water Temperature",
                            "type": "temp",
                            "currentTempItem": "VAL_DEV_TSENS12"
                        },
                        {
                            "name": "Electric Heater On",
                            "type": "contact",
                            "item": "VAL_DEV_DO2"
                        }
                    ]
                },

Personally I think group of group sounds like a reasonable solution, as it allows to group complex items such as heater/cooler (as per my example).

Hi-

Sorry for chiming in so late; I’ve been looking at a problem that seems to fall into this category:

I’m trying to expose my home theater receiver via HomeKit. I don’t think many of the controls are supported, but at a minimum, I’d like to control the power, volume and mute functionality.

Looking at the HAP documentation, it seems that a sort of multiple inheritance is assumed: the only place that a “power switch” concept is exposed is via a Switchable. The volume and mute are contained within a Speaker. Thus, I seem to need a device that is a combination of a Switchable and Speaker.

The OpenHAB HomeKit documentation describes a configuration that seems to fit this nicely: an example of an Occupancy and Motion sensor:

However, it doesn’t appear to work in practice. I gather from this thread that this capability is not yet implemented.

It seems to me that the simplest way to express a multi-accessory would be to have a single group tagged for the various types and each item within that group that make up each type, similar to your example #2:

Group LockTempGroup {homekit="Lock,TemperatureSensor"}
Switch  lockState (LockTempGroup ) {homekit="Lock.LockCurrentState"}
Number currentTempState (LockTempGroup ) {homekit="TemparatureSensor.currentTemperature`}

This approach also follows the way the new semantic model creates “Equipment” from Things: a single group with various items that make up the various aspects of that equipment.

I’m not sure if there are things that can’t be expressed as a single group of items, but using that format would definitely make it difficult to use the default behavior of the semantic model. Would it not be possible to support both (perhaps eventually)?

If approach #2 isn’t ruled out as an option, I might be able to spend a little time looking into supporting that, if there’s interest.

Hi Bill,

you are right, for receiver you will probably combine multiple homekit items, e.g. switch, volume, mute.

i have already implemented locally on my machine the option #2 - multiple items in one groups. good to get confirmation from you that it seems to be a logical way to do.

it works pretty well. I will commit my changes soon.

however, with this approach you cannot have multiple items of the same type in the same group. 2 switches would potentially possible but 2 locks would be difficult as unclear which items belongs to lock1 and which to lock2. same with other complex accessories with more than one item.

for this we would need the 1st option - group of groups.

Hi-

That’s great to hear, I’ll look forward to seeing that land.

After I wrote my message, I’d been wondering about how a device with multiple Switchables would work in Homekit (and would need to use the group of groups approach). The Home app seems pretty basic so I guess you’d need to find an alternative client.

@hww3 i have added support for grouping of different accessories. it was merged recently and is available in the latest builds. please test.

known limitation: you can only group different type, e.g. fan and light, but not the same type, e.g. multiple lights.

Hi @yfre

Thanks for letting me know! I’m pulling up the code now… will let you know how it turns out.

Bill