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

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?


I can't work out why the stats are so different in fact the upstairs hub has far fewer bulbs than the downstairs and of course, we move around more downstairs. I'm getting Severe hub CPU load detected messages so trying to reduce load

Polling probably uses more resources than eventstream, so reducing that is interval if you have eventstream enabled is probably the best thing you can do to reduce resource usage (though I still don't recommend totally disabling it). That being said, I wasn't able to notice much of a difference on my hub even when I turned the frequency way up just to test. A C-5 or later is also likely to fare better than a C-4 or earlier due to a more efficient OS/platform layer on top of otherwise similar (though not identical) hardware. Otherwise, I'm not sure, especially without the column headings to see what's what. :smiley:

How long have you waited? There is an automatic reconnection process, though it could probably be improved upon. Also, sending commands to devices should always work in the current version (this would be more about getting eventstream data in in real time); if that fails, I'd be curious what the actual error is, but it probably means your Hue Bridge itself isn't yet accessible or perhaps its IP address changed during the outage (also should be recovered from but will take a discovery cycle).

There was snow storm and with that.. there was a lot of power cuts during these two days. Longest time I waited was 1h, and after that couple of 15min waiting but it never did fixed automatically. After that I started to go Cocohue application and save settings which seems to be the way to get groups working again.

My logs are not available anymore but I believe that when next power cut comes I can take those log lines and copy them here. If I remember right it just said something like " bridge xxxxx can' reconnect".. or "cant connect". At the same time Hue was working normally and I could operate bulbs and groups normally from hue application.

hi @bertabcd1234 . Is there, by any change possibility or way to add toggle switch function to CoCohue group devices? I'm trying to build myself dashboard stuff and I would need a toggle switch function..

Hubitat Dashboard should already toggle switches: if it's on, tapping the tile will turn it off, and if it's off, tapping the tile will turn it on. "Toggle" also isn't a standard Hubitat capability, so any app that does this (Dashboard, Rule Machine, etc.) implements this on its own with some sort of logic like this. Is this not working for some reason?

1 Like

Well this is a bit different dashboard that I'm using and toggle does not work same way on My case like it normally works. Thats why I would need a toggle attribute (?) for The group.

I'm not sure I can help more without knowing specifics, then, but I'd recommend that whatever dashboard solution you're doing read the switch attribute of the group device, then send an on() if it's currently off or an off() if it's currently on. Hubitat does not have a "toggle() command" or similar as standard, and I don't think it's a good idea to clutter group (or bulb) devices with an "extra" command like this, so my suggestion is to follow the convention and implement something like this at the app level if needed.

3 Likes