Looks good. Thanks!
That option is useless with a fixed IP, so you can disable it if you want, but it's pretty infrequent if things are working normally, so it's unlikely to matter much.
The pages to add devices never time out; they just keep refreshing, using whatever data was last fetched from the bridge. If you have new devices, you'll see them eventually; if you have none, you'll see that message indefinitely.
All,
CoCoHue version 5.0 has been released! (Thanks to all who tested before.) As usual, this is available from HPM (recommended) or from GitHub as a manual install (not recommended) or bundle ZIP install (recommended if doing manually). See the first post for more details.
No matter how you upgrade (HPM, bundle, or entirely manual), please note two important steps:
- Create a hub backup before upgrading! (This is because downgrading to 4.x, should you choose to, would require restoring a backup -- not just downgrading the app/driver code.)
- After upgrading, you must open the CoCoHue app and select "Done" if you are using the eventstream/server-sent events (Hue V2 API) option. You will likely see warnings about V1 DNIs in your logs if you do not, though these are warnings, not errors, and the app should continue to function. If you did this already and still see these entries, try it again a minute or two later.
Changes from 4.x include:
- More use of Hue V2 API throughout if enabled
- If you have this option enabled, open the CoCoHue app after upgrading and hit "Done" after upgrading (see above for more details)
- As a result of this: CoCoHue light, group, and motion sensor DNIs will change to use the Hue API V2 ID instead of the V1 ID, which means downgrading is not possible without restoring a hub backup (see above for more details)
- Removal of deprecated features:
- Pre-staging preferences (long deprecated)
- Pre-staging commands (alluded to a few posts above) -- neither of these features ever worked very will given that neither version of the API has a way to actually do this, and the driver keeping track (which is how these used to work) becomes problematic for groups, among other reasons these were never a good idea
- Motion sensor devices will no longer work unless the V2 API option is enabled in the CoCoHue app (which has long been recommended)
- Hue Labs activators (Hue suggests moving to replacement features, including dynamic scenes--which can be activated from CoCoHue, though the ability to enable the dynamic part if available and currently paused, is not yet available)
I am hoping that most users will not notice any changes. If you rely on any deprecated futures, CoCoHue 4.2 should be stable at this point and will remain available indefinitely, as mentioned above. See the first post for links to version 4.2.
Otherwise, I think these changes will set the stage for future changes that enable continued use of the V1 API for all Bridge users (Hue does say they'll remove this from new firmware eventually, but anyone still using the original Bridge can only use it) while making it possible to continue add V2 functionality with less legacy code to worry about for those cases.
Let me know if you run into any problems!
I just upgraded mine...and well...it seemed to go ok, but my logs are filling with:
dev:5562024-09-15 09:55:31.992 AMerrorjava.lang.NullPointerException: Cannot invoke method getAt() on null object on line 114 (method getHueDeviceIdV1
I definiteyly followed the directions and Hit "Done" in the app after upgrade, but something seems off.
S
I just have one sensor (outdoor type), and I had to manually swap out my old (V1-api version?) device for the new (V2-api version?) device that was created as part of this transition. To be clear, the new device version was not automatically added -- it was just populated as a new selection choice as a Sensor (and I like that approach).
That all seems to be working great now though, as is everything else -- thank you!
Given the increased reliance on V2 api, what are current thoughts on polling?
I still just left mine at 1 minute (as before), and I've never noticed or suspected any adverse hub-load issues with that, but are folks now lengthening the poll interval or has anyone turned it off completely?
Thanks again for your awesome work on this app -- it's been a cornerstone of my Hubitat experience from the very beginning!
Thanks for the reports! I think I figured this one out.
CoCoHue version 5.0.1 has been released with a fix for this specific issue. The best way to fix is probably to restore the hub backup you took before upgrading, then upgrade to 5.0.1 and try again (I'm positive everyone read the instructions and did this
).
If you didn't, this should eventually fix itself once data for the device comes in from the V2 API/eventstream. An easy way to make that happen is to use the Hue app to turn the light on or off (or just use the big switch at the top to do it for everything on your bridge, though if you have a large setup, this might cause a different error that I have not seen an easy fix for yet, the one where eventstream data gets cut off).
This really isn't supposed to happen; a "Done" is supposed to make these DNIs automatically upgrade to the new format. When I'm testing on my Hue Bridge that actually has a sensor added, I can re-check this conversion/update logic...otherwise, that approach certainly works, too! (For anyone who doesn't actually want to do this, just swapping the DNIs yourself -- and getting rid of the "old" device once that's all good -- should work, too.)
My thoughts: it's unlikely that 1-mintue polling should cause "adverse" affects on any hub, so these hubs more likely have other problems or paranoid users.
(I had mine set to 15 seconds when developing the original version of this app 5 years ago; I'm still here.) But for sure, less is better if you can swing it -- no point in doing things that don't actually need to be done.
But if you're using the V2 API, you might feel comfortable reducing that interval. I think I had mine set at 30 seconds before this (1 minute is the default). Now I have it set at 2 minutes, and I could probably go longer, but since everything is working well, I don't see the point. I don't recommend disabling it entirely, even though it seems like that should be OK, for two reasons:
- Once in a while, eventstream data gets cut off (resulting in a JSON parsing error in the logs and no data from that eventstream message actually getting parsed; this data is probably updates for light, group, or sensor states, so polling can still be helpful to catch up in this -- hopefully rare -- event)
- Color data on the V2 API uses only CIE xy color, not hue/saturation values as is (normally) present in the V1 API and is also the native color model for Hubitat. Accurate conversion seems difficult (some kind of conversion not so much, some discussion on this somewhere above), but I plan to re-visit this some day. But for now, another reason to keep it enabled is if you depend on color or CT data for lights or groups as reported under "Current States." (Sending commands is not a problem either way.)
Hope that helps!
I have 14 motion sensors. After upgrading they were no longer seen by the app. Ended up re-adding them all and deleting the originals. All is working well now with the exception that there is no battery status reporting on any of them. Motion, Temp and Illuminance all report. Any thoughts would be appreciated.
Never mind. I fixed it by going into the CocoHue Bridge Device and reinitializing. Battery status then appeared on all sensors
All very helpful additional info -- thank you again!
This shouldn't be necessary, so I suspect something is wrong with the automatic upgrade process for those. With this being the second such report, I'll look into it, but it might not be for another day or two (I don't actually use any Hue motion sensors, but I have a couple around for testing...). But that certainly works!
Not sure why battery wasn't reporting, but if this fixed it:
then the eventstream connection was probably lost, and this re-established that.
Sorry for any troubles, and thanks for the continued use/testing so I can get this all right (some day).
For now, anyone who depends on motion sensor events may want to hold off on upgrading to 5.x unless you don't mind the workarounds above.
Restoring the backup and upgrading to 5.01 worked a treat.
I had no errors, although until I turned the debug flag off on CoCoHue, my logs were getting spammed by hundreds of
app:1882024-09-15 04:08:27.578 PMdebuginitialize()
app:1882024-09-15 04:08:27.576 PMdebugupdated()
app:1882024-09-15 04:08:00.862 PMdebug Setting Bridge status to Online...
app:1882024-09-15 04:08:00.846 PMdebug Setting Bridge status to Online...
app:1882024-09-15 04:08:00.820 PMdebuggetBridgeData()
app:1882024-09-15 04:08:00.818 PMdebug Setting Bridge status to Online...
app:1882024-09-15 04:08:00.805 PMdebug Setting Bridge status to Online...
app:1882024-09-15 04:08:00.799 PMdebuggetBridgeData()
app:1882024-09-15 04:08:00.776 PMdebug Setting Bridge status to Online...
app:1882024-09-15 04:08:00.750 PMdebuggetBridgeData()
app:1882024-09-15 04:08:00.718 PMdebuggetBridgeData()
app:1882024-09-15 04:08:00.706 PMdebug Setting Bridge status to Online...
app:1882024-09-15 04:08:00.686 PMdebug Setting Bridge status to Online...
No idea if thats normal though!
Everything else seems to be working perfectly!
S
Thank you for all your efforts. Still a very good app/device that has been a rock solid staple of my smart home. Happy to contribute in any way.
Another quick update: version 5.0.2 futureproofs scene devices for future increased use of V2 API. Existing users will want to either restore to 4.x and re-upgrade (again, I'm sure you saved a backup
) or run the "Fetch Scene Data" command on each scene that already exists -- if using the V2 API. For now, this doesn't matter, but it puts some data there that will be necessary for activation when that uses the V2 API.
A mix of the two. ![]()
I secretly changed the setting names (to match conventional names, mostly an internal change). All remain disabled unless enabled and saved, which if you never saved is just a display issue of it showing the default value. I could make this a bit smoother for future upgraders by copying this value once, maybe... ![]()
I'm seeing an error aperiodically from CoCoHue:
Summary
dev:4392024-09-15 08:50:49.839 PMerrorgroovy.json.JsonException: issue parsing JSON array
The current character read is '}' with an int value of 125
issue parsing JSON array
line number 1
index number 2026
[{"creationtime":"2024-09-16T00:50:48Z","data":[{"id":"4608b345-5672-4864-9fa9-252cc1ee214b","id_v1":"/lights/19","on":{"on":false},"owner":{"rid":"138348f7-ce15-4d1f-a2b1-5dbb28919ddd","rtype":"device"},"service_id":0,"type":"light"}],"id":"f62ffb34-f980-462c-a560-d6d8f6413919","type":"update"},{"creationtime":"2024-09-16T00:50:48Z","data":[{"id":"586d2366-be13-4495-8be4-5876a779001c","id_v1":"/lights/11","on":{"on":false},"owner":{"rid":"215d0c1f-0df9-4cc7-8381-7da7e58d1a5b","rtype":"device"},"service_id":0,"type":"light"}],"id":"6a2f762a-0295-455f-bbe5-8797027b9905","type":"update"},{"creationtime":"2024-09-16T00:50:48Z","data":[{"id":"ba48d003-b438-4ba1-831c-01442121b20e","id_v1":"/lights/12","on":{"on":false},"owner":{"rid":"b509e38e-5ffb-4eb4-8248-1efde246aeda","rtype":"device"},"service_id":0,"type":"light"}],"id":"183ce066-1d2a-4b44-9061-9fe456e73e57","type":"update"},{"creationtime":"2024-09-16T00:50:48Z","data":[{"id":"382dde0c-0c47-4dbd-8e15-7c04e75c02dc","id_v1":"/lights/18","on":{"on":false},"owner":{"rid":"4a05d517-0c48-43b5-ae42-20b105afa4c3","rtype":"device"},"service_id":0,"type":"light"}],"id":"9b8798a5-c8a6-4389-b0cb-0f56d020fc16","type":"update"},{"creationtime":"2024-09-16T00:50:48Z","data":[{"dimming":{"brightness":50.34666666666666},"id":"6028bff5-9d11-41e1-8871-b05f1067a6e3","id_v1":"/groups/0","owner":{"rid":"2d046d66-316f-4934-8d5f-29ac591f1022","rtype":"bridge_home"},"type":"grouped_light"},{"dimming":{"brightness":39.92},"id":"8f6686ed-a055-480c-ab7a-5134b7598711","id_v1":"/groups/10","owner":{"rid":"71cddd72-d2b3-421c-9d46-446d716e573f","rtype":"room"},"type":"grouped_light"},{"dimming":{"brightness":50.86799999999999},"id":"6028bff5-9d11-41e1-8871-b05f1067a6e3","id_v1":"/groups/0","owner":{"rid":"2d046d66-316f-4934-8d5f-29ac591f1022","rtype":"bridge_home"},"type":"grouped_light"},{"dimming":{"brightness":51.44421052631578},"id":"6028bff5-9d11-41e1-8871-b05f1067a6e3","id_v1":"/groups/0","owner":{"rid":"2d046d66-316f-4934-8d5f-29ac591f1022","rtype":"bridge_home"}
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................^ on line 216 (method parse)
It's happened ~ half a dozen times in the last 16 hours or so. The error is always line 216 (method parse), but the JSON Array index changes.
S.
@bertabcd1234, I've got a good one for you. Everything seems to be working on 5.0.2 except the integration does not see my LightScenes that I manually created via the Hue API. I went this route in order to add the transitiontime parameter to a few themes. I couldn't get the parameter to work on a groupscene via the API, but it works wonderfully on LightScenes. When I select "Fetch Scene Data" on the LightScene, it kicks back the following:
java.lang.IllegalArgumentException: No json exists for response on line 338 (method fetchSceneDataResponseV2)
CoCoHue does not see the LightScenes when I go into scenes (it says Hue Scenes devices not found on Hue), but they definitely still work from Hubitat when I activate them since they were already installed prior to the upgrade to 5.0.x.
Any thoughts? I can look to see about converting them to a GroupScene, but wanted to let you know.
Yeah, only (the equivalent of) GroupScenes are supported from 5.x onward. The Hue app doesn't even let you create LightScenes anymore, and AFAIK the V2 API doesn't support creating them (or at least any distinction between them? only "scenes") either.
I don't have any LightScenes anymore to actually test with, and I wasn't sure if existing ones would even continue to work -- but it sounds like yours do. There is likely no need to do a "Fetch Scene Data" on these if you are using the V2 API because there is no data. They may eventually stop working when scene activation begins using the V2 API.
If you do re-create these as GroupScenes that would be converted to the V2 API, scene activation in V2 does allow specifying a transition time (duration) for activation (recall) instead of setting it in the scene itself, so if/when that is added to the integration, that might help your use case -- at least for Hubitat.
I assume V1? ![]()
This is the reason I dove into their API in the first place when transitioning to Hubitat. I loved how the Hue Bridge could transition smoothly from CT to a scene with colors and vice versa. As you probably know the Hue app only does this via its automation rules and not via scene creation (which makes sense if you want to keep things as user friendly as possible). I never could get the duration setting to take with API 2, but transitiontime worked using API 1 and only when creating LightScenes and never with GroupScenes. It was frustrating to say the least!
If you decide to add duration as a setting to scenes and need a Beta tester, please let me know as I use them all week in the early mornings and at night.
Just stopping in to say thank you primarily to @bertabcd1234 and also the beta testers for your work on this!
Another minor update: CoCoHue 5.0.3:
- uses the V2 API for scene activation (and off -- something I regret putting in since Hue has no concept of "deactivation," but I digress...it tries to find the room/zone/group or, in rare V1 cases lights, associated with the scene and turns that off). Right now, this is a transparent change, i.e., there are no functional differences (I hope!). Eventually, this will open up the possibility of using other features the V2 scenes API makes possible, like overriding transition time or level.
- upgrades descriptionText and debug logging settings from 4.x (I think...completely untested but very easy to fix with Preference Manager if not or you've already upgraded and want different settings -- I forgot to mention that the upgrade will disable both unless manually enabled and the preferences saved on the device detail pages due to some internal changes)
Installation instructions in the first post, as usual.