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.
1 Like

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!!

Just setting up homekit support in OH4.0.3 for a pellet oven.

I am trying to reduce the selections options in homekit for the thermostat - using the following item definitions:

String      aduroh2_thermostat_current_mode				"Thermostat Current Mode"            (gAduroH2)       { homekit = "CurrentHeatingCoolingMode" [ OFF="OFF", HEAT="HEAT" ] }
String      aduroh2_thermostat_target_mode				"Thermostat Target Mode"             (gAduroH2)       { homekit = "TargetHeatingCoolingMode" [ OFF="OFF", HEAT="HEAT" ] }

I only want the OFF and HEAT option used and shown - but different from the description/guide, adding the [OFF=“OFF”… ] descriptors does not reduce the states to select from in the home App - it only limits the communication of stage to OH to the ones described.

This is how it is described in the homekit-OH documentation:

The custom mapping can be also used to reduce number of modes shown in Home app. The modes can be only reduced, but not added, i.e. it is not possible to add a new custom mode to HomeKit thermostat.

Anyone else who sees this behaviour - and have an idea how it can be reduced in the home app, making it more wife-friendly ?

Huh - works after removing the assesory in homekit, clearing pairings in the console and re-adding in homekit…

1 Like