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

[hue] Support for Groups/Rooms #7419

Closed
regnets opened this issue Apr 19, 2020 · 22 comments · Fixed by #7476
Closed

[hue] Support for Groups/Rooms #7419

regnets opened this issue Apr 19, 2020 · 22 comments · Fixed by #7476
Labels
bounty Issues with a Bountysource reward and the PRs that solve these enhancement An enhancement or new feature for an existing add-on

Comments

@regnets
Copy link

regnets commented Apr 19, 2020

It would be great to see the addition to rooms/groups to the hue binding.

Of course, you can achieve similar things with openHAB Groups, however the reliability using hue groups/rooms is higher and the response time is much shorter than using groups in openHAB.

For example, I got about 15 lights in my living room. If I switch the group on/off all lights turn on/off at the same time (I am not able to see a chronological order on how the lights switch on). If I am doing the same thing with openHAB groups I can clearly see an order on how the lights turn on and it takes a lot longer as all lights are activated in a serial way.

I saw that @leluna is working on support for scenes, so that might be another addition.

I will add a bounty for that feature request.

Thanks a lot

Cheers

Andreas

@regnets regnets added the enhancement An enhancement or new feature for an existing add-on label Apr 19, 2020
@regnets
Copy link
Author

regnets commented Apr 19, 2020

Bounty added:
https://www.bountysource.com/issues/91154112-hue-support-for-groups-rooms

@wborn wborn added the bounty Issues with a Bountysource reward and the PRs that solve these label Apr 19, 2020
@lolodomo
Copy link
Contributor

I can have a look.
If we create one thing for each group/room, what kind of channels should it have ? Only a switch channel ?

@lolodomo
Copy link
Contributor

I have already something working. I still need to add the update of the group state and then I will be able to provide a PR.

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Apr 25, 2020
@lolodomo
Copy link
Contributor

This is now implemented. The new thing type for a Hue group has a switch channel to turn on or off the lights in the group (room). Discovery is implemented too.

@regnets
Copy link
Author

regnets commented Apr 26, 2020

Hi lolodomo, that was a really fast development. I can test the binding tomorrow.

You said there there is only a switch channel? From the hue app it seems that you can control more than just the On/Off state. I am not sure how the api works, do you think it would be possible to also add a color/brightness/color temperature channel?

Cheers

Andreas

@regnets
Copy link
Author

regnets commented Apr 26, 2020

Maybe you could have a look at the unofficial documentation? It seems, that you can send besides the On/Off also all other parameters which can be send to an individual light.

http://www.burgestrand.se/hue-api/api/groups/

http://www.burgestrand.se/hue-api/api/lights/#changing-light-color-and-turning-them-onoff

Thanks a lot for your hard work so far.

Cheers

Andreas

@lolodomo
Copy link
Contributor

lolodomo commented Apr 26, 2020

I added the brightness control now.

One problem with a group color control could be that if your group/room has few lights without color control, I am not sure what could be the result. But I will be able to test, so I will see.
And what will happen if you have ligths with a different color mode in the group ?

@regnets
Copy link
Author

regnets commented Apr 26, 2020

I had a look at the PR, looks good! Will test it tomorrow.

Based on my experience, i think the hue bridge will just discard values for non-color lights. Same goes for the brightness with on/off units. So that might not be a perfect solution, However if you got large installations this will greatly reduce the command to send to the hue bridge and the commands send to the hue lights.

Besides the color channel also the color temperature would be a good addition.

@lolodomo
Copy link
Contributor

I have no lights with color temperature control, so I can try to add this control but I will not be able to test it.

@lolodomo
Copy link
Contributor

The hue app does not offer the feature to set the same color for all lights in a group. It rather shows to you the different lights on a color wheel and you can adjust each of them.

I can give the ability to send a color command for all lights in the group but to get the color state of a group, this is not obvious ! For dimmer, I computed the average of all lights. I am not sure how computing the average between different colors !

@lolodomo
Copy link
Contributor

lolodomo commented Apr 26, 2020

As color state for the group, I could set it to the color of lights in case they have all the same color and to white in case they have not the same color.

@regnets
Copy link
Author

regnets commented Apr 26, 2020

That would be absolutely OK for me. I would really like to see the option to control the color of a group of lights, it doesn't matter to me if the representation is black.

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Apr 27, 2020
lolodomo added a commit to lolodomo/openhab-addons that referenced this issue May 2, 2020
cpmeister pushed a commit that referenced this issue May 2, 2020
@Tomibeck
Copy link

Tomibeck commented Jun 7, 2020

@lolodomo

It seems to me that the behaviour of hue groups isn't consistent with hue lights in openhab yet their behaviour is the same with the hue API let me explain:

On the hue API, both groups and specific lights will only accept a hue, saturation, brightness change if they are already turned on or are turned on with the same API call.
From openhab I can send (100,100,100) (example) as a command to a hue bulb which is turned off and it is going to turn on with the desired values. Now if I do the same with a group which is turned off it will not turn on.
To me it looks like the binding makes sure that the bulb is turned on even though you only send hue,sat,bri. It doesn't with groups. I think it would make things easier if the groups behave the same way because otherwise, you would need to send an on command to the switch item of the group followed by a second (100,100,100) command to the color item

@lolodomo
Copy link
Contributor

lolodomo commented Jun 7, 2020

The handling of groups and lights by the binding is the same.
I will try again your case but I am sure it was working.
What is your way to send the color? With what UI? With a rule?

@Tomibeck
Copy link

Tomibeck commented Jun 7, 2020

I use jython via js323 with the helper libraries this is my test code :

`from core.rules import rule
from core.triggers import when

@rule("Testrule", description="Optional Rule Description")

@when("Item LA_Motion_OR received update")

def my_rule_function(event):
events.sendCommand("Fernseherlinks", "129,0,20")

`
described works with the single light item but not with the group ( room)

LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this issue Jun 8, 2020
@Tomibeck
Copy link

@lolodomo : ANy updates can I somehow help?

@lolodomo
Copy link
Contributor

I just tried this command in console: smarthome:send LampesHueSalon "129,0,20"
Here are the logs:

19:50:51.446 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'LampesHueSalon' received command 129,0,20
19:50:54.065 [INFO ] [smarthome.event.ItemStateChangedEvent] - LampeConsole changed from 35,100,0 to 129,0,0
19:50:54.075 [INFO ] [smarthome.event.ItemStateChangedEvent] - LampeTeleviseur changed from 0,100,0 to 129,0,0
19:51:04.235 [INFO ] [smarthome.event.ItemStateChangedEvent] - LampeConsole changed from 129,0,0 to 35,100,0
19:51:04.248 [INFO ] [smarthome.event.ItemStateChangedEvent] - LampeTeleviseur changed from 129,0,0 to 0,100,0

With a simple hue light, it seems to work better:

2020-06-10 20:09:08.130 [ome.event.ItemCommandEvent] - Item 'LampeConsole' received command 129,0,20
2020-06-10 20:09:14.058 [vent.ItemStateChangedEvent] - LampeConsole changed from 24,77,0 to 180,1,20

I will have a look.

@Tomibeck
Copy link

@lolodomo thanks! The State within openhab changes in both cases for me. Just the physical things don't react in case of a group. Let me know if I can be of any help.
BTW I greatly appreciate your work on adding groups!

@lolodomo
Copy link
Contributor

@Tomibeck : could you please open a new issue for your problem.
I can confirm your issue. I will put my analysis in the new issue.

@lolodomo
Copy link
Contributor

Good news, I know how to fix the issue.
So it is no more required to open the issue,.

@lolodomo
Copy link
Contributor

@Tomibeck : PR #7907 is fixing the issue.

@Tomibeck
Copy link

@lolodomo thats amazing thanks a lot

J-N-K pushed a commit to J-N-K/openhab-addons that referenced this issue Jul 14, 2020
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this issue Jul 26, 2020
Fix openhab#7419

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: CSchlipp <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this issue Sep 1, 2020
Fix openhab#7419

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this issue Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty Issues with a Bountysource reward and the PRs that solve these enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants