[BETA] Hue (Re)Connect - with scene handling

I’m attempting to reset my hub. I want to rule out these problems. I cannot even reset my hub through the IDE or STM app. Something went really wrong, not certain what the reason…

I tried the app… it did not work.

Maybe it’s a coincidence, but the post update problems that have been plaguing a lot of people started doing the same to me as soon as this was installed.

Without logs I can’t tell works fine for me and others. Thanks to provide feedback with logs.

It’s a coincidence, I didn’t get a chance to install this, but my problems started yesterday. Maybe works backwards for me and after I install this my other problems go away :wink:

2 Likes

What kind of issue did you have? That’s funny…

Major zigbee issues with my entire mesh…

It was a joke… I know this app had nothing to do with it…

I can’t wait until the problems are fixed so I can install this app and use it like it’s meant to be.

2 Likes

This is too cool! Everything worked smoothly here. And being able to add the scenes in routines is double awesome! Thanks again…

3 Likes

Works really good.

How can I add new scenes? If I add a scene in the Hue App, it doesnt show up in the re-connect search and find area

1 Like

When you add a scene on your app, be sure to trigger it one or two times (this will push the scene to the hue bridge). Then it should appear. Beware, you can have duplicate of scene due to HUE Bridge limitation with scenes.

Can you elaborate on this?

Read this:

https://github.com/CyrilPeponnet/smartthings/tree/master/smartapp/HueConnect#important-notes

1 Like

NOW WORKING FOR ME! The object “it.value.lights” is null on my hub and it was not being mapped correctly; therefore, I added an additional condition check in code. The following code revision beginning at line 254 fixed this issue for me:

Map scenesDiscovered() {
def scenes = getHueScenes()
def scenemap = [:]
if (scenes instanceof java.util.Map) {
scenes.each {
def value = null
if (!it.value.lights){
value = “${it.value.name.minus(~/ on \d+/)} Scene”
} else {
value = “${it.value.name.minus(~/ on \d+/)} ${it.value.lights}”
}
log.debug it.value // See if lights value exists in map
def key = app.id +"/"+ it.value.id
scenemap["${key}"] = value
}
} else { //backwards compatable
scenes.each {
def value = “${it.name}“
def key = app.id +”/”+ it.id
scenemap["${key}"] = value
}
}
return scenemap
}

EDIT: I wonder if the number of lights displayed in the scene selection dialog is causing a problem? All of my scenes have in excess of 25-30 lights associated with each scene.

This code fixed the issue for me, and I am very happy with the results!

Thanks for the great addition to this app!!!

1 Like

This is really weird, could you so something for me?

curl "http://<IP_OF_YOUR_HUB>/api/<USERNAME>/scenes"

An replace:

PS: if you don’t have curl just pour the URL “http://<IP_OF_YOUR_HUB>/api//scenes” in your browser and paste me the result in a gist (https://gist.github.com) and give me the link to it. I’d really to understand what is going on.

Just sent it via PM…

I have added some scenes and modified some existing ones, but I cannot get the reconnect app to discover them. Any suggestions besides triggering them on Hue side, that doesn’t seem to do the trick for me… looking at the logs, it says hub discovered previously and just polling after that. Does it mean i need to delete app and start over to trigger rediscovery?

I am working on a potential fix. I’ll let you know.

1 Like

Ok Guys, I pushed some fixes. (to the smartapp and the bridge device)

  • fetch new scene, works fine now, you just need to wait for the refresh
  • better handling of bridge response

I notice something that I cannot fix. When triggering a scene if you fetch the light state through the HUE API, it could take like 4/5s to get the real state for certain lights (they appear as off till then). So I added a timed refresh when you trigger a scene (10 s) this way the lights states should be good when fetched.

1 Like

This happens with the official app too. Just happened to me yesterday. No more than 20 bulbs at the time.

Logs when tou have the issue could help :slight_smile: or give me 20+ bulbs for testing :stuck_out_tongue:

1 Like