Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[homekit] Color temperature behaviour OH 4.3 #18140

Open
blue-kaleidoscope opened this issue Jan 20, 2025 · 36 comments
Open

[homekit] Color temperature behaviour OH 4.3 #18140

blue-kaleidoscope opened this issue Jan 20, 2025 · 36 comments
Assignees
Labels
awaiting feedback Awaiting feedback from the pull request author bug An unexpected problem or unintended behavior of an add-on

Comments

@blue-kaleidoscope
Copy link

Hi,

this issue is related to a longer discussion on the OH forum: [openHAB 4.3 Milestone discussion](https://community.openhab.org/t/openhab-4-3-milestone-discussion/158139/114?u=jabra_the_hut)

Expected Behavior

When using OH 4.2.1 all my color temperature items behave perfectly normal both on OH UI and on Homekit side. Example item:

Number          Deckenlampe_Hobbyraum_Farbtemperatur
                "Farbtemperatur Deckenlampen Hobbyraum"
                <colorpicker>
                (Deckenlampen_Hobbyraum, Lampen_Farbtemperatur)
                ["Control", "ColorTemperature"]
                {
                    stateDescription=" "[
                            min="250",
                            max="454",
                            step="1",
                            pattern="%.0f mired"
                        ],
                    unit="mired",
                    homekit="Lighting.ColorTemperature",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature" [ profile="ruby:mired_to_kelvin" ],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:color_temperature" [ profile="ruby:mired_to_kelvin" ],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:color_temperature" [ profile="ruby:mired_to_kelvin" ]
                }

I am using a JRuby profile to convert between Mired and Kelvin which is attached to each color temperature channel. The profile looks as follows:

profile(:mired_to_kelvin) do |event, callback:, command:, state:|
  case event
  when :command_from_item
    callback.handle_command(command | "mired" | "K")
    
  when :state_from_handler
    mired = state.to_f | "K" | "mired"
    callback.send_update(mired.to_f)
  else
    true
  end
  false
end

In Homekit my lights look like this:

Image

With OH 4.3 I have issues with the color temperature items. They look like that in the homekit app:

Image

Image

I tried all different configurations from the documentation. But none works with OH 4.3. I have the impression that the example

// Dimmer item, with allowed range given in Kelvin
Dimmer light_temp { homekit="Lighting.ColorTemperature"[ minValue="2700 K", maxValue="5000 K" ]}

does not even work with OH 4.2.

I tried it with OH 4.3.1 and 4.3.2.

@blue-kaleidoscope blue-kaleidoscope added the bug An unexpected problem or unintended behavior of an add-on label Jan 20, 2025
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-3-milestone-discussion/158139/147

@andrewfg
Copy link
Contributor

andrewfg commented Feb 1, 2025

@blue-kaleidoscope apologies that I did not notice your issue sooner.

In the last 1..2 months we made some improvements to OH concerning Color Temperature .. in particular we added a Color Temperature Picker

And as a consequence we made some changes in various bindings in order to properly handle the Color Temperature Min/Max range so that the Color Temperature Picker would display the correct gradient from cool to warm.

However AFAICT it could be that we did not make the respective changes concerning the HomeKit integration. So I will have a look at it.

Pinging @lolodomo also for info..

@andrewfg andrewfg self-assigned this Feb 1, 2025
@andrewfg

This comment has been minimized.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 2, 2025

EDIT @blue-kaleidoscope is this the same issue that you raised here? And if so did you follow my suggestion in the post following yours? And if not then why are you confusing that discussion by opening a new issue here?


@blue-kaleidoscope I need to better understand what is your problem. There are too many "moving parts" (deconz <=> Profile <=> Item <=> OH HomeKit Item configuration <=> OH Homekit export <=> HomeKit UI) .. so it is really hard to know what is really the issue. Indeed it is impossible to say if this is an issue in deconz/profile/OH-Core/homekit. So can you please provide the following information in very very great detail?

  1. Your screenshots above say "something is wrong" but you don't say what exactly is wrong. So can you please describe to me in exact words what is the problem? Please divide your answer into two parts 1a) relationship between the deconz channel and your Item, and 1b) relationship between your Item and HomeKit?
  2. Which precise version of OH are you using?
  3. What is the precise Item definition? i.e. is it actually the Item at the top of this post?
  4. Can you please explain what your JRuby profile (above) is doing? (I don't know JRuby). What is the function handle_command(command | "mired" | "K") doing? Ditto the functions state.to_f | "K" | "mired" and mired.to_f ??
  5. Can you try removing that JRuby profile from the Item / Channel link, and let me know what (if anything) changes? Again in two parts as in 1a / 1b above.
  6. Can you please enable log:set TRACE org.openhab.binding.deconz and provide the result when the CT is changed a) from OH, and b) from the deconz app?
  7. Can you please enable log:set TRACE org.openhab.io.homekit and .. ditto?
  8. Can you please provide the respective entries from the OH events log at the times corresponding to 6. and 7 above?

Perhaps you can help by analysing in several parts..

  • Create two "bare" Number:Temperature channels that are NOT linked to a deconz channel, NOR to HomeKit, with statedescription min/max/pattern and unit config params in mired resp. kelvin
  • Confirm that both Items work correctly in the OH UI with ColorTemperaturePicker control.
  • Link those "bare" Items to homekit, and confirm which (if any) works correctly; or if not what is going wrong.
  • Finally link the items also to the deconz channel both 1) without resp. 2) with the JRuby profile.

@andrewfg andrewfg added the awaiting feedback Awaiting feedback from the pull request author label Feb 2, 2025
@blue-kaleidoscope
Copy link
Author

Thanks for the reply. I will provide you with all the info next week.

@ccutrer
Copy link
Contributor

ccutrer commented Feb 2, 2025

A few more pieces of information to help us:

  • The full item definitions describing how your bulb is exposed to HomeKit, not just for the ColorTemperature item. This includes the group item, as well as the OnState and possibly Brightness characteristics.
  • The output of homekit show <name of accessory> from the openHAB CLI. It should look something like this:
openhab> homekit show "Guest Bedroom Cans"
594752554 Guest Bedroom Cans
Services:
  Service Type: AccessoryInformationService (0000003E-0000-1000-8000-0026BB765291)
    Characteristics:
      IdentifyCharacteristic: {"iid":0,"type":"14","perms":["pw"],"format":"bool"}
      ManufacturerCharacteristic: {"iid":0,"type":"20","perms":["pr"],"format":"string","value":"none","maxLen":255}
      ModelCharacteristic: {"iid":0,"type":"21","perms":["pr"],"format":"string","value":"none","maxLen":255}
      NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Guest Bedroom Cans","maxLen":255}
      SerialNumberCharacteristic: {"iid":0,"type":"30","perms":["pr"],"format":"string","value":"eGuestCans","maxLen":255}
      FirmwareRevisionCharacteristic: {"iid":0,"type":"52","perms":["pr"],"format":"string","value":"none","maxLen":255}
  Service Type: LightbulbService (00000043-0000-1000-8000-0026BB765291)
    Characteristics:
      OnCharacteristic: {"iid":0,"type":"25","perms":["pr","pw","ev"],"format":"bool","value":true}
      BrightnessCharacteristic: {"iid":0,"type":"8","perms":["pr","pw","ev"],"format":"int","value":100,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
      HueCharacteristic: {"iid":0,"type":"13","perms":["pr","pw","ev"],"format":"float","value":49.0,"minValue":0.0,"maxValue":360.0,"minStep":1.0,"unit":"arcdegrees"}
      SaturationCharacteristic: {"iid":0,"type":"2F","perms":["pr","pw","ev"],"format":"float","value":8.0,"minValue":0.0,"maxValue":100.0,"minStep":1.0,"unit":"%"}

I don't currently have any CCT only bulbs active at the moment (only HSB+CCT, which HomeKit oddly refuses to accept - they can only be HSB, and then it also shows CCT controls but converts it to HSB before sending to the accessory), but I do have some I own and just need to install, so I can do more testing at that point. But my suspicion is that your profile is confusing the HomeKit add-on, and then it's exposing the wrong range to HomeKit for color temp. I highly recommend not using your profile, defining your item as Number:Temperature and with a unit (of either K or mired -- it looks like you're already using the latter). That should have core interpret any numbers coming from the binding as mired, and any Quantity commands sent to the binding should be converted to that as well. it should be noted that the HomeKit add-on will always send the command coming from HomeKit to openHAB as a Quantity type in mireds. When the Item changes state, if it's a QuantityType (i.e. a Number:Temperature item) it will convert it to mireds if possible (i.e. do nothing if it's already in mired, or convert K to mired) and then forward to HomeKit. If it's a bare Number item, it just assumes it's in mireds. Which seems like you're going to get a double-conversion with your profile. You may also want to define the min/max on the HomeKit metadata key itself. Looking through the code one last time, I don't see that the HomeKit add-on is actually reading the state description to determine the min and max to tell HomeKit about. I swore it did this...

@andrewfg
Copy link
Contributor

andrewfg commented Feb 2, 2025

@ccutrer thanks for joining the conversation. I also believe the main culprit is the OP's profile. Or even something on the deconz side. However I do have another doubt, that perhaps you can confirm or deny. AFAICT the HomeKit addon takes the min/max values from the Item's HomeKit metadata; and if such is not provided then (for color temperature) it falls back to min/max mired values which are hard wired in the addon. I think that such fallback behavior is basically OK, but IMHO it would probably be an improvement if it would first try to fall back to the Item's state description metadata min/max/pattern values (and possibly the Item's unit metadata) before it finally falls back to those hard wired min/max values. But to stress again, I don't think this is the OP's actual issue.

I swore it did this...

Yep. I think you just confirmed my thoughts above..

@ccutrer
Copy link
Contributor

ccutrer commented Feb 2, 2025

Agreed, that's definitely an enhancement I want to make. I swear I had already done that though, because I made a PR to core about doing unit conversions when combining state description fragments (and specifically for thermostat temperature characteristics). But I don't see it happening in HomeKitCharacteristicFactory. Maybe it got lost waiting for the former PR, which I believe was never merged.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 2, 2025

they can only be HSB, and then it also shows CCT controls but converts it to HSB before sending to the accessory

PS on a side note: a color temperature defines a coordinate that lies on the Planckian locus in the CIE XY color space. So indeed a specific CT value does indeed always convert to a specific HS(B) point. (Whereas by contrast a HS(B) value generally does NOT convert to a specific CT value). I recently added a couple of methods to OH Core ColorUtils -- namely kelvinToXY() and xyToKelvin() so addon developers can enhance support for CT channels via HS(B) state/command values.

@ccutrer
Copy link
Contributor

ccutrer commented Feb 2, 2025

And on that side note, I plan to use them in the HomeKit addon, and already use them in my own rules ;). The oddness is that it doesn't seem like Apple's conversion to HSB exactly matches up with our calculations. So it doesn't roundtrip perfectly back on their color temperature picker.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 3, 2025

it doesn't seem like Apple's conversion to HSB exactly matches up with our calculations. So it doesn't roundtrip perfectly back on their color temperature picker.

Yeah. It is not a precise science *). Particularly the round tripping. I touched on the algorithms used via hyper-links in the JavaDoc of the respective ColorUtils methods.

EDIT: *) in case anyone is interested: the reason is that the theory is based on the colour of the light emission from a perfect Planckian black body heated to a given temperature; and the reality is that the Sun is not (quite) a perfect Planckian black body. And the atmosphere transmits a subset of the Sun's emission spectrum. Etc. So depending on different scientists' personal preferences there are various tweaks applied to the plain Planckian CT <=> XY mapping..

@andrewfg
Copy link
Contributor

andrewfg commented Feb 3, 2025

More apropos the profile. AFAICT the profile currently applies to the linkage between the deconz Channels (note: plural 's') and the Item. i.e. not between the Item and Homekit (which would I think be impossible anyway).

=> So @blue-kaleidoscope why do you have a single Item linked to THREE different deconz channels in parallel?

EDIT so to answer my own question, I guess you want to group the CT command to all lamps in a single room (hobbyraum)? In which case you should not be doing it the way you have so far tried. Instead you should have individual Item's linked to each individual lamp's CT channel. And then you should have a Group Item that has those individual Items as members, using e.g. the AVG group function. And then you can try to link that Group Item to Homekit.

.. although @ccutrer I am not sure if the Homekit integration does pick up the underlying base Item value when integrating a Group Item. ???

@ccutrer
Copy link
Contributor

ccutrer commented Feb 3, 2025

HomeKit addon should not care if any characteristic is linked to a GroupItem instead of say a NumberItem, as long as it's say a Group:Number, and not an "untyped" group. I put a decent amount of work into that a couple years back.

@ccutrer
Copy link
Contributor

ccutrer commented Feb 5, 2025

So I added a Hue CCT-only bulb (7W ST19, model LTV004), and exposed it to HomeKit. Zigbee2MQTT exposes a range of 222-454 mireds, which roughly corresponds to 2200K-4500K (which is the range shown on the box).

Here are my items:

Group eBoysBathRightSinkRightVanityLight "Boys’ Bathroom Right Sink Right Vanity Light" (lBoysBath) { homekit="Lighting" }
Dimmer BoysBathRightSinkRightVanityLight_Dimmer "Boys' Bathroom Right Sink Right Vanity Light" (eBoysBathRightSinkRightVanityLight) { channel="mqtt:homeassistant:mosquitto:zigbee2mqtt_5F0x001788010bfaa428:light#brightness", homekit="Lighting.OnState,Lighting.Brightness" }
Number:Temperature BoysBathRightSinkRightVanityLight_CCT "Boys' Bathroom Right Sink Right Vanity Light CCT" (eBoysBathRightSinkRightVanityLight) ["Control", "ColorTemperature"] { channel="mqtt:homeassistant:mosquitto:zigbee2mqtt_5F0x001788010bfaa428:light#color-temp", unit="mired", homekit="Lighting.ColorTemperature" }

The HomeKit add-on seems to have picked up the state description, so I need to remember how that is working, because I haven't done anything to explicitly set the range on the HomeKit metadata (the default should be 107-556 mireds):

openhab> homekit show Vanity                                                                                                                                                                                                                                                                                        
75481684 Boys’ Bathroom Right Sink Right Vanity Light
Services:
  Service Type: AccessoryInformationService (0000003E-0000-1000-8000-0026BB765291)
    Characteristics:
      IdentifyCharacteristic: {"iid":0,"type":"14","perms":["pw"],"format":"bool"}
      ManufacturerCharacteristic: {"iid":0,"type":"20","perms":["pr"],"format":"string","value":"none","maxLen":255}
      ModelCharacteristic: {"iid":0,"type":"21","perms":["pr"],"format":"string","value":"none","maxLen":255}
      NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Boys’ Bathroom Right Sink Right Vanity Light","maxLen":255}
      SerialNumberCharacteristic: {"iid":0,"type":"30","perms":["pr"],"format":"string","value":"eBoysBathRightSinkRightVanityLight","maxLen":255}
      FirmwareRevisionCharacteristic: {"iid":0,"type":"52","perms":["pr"],"format":"string","value":"none","maxLen":255}
  Service Type: LightbulbService (00000043-0000-1000-8000-0026BB765291)
    Characteristics:
      OnCharacteristic: {"iid":0,"type":"25","perms":["pr","pw","ev"],"format":"bool","value":true}
      BrightnessCharacteristic: {"iid":0,"type":"8","perms":["pr","pw","ev"],"format":"int","value":40,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
      ColorTemperatureCharacteristic: {"iid":0,"type":"CE","perms":["pr","pw","ev"],"format":"int","value":250,"minValue":222,"maxValue":454,"minStep":1,"unit":"mired"}

And this is how it shows up in the Home app on my phone:
Image
I don't think Apple's display matches reality very well (4500K is quite cool. Not quite the blue of a 5000-6000K, but fairly white). But it controls the light just fine, both brightness and color temperature.

I also added a Colortemperaturepicker sitemap element to test it:

sitemap test label="Test" {
  Colortemperaturepicker item=BoysBathRightSinkRightVanityLight_CCT
}

Image
The rendering is a bit better, and functionality is correct, automatically using the correct range and displaying in K even though the items are stored in mireds.

@ccutrer
Copy link
Contributor

ccutrer commented Feb 5, 2025

I swear I had already done that though

🤦 I needed to look one helper method call deeper:

final @Nullable StateDescription stateDescription = getItem().getStateDescription();

So as long as the CCT item is a Number:Temperature, has a proper unit defined, and the state description min/max is in the same unit as the item, it should all just work (and without a profile). If the state description is in a different unit than the item, I wouldn't be surprised if there is a bug. openhab/openhab-core#3132 was my original pull request that somewhat dealt with that, but that was quite some time ago before items could have their unit specified separately from the state description.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 5, 2025

@ccutrer thanks for the feedback. So I am inclined to close this issue. Unless @blue-kaleidoscope comes back with real evidence that there is a problem in the addon(s) rather than a problem in his setup..

@ccutrer
Copy link
Contributor

ccutrer commented Feb 6, 2025

Let's give him a couple more days. I just figured out a problem for @ktgeek that was working for me just fine, but not him, and it turned out to be how the add-on was interpreting his step value. It's possible something is up with how the HomeKit add-on is interpreting @blue-kaleidoscope's state description as well. The Home app starts to get really weird if the min/max/step are messed up. But I wouldn't think it would be a problem for this scenario, since everything is in mired so no actual conversions should be happening, and ColorTemperatureCharacteristic doesn't even have a step value.

@blue-kaleidoscope
Copy link
Author

blue-kaleidoscope commented Feb 6, 2025

Hello,

oh wow, so much to catch up with. Sorry, was on business trip and did not have the chance to do a deep dive yet. I did some experiments yesterday with a clean OH 4.3.2 installation and only controlling one CT light and everything worked fine so I suspect as well, that my current configuration on OH 4.2.1 is odd. I have to admit right now I cannot answer all your questions below. I would need to bring my productive system to 4.3.2 again to force the weird behaviour and for this I need time which I right now do not have. Hopefully this weekend! Anyway, let's have a look at it as best as possible.

EDIT @blue-kaleidoscope is this the same issue that you raised here? And if so did you follow my suggestion in the post following yours? And if not then why are you confusing that discussion by opening a new issue here?

It is the same issue yes, but your suggested workaround did not help and I did not dare to comment that again as the issue was tagged 'closed'.

@blue-kaleidoscope I need to better understand what is your problem. There are too many "moving parts" (deconz <=> Profile <=> Item <=> OH HomeKit Item configuration <=> OH Homekit export <=> HomeKit UI) .. so it is really hard to know what is really the issue. Indeed it is impossible to say if this is an issue in deconz/profile/OH-Core/homekit. So can you please provide the following information in very very great detail?

  1. Your screenshots above say "something is wrong" but you don't say what exactly is wrong. So can you please describe to me in exact words what is the problem? Please divide your answer into two parts 1a) relationship between the deconz channel and your Item, and 1b) relationship between your Item and HomeKit?

The second screenshot shows a brightness level of 250% and the third screenshot shows a relatively cool color temperature while the selector is on the warmest area. On the second and third screenshot one can also see that the brightness level goes beyond the screen.
1a: When controlling the item on OH side the following two CT item test-configs work on OH side as expected. I change the CT inside OH and the physical CT changes.
1b: With the first test config below on Homekit side I cannot change the color temperature at all. If I change it on my iPhone it switches back to its previous value. With the second test config below on Homekit side I can change the color temperature but the ranges are wrong. Homekit shows me a color temperature light ranging from 1000 K to 5000 K, temperatures my light is not supporting.

Number:Temperature          Testlampe_Hobbyraum_Farbtemperatur
                "Farbtemperatur Testlampe Hobbyraum [%.0f K]"
                <colorpicker>
                (Testlampe_Hobbyraum)
                ["Control", "ColorTemperature"]
                {
                    unit="K",                    
                    stateDescription=" "[
                            pattern="%.0f K",
                            min="2202",
                            max="4000"                                                                                                       
                        ],
                    homekit="Lighting.ColorTemperature",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature"                                        
                }
Number:Temperature         Testlampe_Hobbyraum_Farbtemperatur
                "Farbtemperatur Testlampe Hobbyraum [%.0f mired]"
                <colorpicker>
                (Testlampe_Hobbyraum)
                ["Control", "ColorTemperature"]
                {
                    unit="mired",                    
                    stateDescription=" "[
                            pattern="%.0f mired",
                            min="250",
                            max="454"                                                                                                       
                        ],
                    homekit="Lighting.ColorTemperature"[minValue=250, maxValue=454],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature" [ profile="ruby:mired_to_kelvin" ]                                        
                }
  1. Which precise version of OH are you using?

OH 4.2.1 --> This is the one I currently use and where things work as expected (from a user perspective).
OH 4.3.2 --> This is the one where the "weird" things start to happen without changing the config.

  1. What is the precise Item definition? i.e. is it actually the Item at the top of this post?
    This is the item definition I'm using together with the above posted profile:
Group           Deckenlampen_Hobbyraum
                "Hobbyraum Licht"
                (Ort_Hobbyraum)
                ["Lightbulb"]
                {
                    homekit="Lighting"
                }

Switch          Deckenlampe_Hobbyraum_Einschaltstatus
                "Einschaltstatus Deckenlampen Hobbyraum [MAP(de.map):%s]"
                <switch>
                (Deckenlampen_Hobbyraum, Einschaltstatus_Lichter)
                ["Control", "Light"]
                {
                    homekit="Lighting.OnState",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:brightness"
                }

Dimmer          Deckenlampe_Hobbyraum_Helligkeit
                "Helligkeit Deckenlampen Hobbyraum [%d %%]"
                <slider>
                (Deckenlampen_Hobbyraum, Lampen_Helligkeit)
                ["Control", "Level"]
                {
                    homekit="Lighting.Brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:brightness",
                    helligkeit=" " [
                            tageslicht=100
                        ]

                }

Number          Deckenlampe_Hobbyraum_Farbtemperatur
                "Farbtemperatur Deckenlampen Hobbyraum"
                <colorpicker>
                (Deckenlampen_Hobbyraum, Lampen_Farbtemperatur)
                ["Control", "ColorTemperature"]
                {
                    stateDescription=" "[
                            min="250",
                            max="454",
                            step="1",
                            pattern="%.0f mired"
                        ],
                    unit="mired",
                    homekit="Lighting.ColorTemperature" [minValue=250, maxValue=454],
                    nightshift= " " [startzeit="21:00"],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature" [ profile="ruby:mired_to_kelvin" ],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:color_temperature" [ profile="ruby:mired_to_kelvin" ],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:color_temperature" [ profile="ruby:mired_to_kelvin" ],
                    farbtemperatur=" " [
                            tageslicht=250
                        ]
                }
  1. Can you please explain what your JRuby profile (above) is doing? (I don't know JRuby). What is the function handle_command(command | "mired" | "K") doing? Ditto the functions state.to_f | "K" | "mired" and mired.to_f ??

The idea with the profile I got originally from: the openHAB forum here
I have to admit that I do not know what the functions really do under the hood. They seem to do the conversion but I don't know how exactly. When implementing the profiles I did not know that the Homekit addon also supports a Kelvin based configuration. I thought that the CT items need to be in Mired and before sending the CT value to deconz I thought I have to convert it into Kelvin.

  1. Can you try removing that JRuby profile from the Item / Channel link, and let me know what (if anything) changes? Again in two parts as in 1a / 1b above.

Removing the profile has 2 effects:
1a: The CT items can be controlled without issues on OH side.
1b: The CT items on Homekit side show a weird color: black. Whatever CT I selected in the Homekit UI it jumped Always back to black although black cannot be selected at ll.

  1. Can you please enable log:set TRACE org.openhab.binding.deconz and provide the result when the CT is changed a) from OH, and b) from the deconz app?
  2. Can you please enable log:set TRACE org.openhab.io.homekit and .. ditto?
  3. Can you please provide the respective entries from the OH events log at the times corresponding to 6. and 7 above?

Perhaps you can help by analysing in several parts..

I try to do it this weekend.

  • Create two "bare" Number:Temperature channels that are NOT linked to a deconz channel, NOR to HomeKit, with statedescription min/max/pattern and unit config params in mired resp. kelvin
  • Confirm that both Items work correctly in the OH UI with ColorTemperaturePicker control.
  • Link those "bare" Items to homekit, and confirm which (if any) works correctly; or if not what is going wrong.
  • Finally link the items also to the deconz channel both 1) without resp. 2) with the JRuby profile.

So the following configuration works as expected with a clean OH 4.3.2 Installation both on Homekit side and on OH (deconz) side:

Group           Testlampe_Hobbyraum
                "Hobbyraum Testlampe"                
				(Ort_Hobbyraum)
				["Lightbulb"]
                {
                    homekit="Lighting"
                }

Switch          Testlampe_Hobbyraum_Einschaltstatus
                "Einschaltstatus Testlampe Hobbyraum"
                <switch>
                (Testlampe_Hobbyraum)     
				["Control", "Light"]				
                {
                    homekit="Lighting.OnState",
					channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness"
                }

Dimmer          Testlampe_Hobbyraum_Helligkeit
                "Helligkeit Testlampe Hobbyraum [%d %%]"
                <slider>
                (Testlampe_Hobbyraum)
				["Control", "Level"]
                {
                    homekit="Lighting.Brightness",
					channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness"                
                }

Number:Temperature         Testlampe_Hobbyraum_Farbtemperatur
                "Farbtemperatur Testlampe Hobbyraum"
                <colorpicker>
                (Testlampe_Hobbyraum)
				["Control", "ColorTemperature"]
                {
                    unit="K",
                    stateDescription=" "[                            
                            pattern="%0.f K",
							min="2202",
                            max="4000"                                                                                                       
                        ],
                    homekit="Lighting.ColorTemperature"[minValue=2202, maxValue=4000],
					channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature"
                }

My conclusion:

  • The current configuration of my lights seems to be odd: multiple channels linked to one item, units not set properly or units do not fit to the ranges, Maybe some rule is interfering? and finally the profiles should be removed
  • I will update my OH 4.2.1 Installation to 4.3.2 this Weekend, deactivate all rules that could interfere, set up "fresh" lights without any profiles that are similar to the configuration I posted at the very end of this thread

@blue-kaleidoscope
Copy link
Author

I just continued testing a little bit. I tested the following item definition on (1) my clean 4.3.2 test system and on (2) my productive system which I upgraded to 4.3.2:

Group           Testlampe_Hobbyraum
                "Hobbyraum Testlampe"                
                (Ort_Hobbyraum)
                ["Lightbulb"]
                {
                    homekit="Lighting"
                }

Switch          Testlampe_Hobbyraum_Einschaltstatus
                "Einschaltstatus Testlampe Hobbyraum"
                <switch>
                (Testlampe_Hobbyraum)     
                ["Control", "Light"]				
                {
                    homekit="Lighting.OnState",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness"
                }

Dimmer          Testlampe_Hobbyraum_Helligkeit
                "Helligkeit Testlampe Hobbyraum [%d %%]"
                <slider>
                (Testlampe_Hobbyraum)
                ["Control", "Level"]
                {
                    homekit="Lighting.Brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness"
                }

Number:Temperature         Testlampe_Hobbyraum_Farbtemperatur
                "Farbtemperatur Testlampe Hobbyraum"
                <colorpicker>
                (Testlampe_Hobbyraum)
                ["Control", "ColorTemperature"]
                {
                    unit="K",
                    stateDescription=" "[                            
                            pattern="%0.f K",
                            min="2202",
                            max="4000"
                    ],
                    homekit="Lighting.ColorTemperature"[minValue=2202, maxValue=4000],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature"
                }

On the test system the item behaves totally normal both on OH side and on Homekit side using my iPhone.
On the productive system the item behaves normal on OH side but on Homekit side, well... see here:

ScreenRecording_02-06-2025.13-59-13_1.mp4

During the whole interaction I recorded in this video NIL trace log messages are being created neither by deconz nor by homekit. As you can see in the item definition, there is no connection to a profile and I triple checked that no rule is interfering with the interaction. I start to believe I have to set up my system with a clean OH 4.3.2 installation again.

@ccutrer
Copy link
Contributor

ccutrer commented Feb 6, 2025

Wow, your video really shows how crazy the Home app is behaving! It's almost certainly an odd min/max/step getting published to Home (and possibly on the Brightness characteristic, not just the ColorTemperature characteristic). I'd really need to see the output of homekit show "Hobbyraum Testlampe" from the openHAB console to know where to look next. I'd hate to have you rebuild your entire openHAB install just to get to the end and have the same problem.

EDIT: one other thing I've seen is discontinuities when OnState and Brightness are linked to different items, even if those items are linked to the same channel, as you've done here. You could also try not using the Switch item at all, and linking both OnState and Brightness to the Dimmer item. And finally try adding autoupdate="false" on both items.

@blue-kaleidoscope
Copy link
Author

What if I told you ... that now the "Testlampe" item works on OH 4.3.2?!? To give you an answer I did the update to 4.3.2 again and created the item and for some very odd reason I can control the light now without any issues both on OH and on Homekit side. Believe me, I did nothing different than I did 3 hours ago. 😐

Here is the status of the light:

openhab> openhab:homekit show "Hobbyraum Testlampe"
1989351689 Hobbyraum Testlampe
Services:
  Service Type: AccessoryInformationService (0000003E-0000-1000-8000-0026BB765291)
    Characteristics:
      IdentifyCharacteristic: {"iid":0,"type":"14","perms":["pw"],"format":"bool"}
      ManufacturerCharacteristic: {"iid":0,"type":"20","perms":["pr"],"format":"string","value":"none","maxLen":255}
      ModelCharacteristic: {"iid":0,"type":"21","perms":["pr"],"format":"string","value":"none","maxLen":255}
      NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Hobbyraum Testlampe","maxLen":255}
      SerialNumberCharacteristic: {"iid":0,"type":"30","perms":["pr"],"format":"string","value":"Testlampe_Hobbyraum","maxLen":255}
      FirmwareRevisionCharacteristic: {"iid":0,"type":"52","perms":["pr"],"format":"string","value":"none","maxLen":255}
  Service Type: LightbulbService (00000043-0000-1000-8000-0026BB765291)
    Characteristics:
      OnCharacteristic: {"iid":0,"type":"25","perms":["pr","pw","ev"],"format":"bool","value":true}
      BrightnessCharacteristic: {"iid":0,"type":"8","perms":["pr","pw","ev"],"format":"int","value":100,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
      ColorTemperatureCharacteristic: {"iid":0,"type":"CE","perms":["pr","pw","ev"],"format":"int","value":250,"minValue":250,"maxValue":454,"minStep":1,"unit":"mired"}

Even the light item with the three channels now works like a charm. Like what the hell?!?
Item description:

// *** Deckenlampen Hobbyraum ***
Group           Deckenlampen_Hobbyraum
                "Hobbyraum Licht"
                (Ort_Hobbyraum)
                ["Lightbulb"]
                {
                    homekit="Lighting"
                }

Switch          Deckenlampe_Hobbyraum_Einschaltstatus
                "Einschaltstatus Deckenlampen Hobbyraum [MAP(de.map):%s]"
                <switch>
                (Deckenlampen_Hobbyraum, Einschaltstatus_Lichter)
                ["Control", "Light"]
                {
                    homekit="Lighting.OnState",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:brightness"
                }

Dimmer          Deckenlampe_Hobbyraum_Helligkeit
                "Helligkeit Deckenlampen Hobbyraum [%d %%]"
                <slider>
                (Deckenlampen_Hobbyraum, Lampen_Helligkeit)
                ["Control", "Level"]
                {
                    homekit="Lighting.Brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:brightness",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:brightness",
                    helligkeit=" " [
                            tageslicht=100
                        ]

                }

Number:Temperature          Deckenlampe_Hobbyraum_Farbtemperatur
                "Farbtemperatur Deckenlampen Hobbyraum"
                <colorpicker>
                (Deckenlampen_Hobbyraum, Lampen_Farbtemperatur)
                ["Control", "ColorTemperature"]
                {
                    unit="K",
                    stateDescription=" "[                            
                            pattern="%0.f K",
                            min="2202",
                            max="4000",
                            step="1"
                    ],
                    homekit="Lighting.ColorTemperature"[minValue=2202, maxValue=4000],
                    nightshift= " " [startzeit="21:00"],
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:color_temperature",
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:color_temperature",
                    farbtemperatur=" " [
                            tageslicht=250
                        ]
                }

And the respective status:

openhab> openhab:homekit show 90117409
90117409 Hobbyraum Licht
Services:
  Service Type: AccessoryInformationService (0000003E-0000-1000-8000-0026BB765291)
    Characteristics:
      IdentifyCharacteristic: {"iid":0,"type":"14","perms":["pw"],"format":"bool"}
      ManufacturerCharacteristic: {"iid":0,"type":"20","perms":["pr"],"format":"string","value":"none","maxLen":255}
      ModelCharacteristic: {"iid":0,"type":"21","perms":["pr"],"format":"string","value":"none","maxLen":255}
      NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Hobbyraum Licht","maxLen":255}
      SerialNumberCharacteristic: {"iid":0,"type":"30","perms":["pr"],"format":"string","value":"Deckenlampen_Hobbyraum","maxLen":255}
      FirmwareRevisionCharacteristic: {"iid":0,"type":"52","perms":["pr"],"format":"string","value":"none","maxLen":255}
  Service Type: LightbulbService (00000043-0000-1000-8000-0026BB765291)
    Characteristics:
      OnCharacteristic: {"iid":0,"type":"25","perms":["pr","pw","ev"],"format":"bool","value":true}
      BrightnessCharacteristic: {"iid":0,"type":"8","perms":["pr","pw","ev"],"format":"int","value":100,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
      ColorTemperatureCharacteristic: {"iid":0,"type":"CE","perms":["pr","pw","ev"],"format":"int","value":250,"minValue":250,"maxValue":454,"minStep":1,"unit":"mired"}

@ccutrer
Copy link
Contributor

ccutrer commented Feb 6, 2025

😂! My wife would say that it's because I looked at it, and things tend to work when I'm around.

Your ranges and step values look good in the HomeKit output. So yeah... I'm going to call this one as something was being (temporarily) weird with your environment, and close the issue now. Feel free to re-open if things regress in the future.

@ccutrer ccutrer closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2025
@ktgeek
Copy link
Contributor

ktgeek commented Feb 6, 2025

I've been having a lot of issues lately (which I've told @ccutrer about) where somewhere between HomeKit and OH, they get confused about colors. I wonder if you had the same symptom For HSB lights, I see it like at least H is very wrong, and B might be as well. I've had to comment them out and recreate them (I do items in files) to get them to get sorted out. Although, yesterday I did a clean-cache and that seemed to work short term, long term the jury is still out.

@Joachim2709
Copy link

I have the same issue. It seems to me that after a restart of openHAB, things got messed up. After commenting the items out and recreating them everything work until the next restart of openHAB.

@blue-kaleidoscope
Copy link
Author

I have the same issue. It seems to me that after a restart of openHAB, things got messed up. After commenting the items out and recreating them everything work until the next restart of openHAB.

Is it exactly the same behaviour as described above? If so, @ccutrer should have a look at this topic once more.

@Joachim2709
Copy link

Is it exactly the same behaviour as described above? If so, @ccutrer should have a look at this topic once more.

Yes, it is the same behaviour.

@blue-kaleidoscope
Copy link
Author

I can confirm what Joachim wrote. After a reboot all color temperature lights behave like in my video posted above. When I comment out all light items, let homekit load the instances and then add the light items again, then it becomes better but not perfect. I can control brightness without issue but the color temperature ranges are not properly taken.
Example:

This is the light I'd like to control:

Group           Deckenlampen_Hobbyraum
                "Hobbyraum Licht"
                (Ort_Hobbyraum)
                ["Lightbulb"]
                {
                    homekit="Lighting"
                }

Group:Switch:OR(ON,OFF)    Deckenlampen_Hobbyraum_Einschaltstatus
                "Einschaltstatus [MAP(de.map):%s]"
                <switch>
                (Deckenlampen_Hobbyraum, Einschaltstatus_Lichter)
                ["Control", "Light"]

Switch          Deckenlampe_Hobbyraum_Buecherregal_Einschaltstatus
                "Einschaltstatus"
                <switch>
                (Deckenlampen_Hobbyraum_Einschaltstatus)                
                {                    
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness"                    
                }

Switch          Deckenlampe_Hobbyraum_Mitte_Einschaltstatus
                "Einschaltstatus"
                <switch>
                (Deckenlampen_Hobbyraum_Einschaltstatus)                
                {                    
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:brightness"                    
                }

Switch          Deckenlampe_Hobbyraum_Schreibtisch_Einschaltstatus
                "Einschaltstatus"
                <switch>
                (Deckenlampen_Hobbyraum_Einschaltstatus)                
                {                    
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:brightness"                    
                }

Group:Dimmer:MAX    Deckenlampen_Hobbyraum_Helligkeit
                "Helligkeit"
                <slider>
                (Deckenlampen_Hobbyraum)
                ["Control", "Level"]
                {
                    homekit="Lighting.Brightness,Lighting.OnState",                    
                    helligkeit=" " [
                            tageslicht=100
                    ],
                    stateDescription=" "[                        
                        pattern="%d %%"
                    ]
                }

Dimmer          Deckenlampe_Hobbyraum_Buecherregal_Helligkeit
                (Deckenlampen_Hobbyraum_Helligkeit)
                {
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:brightness"
                }

Dimmer          Deckenlampe_Hobbyraum_Mitte_Helligkeit
                (Deckenlampen_Hobbyraum_Helligkeit)
                {
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:brightness"
                }

Dimmer          Deckenlampe_Hobbyraum_Schreibtisch_Helligkeit
                (Deckenlampen_Hobbyraum_Helligkeit)
                {
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:brightness"
                }

Group:Number:Temperature:AVG    Deckenlampen_Hobbyraum_Farbtemperatur
                "Farbtemperatur"
                <colorpicker>
                (Deckenlampen_Hobbyraum, Lampen_Farbtemperatur)
                ["Control", "ColorTemperature"]
                {
                    stateDescription=" "[
                            min="2202",
                            max="4000",
                            step="1",
                            pattern="%.0f K"
                        ],
                    unit="K",
                    homekit="Lighting.ColorTemperature" [minValue=2202, maxValue=4000],
                    nightshift= " " [startzeit="21:00"],                    
                    farbtemperatur=" " [
                            tageslicht=4000
                        ]
                }

Number:Temperature          Deckenlampe_Hobbyraum_Buecherregal_Farbtemperatur                
                (Deckenlampen_Hobbyraum_Farbtemperatur)                
                {                    
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Buecherregal:color_temperature",
                    unit="K"
                }

Number:Temperature          Deckenlampe_Hobbyraum_Mitte_Farbtemperatur                
                (Deckenlampen_Hobbyraum_Farbtemperatur)                
                {                    
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Mitte:color_temperature",
                    unit="K"
                }

Number:Temperature          Deckenlampe_Hobbyraum_Schreibtisch_Farbtemperatur                
                (Deckenlampen_Hobbyraum_Farbtemperatur)                
                {                    
                    channel ="deconz:colortemperaturelight:raspi4:Deckenlampe_Hobbyraum_Schreibtisch:color_temperature",
                    unit="K"
                }

When interacting with the color temperature in Homekit the warmest setting I can do is 2403 K and the coldest is 2865 K. Here is the status from the respective light:

openhab> openhab:homekit show "Hobbyraum Licht"
90117409 Hobbyraum Licht
Services:
  Service Type: AccessoryInformationService (0000003E-0000-1000-8000-0026BB765291)
    Characteristics:
      IdentifyCharacteristic: {"iid":0,"type":"14","perms":["pw"],"format":"bool"}
      ManufacturerCharacteristic: {"iid":0,"type":"20","perms":["pr"],"format":"string","value":"none","maxLen":255}
      ModelCharacteristic: {"iid":0,"type":"21","perms":["pr"],"format":"string","value":"none","maxLen":255}
      NameCharacteristic: {"iid":0,"type":"23","perms":["pr"],"format":"string","value":"Hobbyraum Licht","maxLen":255}
      SerialNumberCharacteristic: {"iid":0,"type":"30","perms":["pr"],"format":"string","value":"Deckenlampen_Hobbyraum","maxLen":255}
      FirmwareRevisionCharacteristic: {"iid":0,"type":"52","perms":["pr"],"format":"string","value":"none","maxLen":255}
  Service Type: LightbulbService (00000043-0000-1000-8000-0026BB765291)
    Characteristics:
      OnCharacteristic: {"iid":0,"type":"25","perms":["pr","pw","ev"],"format":"bool","value":true}
      BrightnessCharacteristic: {"iid":0,"type":"8","perms":["pr","pw","ev"],"format":"int","value":100,"minValue":0,"maxValue":100,"minStep":1,"unit":"%"}
      ColorTemperatureCharacteristic: {"iid":0,"type":"CE","perms":["pr","pw","ev"],"format":"int","value":349,"minValue":250,"maxValue":454,"minStep":1,"unit":"mired"}

@Joachim2709
Copy link

Btw HSB behaviour is also weired. Basically the same happens. Brightness cannot be controlled. Workaround is the same.

@blue-kaleidoscope
Copy link
Author

Good to know that I am not alone. ;-)
To add more info: openHAB for some reason decided to reboot a few minutes ago. Then Homekit was not controllable at all on the iPhone anymore. Each item showed state „Aktualisieren…“ (probably „Updating…“ in the English UI). I commented out all lights and added them and then it worked again. I now can also control the color temperature from my phone in the boundaries I gave via maxValue and minValue which I could not do this morning see here.

In other words: This seems to be a sporadical error with weird symptoms. Won‘t probably be easy to fix it. :-/

@Joachim2709
Copy link

Good to know that I am not alone. ;-) To add more info: openHAB for some reason decided to reboot a few minutes ago. Then Homekit was not controllable at all on the iPhone anymore. Each item showed state „Aktualisieren…“ (probably „Updating…“ in the English UI). I commented out all lights and added them and then it worked again. I now can also control the color temperature from my phone in the boundaries I gave via maxValue and minValue which I could not do this morning see here.

In other words: This seems to be a sporadical error with weird symptoms. Won‘t probably be easy to fix it. :-/

I don't think it is a sporadical error. Always happens after a openHAB restart (not only after a reboot), so from my point of view it's reproducable. As this happens after the migration 4.2 -> 4.3, question is what has been changed in the new version. May be it is a matter of the startup sequence? Don't have any 4.2 log files, but my gut feeling is that in 4.2 homekit was initialzed later. Just a guess, may be I am wrong.

@blue-kaleidoscope
Copy link
Author

Indeed, but what is sporadically were the weird min-max settings for CT described here. I have no clue where these boundaries came from and I could not reproduce the behaviour.

@ccutrer ccutrer reopened this Feb 10, 2025
@ccutrer
Copy link
Contributor

ccutrer commented Feb 10, 2025

I’m 75% sure the problem is that there becomes a mismatch between the iid assignment for characteristics between openHAB and the last time openHAB sent the accessory catalog to Home (and thus what Home has cached for iids).

To help me debug, I need log:set DEBUG io.github.hapjava.server.impl.http.impl.BinaryHandler (from console), the output of homekit show <accessory id> from console, and the log needs to capture the GET /accessories request and response from a Homekit controller (either kill the Home app, which may or may not work to trigger it to refresh it’s information, or add a new Accessory (like say Color TestLight "Test Color Light" { homekit="Lighting,Lighting.Brightness,Lighting.Saturation,Lighting.Hue" }), but I suspect that doing that would resolve the issue. So best would be if I can get that logging from when things are working, and then the homekit show output after when it starts acting weird.

I did find a place in the source code where optional accessories are iterated and added to the service from a HashMap, changing the order that they’re added (and thus the iid assignment from HAP-Java, which just assigns them in sequential order). I made sure that's sorted before they're actually added to HomeKit. It's a bit of a shot in the dark, but I think has a decent chance at fixing things. You can download a JAR with the fix (be sure to uninstall the HomeKit add-on if you drop it in to the /addons folder), or install it from console with bundle:update org.openhab.io.homekit https://github.com/ccutrer/openhab-addons/releases/download/homekit-20250210-03/org.openhab.io.homekit-4.3.3-SNAPSHOT.jar. After installing it, you should restart openHAB.

@blue-kaleidoscope
Copy link
Author

blue-kaleidoscope commented Feb 13, 2025

Please have a look at the log attached. Hope it helps.

openhablog.txt

At 11:08:36.668 I changed the minValue and maxValue of a CT light because the boundaries were wrong. Until then everything worked. Then we see the °C is non-linear, cannot convert messages again. At that time the home app could not be used anymore on my phone. It showed "Updating..." on each item. At 11:09:07.203 I removed lichter.items containing all my light items. At 11:09:20.294 I added lichter.items again. At 11:15:04.114 I removed the items file again because Homekit still did not respond. At 11:15:23.039 I added the items file again. From here on everything worked again as expected.

I could not see any weird behaviour of CT lights inside the home app, means the homekit show ... info I cannot provide yet.

I will try out the JAR and let you know how it worked out.

@Joachim2709
Copy link

Just threw your jar in the addon folder. Restarted openHAB. I had to remove homekit metadata "Lighting.Hue, Lighting.Saturation, Lighting.Brightness" and "Lighting.ColorTemperature" and add it again, restarted openHAB several times since then with no issues.

@blue-kaleidoscope
Copy link
Author

blue-kaleidoscope commented Feb 15, 2025

Unfortunately with the JAR the °C is non-linear, cannot convert errors are still appearing. Not directly after the reboot but again as described here: I updated the items file of the lights and then the error appeared and homekit does not react anymore. Exact same behaviour.

@andrewfg
Copy link
Contributor

andrewfg commented Feb 15, 2025

the °C is non-linear, cannot convert errors are still appearing

There is a fix for that in the pipeline openhab/openhab-core#4561 — EDIT now merged into OH Core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting feedback from the pull request author bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

No branches or pull requests

6 participants