Help needed to configure Thermostat in HomeKit

Hi @yfre:
Just realised another small issue please see my other post here: Homekit add-on: device is still controllable even though the thing is offline

Basically the accessory is still controllable in HomeKit even though OpenHAB thing is offline. Would it be possible to show “no response” when the thing behind the HomeKit accessory is offline?

Hi @somy

i dont think it is possible. you have some experience with homebridge. was it possible there? if yes, i could have a look how it is implemented there.

Hi @yfre,
In HomeBridge it’s pretty much up to how the plugin is implemented.
Many of my plugins can certainly show “no response” when it lost connection to the accessory, most plugin detect the device offline by periodically pull state from the device (I think it’s the same with OH bindings).
However the OH plugin I use in HomeBridge doesn’t show no response when OH server is down (only when start up), and it caches values from OH :rofl:

@yfre please ignore, I solved the issue, it was because I should not mix other accessories in the same group.
Just got another issue (sorry to keep asking), I tried to configure my Xiaomi Gateway light based on the following config:

Group gXiaomiGatewayLight "Xiaomi Gateway Light"  {homekit="Lighting"}
Switch Xiaomi_gateway_light_switch <light> (gXiaomiGatewayLight) {homekit="Lighting.OnState", channel="mihome:gateway:286c0788xxxx:286c0788xxxx:brightness" }
Color Xiaomi_gateway_color <colorwheel> (gXiaomiGatewayLight) {homekit="Lighting.Hue, Lighting.Saturation", channel="mihome:gateway:286c0788xxxx:286c0788xxxx:color" }
Dimmer Xiaomi_gateway_brightness <dimmablelight> (gXiaomiGatewayLight){homekit="Lighting.Brightness", channel="mihome:gateway:286c0788xxxx:286c0788xxxx:brightness" }
Dimmer Xiaomi_gateway_colorTemperature (gXiaomiGatewayLight) {homekit="Lighting.ColorTemperature", channel="mihome:gateway:286c0788xxxx:286c0788xxxx:colorTemperature" }

Interestingly when items file reload, all accessories lost connection, if I remove the configuration for this particular light, everything works again. The xiaomi gateway is a bit strange that the color type cannot control brightness, hence I need to add brightness and switch to make it work. However I don’t know what went wrong with my configuration and why does it crash the rest of accessories?

@somy try to do it without ColorTemperature.

according to apple spec it is not allowed to have hue, saturation, brightness with colortemperature

Color Temperature
If this characteristic is included in the ”8.23 Light Bulb” (page 147), ”9.44 Hue” (page 179) and ”9.82 Saturation”
(page 197) must not be included as optional characteristics in ”8.23 Light Bulb” (page 147). This characteristic must
not be used for lamps which support color.

That’s really great news! Is it too much to ask for the list below? :rofl:

  1. Configurable rotation speed for heater/cooler/fan (min, max, step)
  2. Group of complex accessories
  3. TV support (big one)

update on that one:

  1. this should work with next snapshot version. the changes are already merged
  2. this is my next to-do but it will take some time, 2-3 weeks i would estimated
  3. i have added support to television to java-hap library. so, once the previous point - complex accessories - is implemented, i will add TV support to openhab as well.

Hi @yfre just want to report when I removed the color temperature it works! Thanks for the help! However I’m still having a small problem with regards to grouping - when I put the light (group of Switch, Color and Dimmer) inside another group with another HomeKit switchable accessory, the control somehow get mixed. Instead of using the switch in the light group, it uses the switch from its parent group. Just to be concrete, below is the working configuration when I put the accessories in two independent groups:

//Below are Xiaomi SmartHome binding
Group gXiaomiGateway "Xiaomi Gateway" 
Number:Illuminance Xiaomi_gateway_light_sensor "Indoor Light Sensor [%s lx]" <sun> (gXiaomiGateway) {homekit="LightSensor", channel="mihome:gateway:286c07889653:286c07889653:illumination" }
Number Xiaomi_gateway_play_sound "" <soundvolume-0> (gXiaomiGateway) { channel="mihome:gateway:286c07889653:286c07889653:sound" }
Switch Xiaomi_gateway_sound_switch <soundvolume_mute> (gXiaomiGateway) { channel="mihome:gateway:286c07889653:286c07889653:enableSound" }
Dimmer Xiaomi_gateway_sound_volume <soundvolume> (gXiaomiGateway) { channel="mihome:gateway:286c07889653:286c07889653:volume" }
Switch Xiaomi_gateway_sound_homekit "Play Sound" (gXiaomiGateway) {homekit="Switchable" }

//Gateway lights
Group gXiaomiGatewayLight "Xiaomi Gateway Light"  {homekit="Lighting"}
Switch Xiaomi_gateway_light_switch <light> (gXiaomiGatewayLight) {homekit="Lighting.OnState", channel="mihome:gateway:286c07889653:286c07889653:brightness" }
Color Xiaomi_gateway_color <colorwheel> (gXiaomiGatewayLight) {homekit="Lighting.Hue, Lighting.Saturation", channel="mihome:gateway:286c07889653:286c07889653:color" }
Dimmer Xiaomi_gateway_brightness <dimmablelight> (gXiaomiGatewayLight){homekit="Lighting.Brightness", channel="mihome:gateway:286c07889653:286c07889653:brightness" }
//Dimmer Xiaomi_gateway_colorTemperature (gXiaomiGatewayLight) {homekit="Lighting.ColorTemperature", channel="mihome:gateway:286c07889653:286c07889653:colorTemperature" }

However if put “gXiaomiGatewayLight” as a sub-group in “gXiaomiGateway”, when I turn on the light, it uses the switch “Xiaomi_gateway_sound_homekit” instead of “Xiaomi_gateway_light_switch”. So looks to me that when the HomeKit light accessory is created, it search the switch capability in parent group before the sub-group. Is it expected behaviour?
Thank you!

Great, glad to test the changes when they’re out! BTW, any chance also to add " Filter Maintenance Sensor" accessory support? It’s in API but not officially supported in Home app, Eve can certainly read the percentage. The description of the accessory from the homebridge plugin:

it is not expected behaviour. probably is bug. i will touch this part for complex accessory support anyway and can check.
the future it will put both accessory - from parent and from child group - in one accessory in home app.

regarding the filter maintenance - it can easily added. java-hap supports is already. but probably it will make only sense as part of complex accessory as not as standalone accessory. similar to battery service.
so, first complex accessory support and then filter service, battery service, irrigation and tv

Thank you! Very much look forward!!