kpsuperplane / homebridge-wiz-lan

Control Wiz lights over LAN
Apache License 2.0
115 stars 37 forks source link

feat: implement dynamic scenes selector #74

Closed krystofcelba closed 2 years ago

krystofcelba commented 2 years ago

Hi, I'm working on a implementation of dynamic scenes selector in Home app. So here is the first somehow usable version 🙂. I have tested it only on RGB bulb type so it would be fine if someone could test it with other types as well. Also I would appreaciate any sort of code review!

As the control for selecting the scene you want is used Television input selector added as service to the parent PlatformAccessory of the device so it get nicely listed under other light's control 🙂. The idea is taken from this article https://sprut.ai/client/article/2760 as well as this implementation in homebridge plugin https://bit.ly/3kju9Lc so thanks them!

Also I would like to say thanks for this project as well!

Solves #65

image
kpsuperplane commented 2 years ago

O.M.G. I'm not home right now so I won't be able to test this till Monday, but this is absolutely phenomenal.

Thank you so much for making this happen!

MoTechnicalities commented 2 years ago

That should make my wife happy! Don't forget to list circadian rhythm.

kpsuperplane commented 2 years ago

Merging, however will probably not be released for another few days as I decide how to address some lingering issues:

I pushed https://github.com/kpsuperplane/homebridge-wiz-lan/commit/9bd93e81892d7fe286307aaaf13cb21629ad6250 to do a couple things:

However two more issues remain:

kpsuperplane commented 2 years ago

https://user-images.githubusercontent.com/4126319/134281456-6054d9d9-ebde-4ce6-9565-612fbe43c64b.mov

jeanofthedead commented 2 years ago

Are we able to use Siri to set these dynamic scene "channels?" Does anyone know what the voice commands would be?

krystofcelba commented 2 years ago

@kpsuperplane

Hey, thanks for merging! Also, I'm testing your changes and they make sense, so far so good. Ad the issues you addressed at the very end of your message. I think that a somewhat good workaround could be to switch the accessory to separate tiles. I've attached a simple image guide on how to do it. This way you are able to control the light a see its brightness right from the room screen.

homekit_separate_tiles

@jeanofthedead About using Siri for switching the scenes, it seems that it's currently not possible to do that. The reason is that it's not possible to switch the homekit TV input with Siri, which is underlying used as the scene selector. The workaround is to create scenes for your favorite "wiz" scenes, where you set the light to the "wiz" scene you want and then ask Siri to switch to that scene with the name you chose for it

homekit_siri_scene

.

jeanofthedead commented 2 years ago

Interesting solutions! It looks like I am losing the actual scene selections, so I'm not sure what I'm doing wrong. They appeared initially, but now I can't see them (even though the light pictured is running the Warm White scene) in either Separate Tiles or combined tiles.

image

image

jeanofthedead commented 2 years ago

Sorry to be annoying, but I was wondering if anyone else was having the Scenes selector disappear, or any tips for getting them back?

kpsuperplane commented 2 years ago

Np, it's a bug im still working on

mahmoudalismail commented 2 years ago

@jeanofthedead I am having the same issue. This issue appears only when there is multiple lightbulbs registered. In that case, only one lightbulb has the scenes options and the rest disappear.

Thanks in advance @kpsuperplane for the fix and for this great plugin.

sbstnrch commented 1 year ago

WIZ added two new scenes: "Diwali" and "Alarm". May you add them too?