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

feat: implement dynamic scenes selector #74

Merged
merged 3 commits into from
Sep 22, 2021

Conversation

krystofcelba
Copy link
Contributor

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

…c funcs

The accessory is now passed instead of the single (LightBulb) service so multiple services
could be managed in the pilot functions etc.
If I understand it correctly the code inside this if is valid for RGB bulbs as well.
Please correct me if I'm wrong.
@kpsuperplane
Copy link
Owner

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
Copy link
Contributor

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

@kpsuperplane kpsuperplane merged commit 0027c50 into kpsuperplane:master Sep 22, 2021
@kpsuperplane
Copy link
Owner

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

I pushed 9bd93e8 to do a couple things:

  • Sync the state of the "TV On/Off" button with the light
  • Add a "No Scene" option that is selected when no scene is selected (and when reverting back to normal color mode)

However two more issues remain:

  • Because HomeKit considers TV On/Off and Lightbulb On/Off separate things (and I can't remove either of them), you can now only toggle the bulb on and off from the overlay (instead of just tapping on the tile)
  • The tile now displays a somewhat confusing "All On" label and no longer displays the actual brightness of the bulb

@kpsuperplane
Copy link
Owner

RPReplay_Final1632283167.mov

@jeanofthedead
Copy link

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

@krystofcelba
Copy link
Contributor Author

@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
Copy link

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
Copy link

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
Copy link
Owner

Np, it's a bug im still working on

@mahmoudalismail
Copy link

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants