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

Groups always appear as turned off, running deCONZ beta #227

Closed
s4y opened this issue Dec 13, 2017 · 7 comments
Closed

Groups always appear as turned off, running deCONZ beta #227

s4y opened this issue Dec 13, 2017 · 7 comments

Comments

@s4y
Copy link

s4y commented Dec 13, 2017

Whenever I turn a group on via HomeKit, it turns itself off again (in the UI) after a moment. Running homebridge -D turns up this:

[12/13/2017, 12:30:39 AM] [Hue] Bedroom: group all_on changed from true to undefined
[12/13/2017, 12:30:39 AM] [Hue] Bedroom: set homekit power from 1 to 0

If I look at the API myself, I see a key called any_on, but nothing called all_on. I'm not sure if this is broken or changed in recent deCONZ betas (I'm currently running 2.04.97).

@ebaauw
Copy link
Owner

ebaauw commented Dec 13, 2017

Indeed, deCONZ doesn’t (yet?) support state.all_on, but homebridge-hue expects both state.any_on and state.all_on. I haven’t used groups for a long time, probably not since I moved to deCONZ, so this has probably been broken since I started supporting deCONZ.

The trick is that you want to be able to turn the group on, as long as all_on is false, and you want to be able to turn the group off, as long as any_on is true. I think I base the value of On (power) on state.all_on and expose state.any_on as a custom characteristic. Of course when changing the value from HomeKit, both change action.on.

I think I probably need to base the value of On on action.on when state.all_on isn’t available, but then the group will not turn on in HomeKit when you turn on all its lights individually.

@s4y
Copy link
Author

s4y commented Dec 14, 2017

Interesting. This makes me think of something — my use case for groups is to make actions that affect multiple bulbs atomic. If I have a HomeKit scene that turns on or off multiple lights without using groups, there's usually a slight spread in when each light responds (which is especially weird when there are several bulbs in one fixture.

Do you know if HomeKit/Homebridge supports batch commands? Meaning, if I activate a scene that changes multiple lights, is it possible to receive in the plugin all at once? If so, I could imagine either ignoring groups and passing that through to deCONZ (if possible), or transparently converting a HomeKit command that affects the individual lights in a group into one which affects the group directly.

I'm just thinking out loud, not expecting you to implement it :-). (I also realize that this is a separate question from changing this mapping.)

@s4y
Copy link
Author

s4y commented Dec 14, 2017

Oh, and more on topic, the fix you described sounds like it would work for me. The main confusing bit about the current behavior is that changing the state of a group doesn't "stick", and using action.on would solve that. Thanks for looking at my bug report!

@ebaauw
Copy link
Owner

ebaauw commented Dec 14, 2017

my use case for groups is to make actions that affect multiple bulbs atomic.

That was my use case as well, in addition to reducing the traffic between homebridge-hue and the Hue bridge (see #15).

Do you know if HomeKit/Homebridge supports batch commands?

HomeKit does, homebridge doesn't, see homebridge/homebridge#1455.

I actually use Hue bridge scenes as "batch". homebridge-hue doesn't (yet?) expose scenes to HomeKit (see #158 - would love to hear your view on that one), but they can be recalled from a Hue bridge rule, which is triggered by a CLIPGenericFlag, which homebridge-hue exposes as a Switch. The HomeKit automation changes the Switch, or I flip the switch manually from a widget (works great on the Apple watch) or let Siri do it. Another HomeKit automation turns on my Sonos speakers at the same time.

Oh, and more on topic, the fix you described sounds like it would work for me.

Time permitting, I'll have a look over the weekend, otherwise during the holidays. Maybe it's easier for me to create a PR for deCONZ to support state.all_on, otherwise I'll create the workaround in homebridge-hue.

@ebaauw
Copy link
Owner

ebaauw commented Dec 15, 2017

Maybe it's easier for me to create a PR for deCONZ to support state.all_on

It is: dresden-elektronik/deconz-rest-plugin#330

@ebaauw
Copy link
Owner

ebaauw commented Dec 16, 2017

PR has been accepted and merged, but didn't make it into deCONZ v2.04.99. Need to wait for the next version (or compile the REST API plugin yourself from the lastest commits on GitHub).

@ebaauw ebaauw closed this as completed Jan 4, 2018
@s4y
Copy link
Author

s4y commented Jan 20, 2018

Thanks so much for the PR! …and sorry for not replying sooner. I was holding off on trying to build deCONZ because they had been releasing so regularly, but it's been long enough now that I may give it a shot.

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

No branches or pull requests

2 participants