-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[hue] Support to activate scenes #6043
Comments
FTR: #6044 |
I just wanted to create an issue regarding this topic. Great to see that someone is already working on scene support. However, I noticed that the PR request isn't there any more (got a 404 on clicking on that link). So what's the status on this? Anyway i will add a small bounty for your work leluna. |
Bounty added: @leluna: I also created another feature request regarding support for groups/rooms, maybe you are interested in working on this. |
@leluna : there is a problem to access your PR. But I see in your Git repository that you still have a branch for this PR: https://github.com/leluna/openhab2-addons/tree/huescene |
@leluna @lolodomo code-wise PR #6044 is reviewed and fine. We are missing a piece of documentation (see #6044 (review)). If you cannot access it here is my last comment:
|
@cweitkamp : any idea why I can't access this PR ? It shows me the Ooops page. |
No, sry. It happens in my phone too. |
I can't open the PR as well -> Ooops Page |
Strangely, even I myself cannot open the pull request :D I added a little documentation as well as example item/sitemap config, saw your message too late. Did not add the activation of a scene for a specific group though. Thanks for the support for groups btw! |
Cool, you are still there. |
Practically, you MUST select a group to create a scene, so it actually doesn't matter which group it applies to upon activation, as the scene is uniquely identified by the ID. If you then activate the scene for the wrong group, nothing happens, so it's essentially the same as activating it with group 0. It is only useful for subgroups / overlapping groups, e.g. in a house with multiple floors? Moving the channel to groups better fits the hue app design though, gonna do that I guess :) The scene ID is a internal technical ID assigned by the hue bridge (I added that in the readme), sadly not the scene name... I use the REST API to directly query the scenes (also in the readme). |
Ok, but do you have a request to get the available scenes for a particular room ? If we have, we should add a scene channel to a group thing type.
If it exists a REST API to get the scenes, we should use it to build a dynamic option provider for the "scene" channel at the bridge level and if possible at the group level.
No because it is very easy to add. Just provide the hue API and I will help you. Regarding your PR, I would suggest that your create a new PR based on the last code merged. |
I linked the REST API in the readme as I don't want to duplicate the Hue documentation. The REST path is simply /api/username/scenes. There is no reqeust to get the scenes for a particular room, you can only request all scenes. Theoretically, there are also LightScenes instead of GroupScenes. If you want to activate a LightScenes for all lights belonging to the scene, you have to use the group 0. Do you think we should leave the bridge channel in for that purpose? Or remove the brdige channel and add to readme that the group 0 should be used for that? All scenes created in the hue app are group scenes as far as I understood correctly.
|
Let me test the get scenes API to look at the result.
I am not sure yet. |
The bridge is keeping a lot of scenes with recycle=true, some scenes which are no more available. I don't know if there is a way to trash them ? You are right, a scene is linked to a set of lights (not to a group). |
And the options on channels will be updated by the light polling job. |
There are This impairs the filtering function for LightScenes but I think it behaves more consistently with the hue API? |
Thinking about it, I thing a clean implementation would be to create a new scene thing type. Auto discovery will be iomplemented to propose each scene in the openHAB inbox. The user will not have to care about the scene id in this case. The scene thing type will have a switch channel to run the scene. |
Maybe we can even make it formattable? I know from other bindings where you can use placeholders in the sitemap? |
I was talking about the option label. |
I just tested the API you provided to me. If there other APIs, I let you check what API has to be used and if you can add a group id in the Scene object. |
That would be quite a huge amount of things.... By default, hue creates the standard scenes (about 6?) for each group upon creation. If you have 3 groups, you would have 24 things already, I don't think that it improves the usability. |
They will appear in the inbox but the user has then the choice to create or not a thing type. |
But yes you're right, if the user plans to use most of the scenes in openHAB, this could make too many things to create. |
So let's continue with the channel and the scene id as command. |
Yeah I was also thinking about option label. That could still be done by using dynamic state options / ConfigOptionProvider? The |
You just have to create a |
I would suggest a new poll job for the scenes with a lower refresh frequency than for lights, maybe run every 10 or 15 minutes by default. This job will call getScenes, build the list of options and call stateDescriptionProvider.setStateOptions with it. That's all for the scene channel on the bridge thing. |
@lolodomo I added the channel to the group thing. However, I cannot test it as the groups are not discovered. If I define them manually, they remain offline. Using a fresh 2.5 SNAPSHOT docker image. Any idea what the reason could be? |
Enable TRACE logs and you should see what are the groups returned by getGroups() at every poll. Edit: still working well for me with a version just compiled from the branch 2.5.x. |
Seems like I had duplicate hue binding jars in place as I only changed the file ending of one.... dumb rookie mistake hide face sorry for the confusion! |
Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]>
* [hue] Add support for hue scene activation Closes #6043 This is the continuation of the PR #7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]> Signed-off-by: CSchlipp <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]> Signed-off-by: MPH80 <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]> Signed-off-by: Daan Meijer <[email protected]>
* [hue] Add support for hue scene activation Closes openhab#6043 This is the continuation of the PR openhab#7540 95% of credits go to leluna Signed-off-by: Laurent Garnier <[email protected]> Also-by: leluna <[email protected]>
I think the ability to activate scenes is really essential for hues. Although I've seen some tutorials on how to do this, none of them seem really none-trivial to me. I know that you can create the scenes as rules, but the scenes creator in the hue app is very convenient in my opinion.
The text was updated successfully, but these errors were encountered: