Adaptive Lighting support for HomeKit (iOS 14)

(For those out of the loop: adaptive lighting is a new HomeKit feature pretty much similar to what Circadian Lighting offers, or so it sounds)
As far as I understood, the new Adaptive Lighting feature in HomeKit on iOS 14 is something that needs to be supported in the bridge.
Hue has announced support for it later this year, IKEA hasn’t officially pronounced themselves about it. Doing it from Home Assistant would bring support for all the supported lights at the moment.

If I understand the stack correctly this should be possible. Also, for anyone who can offer me some pointers, I’d like to look into the pieces of code that would enable something like this.

Btw, I haven’t found any documentation about Adaptive Lighting so I’m only working from assumptions on how it all works.

(This is my first feature request in this forum, let me know if something could be better done)

Home Assistant uses the HAP-python library for it’s HomeKit functionality. For adaptive lighting to be added, it needs to be added to HAP-python first.

4 Likes

Thanks for the pointer.

Here’s the tracking ticket:

3 Likes

Bumping to see if anyone with the technical skills to help push this along is interested in working on porting this from HAP-NodeJS to HAP-Python

Bumping as well

Very interested in this as well. Love Homekit Adaptive Lighting but don’t like the automation limitations of Homekit scenes when it comes to automation

The tracking ticket just closed as the feature was added to pyHAP, what are the next steps?

Hello,

I added a minimal support to HAP-python and now I think about next steps. At this moment it should be possible to extend the HA exported lights with Adaptive Lightning, but the question now is how the actual light adaptation should work.

I see the following options at the moment:

  • Implement the whole adaptive lightning controller in the HomeKit integration. The time schedule will be provided by a HomeKit controller (iPhone/HomePod) and the integration responsibility is to just execute this schedule. What is not clear to me is how to present it in the HA UI. This option is the easiest, but it also lacks any customization options. I prefer this option, but it would possibly introduce a lot of additional code in the HomeKit integration with a functionality that I am not so convinced that should be there.

  • We can possibly map the light to some existing component (Flux/Adaptive Lightning), ignore the iOS provided schedule and toggle the integration switch when the adaptive lightning is selected in the Home App. This is weird, with implicit dependency, but way more customizable.

  • Ultimate solution would be to extend the HA light entity with a notion of associated controller to make it clear to the rest of the system and to the user that the light is now managed automatically. Such controller would be provided by Flux, Adaptive Lightning and the HomeKit integration. This would be nice but it requires structural change to relatively core components, but this must obviously be discussed by responsible maintainers.

If you have any other idea or preference on how this should work please suggest. I’d like to collect some feedback before I start implementing it.

5 Likes

Thanks a lot of all the heavy lifting.

As a user of circadian lighting, I already find myself having to customize the schedule in configuration, so duplicating it for the home kit wouldn’t be a problem (the suggestion in your first bullet point).

That as a first step before implementing the bigger structural changes you mentioned in your third bullet point, sounds like the best approach for me as the upgrade path for both adaptive lighting and circadian lighting becomes very similar and doesn’t create a dependency.

I’m also positive for the first option.

If you think about how adaptive lighting works for other devices in HomeKit:
As an example the native HomeKit Hue integration (which means the Hue Bridge is directly connected to HomeKit and not via HA).

There you can activate adaptive lighting for existing Hue lights one by one. There is no customization. Also in the Hue app there is no indication that adaptive lighting is on. If I want to deactive adaptive lighting, I have to do it in the Home app.

That’s exactly what I would expect from the HA integration. I should be able to enable adaptive lighting for some lights in the HomeKit Home app. No customizations. In HA I would only see in the logs that HomeKit is constantly changing brightness and color temperature values.

If I need customization or need to deactivate the function via HA, I should use the already existing custom components which implement customizable adaptive lighting.

4 Likes

Exactly this. No need to make it any more complicated than that. :sunglasses:

4 Likes

Option 1 looks like the most appropriate to me as well. The Home-app is in charge of managing the adaptive lighting, the schedule, colors etc. When making changes from HA, I think it should work similarly to how the Home-app behaves: when adaptive lighting is on:

  • you can change brightness, and color is slightly modified accordingly (less bright => warmer)
  • when you change color, adaptive lighting is turned off

What’s the current progress on this? How would I track the progress of this implementation and is there a way I could help contribute?

Which packages/repositories are responsible for this functionality?

I have a Nanoleaf bulb that I can set to adaptive lighting on Home app. If I add it to Home Assistant I have the ability to set adaptive lighting too, but if I export it back to Home with HomeKit bridge I can’t toggle the adaptive lighting feature from my Home app anymore. As everyone above I want to be able to use adaptive lighting and configure a bunch of more useful automations with home assistant.

1 Like

It looks like nothing has happened since the implementation that @vitkabele mentioned earlier in this thread, a whole year.

I just looked, i can’t find an open issue or pull request to core that adds this, even though I found a similar PR that talks about adding adaptive lighting to core, which then got a bunch of discussion and got locked down,

Any progress here?

Hi, sorry I can’t work on this anymore. I hope someone else will pick it up. I would still love to have the functionality.