Lifx Clean

I have a couple of the Lifx Clean bulbs, wondering if it would be possible to enhance the Lifx integration to include the clean mode (HEV light)

This way could run cleans through automations, i.e. at a certain time, or when someone leaves the house.

This is already exposed on the LAN protocol

I am a programmer, but not Python, but more than happy to dedicate myself and setup to time and testing to get this implemented.

Thanks!

Also super interested in this, just got a couple of clean bulbs myself - can’t help with the programming side of things but I’m definitely happy to be a guinea pig as needed for testing purposes!

1 Like

I sent a PR to the maintainer of aiolifx (the library which Home Assistant uses to interface with LIFX) which adds support for LIFX Clean bulbs: Adds support for HEV Light Control (LIFX Clean) by micolous · Pull Request #47 · frawau/aiolifx · GitHub

Once that is merged by the maintainer, it will then need someone (who’s more familiar with Home Assistant) to write something that calls the new HEV methods I added in that PR.

1 Like

While the aiolifx author is very cooperative, it has been an issue for some time that aiolifx does not track new LIFX products. If you are willing to donate time for this it would probably make sense to switch to Photons as the upstream library.

I added the HEV support to Photons and have been doing small updates to the core lifx integration too. If no-one else does it, I’ll take a look this weekend at adding support for HEV using aiolifx.

Edited for clarity. Porting to Photons is a way bigger effort.

So the first bit is done (starting and stopping an HEV cycle via a new lifx.set_hev_cycle service. Next thing is to add the default HEV cycle configuration as config entities, which shouldn’t take that long, hopefully.

1 Like

Awesome! Thanks for taking the time

Basic HEV support is now complete. LIFX Clean devices have some additional state attributes that display the current/default HEV cycle details:

This requires an additional merge to aiolifx: Improve HEV support and product feature enumeration by Djelibeybi · Pull Request #52 · frawau/aiolifx · GitHub but the maintainer has been super responsive recently, so I don’t think that will take long. Once that’s available on PyPi, I’ll submit this as a PR.

Note I have based this additional functionality on top of my improvements to the LIFX discovery method which is yet to be merged into core: Refactor LIFX discovery to make it faster and more reliable by Djelibeybi · Pull Request #70458 · home-assistant/core · GitHub so this will depend on that being merged first too.

1 Like

The migration effort only gets bigger as more aiolifx-based features are added to the integration ;-).

I’ve been contributing to Photons for a while now and I have a proof of concept integration that uses it too. I’ve spent hundreds of hours on it already.

It literally requires an intermediate API between HA and Photons because the latter is more of a heavily opinionated framework than a library.

2 Likes

Looks like your PR’s got approved and merged! Very excited for this.

1 Like

I’m still waiting on the bigger refactor, but that should be in the beta tomorrow (hopefully). Please take that for a spin if you can, so we can be sure that the optimised discovery process works for as many folks as possible.

Will try and get a beta instance spun up at the weekend

2 Likes

@Djelibeybi posted a bug report regarding your updates to the Lifx discovery process, appears it has issues with lights that get powered off, it cannot then detect when they come back online.
Think you can look at it? It is infuriating, since not all of my lights are powered on 100% of the time yet.

It’s already fixed, they just haven’t merged the fix yet.

BTW, I hadn’t forgotten about HEV support: Add LIFX hev_cycle service and extra state attributes by Djelibeybi · Pull Request #73060 · home-assistant/core · GitHub

1 Like

@Djelibeybi Any chance this is still underway? I’ve been reading around the GitHub pages and it looks like there was a bit more complexity than anticipated, which I totally appreciate. Just selfishly wishing I could schedule the clean cycle through HA instead of the LIFX app haha!

It is still happening, but it had to wait until after this massive change to the integration: https://github.com/home-assistant/core/pull/74316

Next step is to add additional entities for each light, like RSSI (wifi signal strength) and a reboot button. :slight_smile:

1 Like

Now that 2022.8 is out, there are two PRs queued for merge that add diagnostic buttons and sensors:

After these are merged, I’m going to add some config sensors for IR brightness and HEV status (i.e. starting a HEV cycle manually). That’s probably it for the current integration, though I may create another one that provides locally powered animations for LIFX Tiles. I’m still noodling on that idea, though.

Any chance of an IR sensor etc?
Or even controls like that for HEV, there is one mention in the docs but nothing actually in HA.