[RELEASE] CoCoHue: Hue Bridge Integration (including scenes!)

Updated to new version, lights still work but have some errors:


image

Although it still updates status and everything

Did you hit "Done" in the CoCoHue app after upgrading?

2 Likes

goshdarnit......

1 Like

I found that CocoHue Scenes are NOT treated as Hubitat Scenes and cannot be used in other Apps that use Hubitat Scenes. Is there a way to resolve this constraint?

Hue Scenes are setup by CoCoHue in Hubitat as switches / buttons that can be turned on or pushed for activation. What apps are you having problems with and what are you trying to accomplish?

1 Like

@bertabcd1234 I was looking at this today and came across the Hue developer page about type conversions Color Conversion Formulas RGB to XY and back. Have you tried the methods here and not found it reliable?

(I was thinking of trying to convert this to java/groovy for a project I am working on and thought I would see if you already have encountered issues that might save me some time.)

I have. :rofl: (But I don't mean it that snarkily. Haha. You can get reliably convertible-back-and-forth numbers, and I even got the same that Home Assistant reports with one of the algorithms I was using, but the issue is that the numbers just aren't correct. The hue/sat values calculated by this xy conversion are not accurate if you then use them to set hue/sat in hs mode--at best, you'll be in the same shade, but often a notably more or less white/unsaturated or a slightly different hue.)

1 Like

Any Apps that can use Hubitat Scenes, e.g. Advanced Button Controller which has a function to rotate between Hubitat Scenes.
Currently to achieve the same result, I created Rule Actions under Rule Machine.

Nothing besides Hubitat itself can create a Hubitat scene, which is what some apps specifically look for. But in pretty much any app, you can turn on a switch, and in many, you can (virtually) push a button. As mentioned above, eithrr of these would work. I know someone in the past created Hubitat scenes that juat activated CoCoHue scenes (possibly with more Hubitat devices added), since Hubitat scenes can also turn things on or push buttons upon activation, but I'm not sure I'd recommend that complexity.

Depending on what you're doing, my Dimmer Button Controller app, which works with lots of devices but also specifically CoCoHue scenes, may do what you want on the button-device side (though I'm not sure what that is).

For example, switching between the different scenes through a single button, i.e. move on to the next scene when the button is pressed.

Dimmer Button Controller can do that, as could a custom Rule.

Is Dimmer Button Controller an App or a physical device?

With the latest Hue V2 API 'push event' CoCo version installed, one thing I've noticed is that while the Hue light groups update instantly, Hue scene status doesn't seem to do the same?

I.e. if I set a motion sensor to turn on a CoCo Hue 'Group' of lights i.e. 'Lounge Group'- everything works perfectly, with on/off status updating imediately.

But if I swap out the 'Lounge Group' with a 'Lounge Scene' (i.e. Lounge - Arctic Aurora for example) the scene status does not update at all in Hubitat, even polling doesn't change the scenes state.

Am I doing something wrong or is this a bug/limit of the API?

Hue doesn't track scene states. On/off state is more or less imaginary on Hubitat for these, though there are some options you can use to determine how it's used.

On the command (not attribute/state) side of things, sending "On" will activate the scene; sending "Off" should turn off all lights in the associated room/zone or the individual bulbs if you have an old scene that was set up that way.

This may have changed with the v2 API (maybe Hue tracks on/off states for scenes now?), but I'm not currently using v2 to its full extent yet--just for as much of the instant-update feature as I can use it for now. This will change as I transition the entire app to v2, but unless Hue changed something, this particular behavior won't change.

1 Like

Thank you for clarifying! Ok, that explains things - will take a look at alternative approaches.

Hi, i could do with some help

i tried to add a light to my setup today and get "Error: Cannot invoke method getAllBulbs() on null object"

my lights still seem to work and the bridge status is online but the logs say different

i hope the screenshots help to understand whats wrong

Open the main page of the app and hit "Done," which you have to do the first time after updating to the 4.x series. That should fix the problem. (You can also remove the screenshot if you want--only the logs were helpful in this case. I'm not sure your Hue Bridge username/key is useful outside of your own LAN,but you may still wish to hide it.)

3 Likes

Thank you, working now.

Noticed that CocoHue doesn't survive from power cut. Not sure if it's because hue bridge's power is cut, Hubitat power is cut or both.
Hue works normally but CoCoHue logs error lines in Hubitat and some or all groups are not working. I need to test it more but it seems like individual bulbs are okay and problem is with groups.
It is fixed when saving CoCoHue app without doing any changes.

Anyone else seeing same?