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

Does it handle Hue Beyond and the lights that come with the Dimmer Switch?

It has been tested on the dimmer switch lights. Haven’t tested it with hue beyond.

I’ll volunteer for the latter sometime this week when I get a spare hour or so.

(“Yes dear, you’re not going to be able to control the living room lights via Alexa for about half an hour. Sorry.”)

Has anyone had issues importing scenes? I installed this app, and it’s able to see the bridge, bulbs and groups, but isn’t able to see any scenes. I created two custom ones, and it keeps saying 0 scenes on the smartapp config screen. Any ideas?

Here’s a relevant section of the logfile

4605071e-0a53-427a-942e-d4f45a8257e2  5:33:08 PM: debug parse() - [name:saturation, value:79,     isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) saturation is 79]
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:08 PM: debug Its a scene
4605071e-0a53-427a-942e-d4f45a8257e2  5:33:08 PM: debug parse() - [name:alert, value:select, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) alert is select]
e4be3c27-7de1-4cbd-b233-d7de4c6f03e5  5:33:08 PM: debug parse() - [name:effect, value:none, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) effect is none]
f7a9e72e-bee8-4d05-90d9-35a5420cd719  5:33:08 PM: trace Get state for [QO0Nd6BbTr0mbhd, LlmyaiW8EblzFOb, ZABK2GQoEOLmISR, x5t9c8p1rpGJKKf, 1sxNEF0V7KghpNI, F7n9YQxLttVO2mG, xhsmphYH2eMMVwC, oiyeVVxtYmS5Ox6, i8GYnoka9NDXIBI, eHpctNCGjQ8B0Mb, qVJnm5z68zYgJJD, vYpABTxIuTZY08V]
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:08 PM: debug Its a scene
e4be3c27-7de1-4cbd-b233-d7de4c6f03e5  5:33:08 PM: debug parse() - [name:alert, value:select, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) alert is select]
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:08 PM: debug Its a scene
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:08 PM: debug Its a scene
4605071e-0a53-427a-942e-d4f45a8257e2  5:33:08 PM: debug parse() - [name:color, value:#E4571A, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) color is #E4571A]
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:08 PM: trace Adding items to state...
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:08 PM: debug Its a scene
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:08 PM: debug Its a scene
e4be3c27-7de1-4cbd-b233-d7de4c6f03e5  5:33:08 PM: debug parse() - [name:color, value:#FD013D, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) color is #FD013D]
e4be3c27-7de1-4cbd-b233-d7de4c6f03e5  5:33:08 PM: debug parse() - [name:level, value:76, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) level is 76]
e4be3c27-7de1-4cbd-b233-d7de4c6f03e5  5:33:08 PM: debug parse() - [name:switch, value:on, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) switch is on]
7c66d160-33b0-473e-a122-0d35bc00da11  5:33:08 PM: debug parse() - [name:alert, value:select, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) alert is select]
7c66d160-33b0-473e-a122-0d35bc00da11  5:33:08 PM: debug parse() - [name:effect, value:none, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) effect is none]
7c66d160-33b0-473e-a122-0d35bc00da11  5:33:08 PM: debug parse() - [name:saturation, value:99, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) saturation is 99]
7c66d160-33b0-473e-a122-0d35bc00da11  5:33:08 PM: debug parse() - [name:hue, value:100, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) hue is 100]
7c66d160-33b0-473e-a122-0d35bc00da11  5:33:08 PM: debug parse() - [name:color, value:#FD0101, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) color is #FD0101]
7c66d160-33b0-473e-a122-0d35bc00da11  5:33:07 PM: debug parse() - [name:level, value:76, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) level is 76]
7c66d160-33b0-473e-a122-0d35bc00da11  5:33:07 PM: debug parse() - [name:switch, value:on, isStateChange:true, displayed:true, linkText:Hue (ReConnect), descriptionText:Hue (ReConnect) switch is on]
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:07 PM: trace Bridge: 00178846337E - Host: 192.168.1.11:80
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:07 PM: trace Bridge: 00178846337E - Host: 192.168.1.11:80
416d0290-e9f8-4eb0-8f75-c79591bf890e  5:33:07 PM: debug Discovering New Groups

Figured it out. It looks like the Hue API response may have changed. The logic that filtered out ‘default’ scenes relied on the scene name containing a timestamp in it, but that isn’t the case anymore (or at least on my bridge). If you run into the same issue, you just need to comment out 3 lines in the sceneDiscovered function (around line 300)

if (it.value.id == sceneTime?."${it.value.name.minus(~/ on \d+/)}"?.id && it.value.name ==~ /.* on \d+$/)

This if as well as the following else and associated brackets need to be commented out. Then it works. You do end up with the default scenes, but that’s not a huge deal. It’s also possible to filter them out by name if it bothers you too much. That would be done in the same spot, just a simple name check there.

I just installed and everything was going perfect until no scenes appeared, i have pasted a bit of the log file not sure what part would help. Plus i’m not sure what the funny groups names are.

80f27002-a68e-4271-b4ff-a8692e14813d 11:46:50 PM: debug Its a scene

80f27002-a68e-4271-b4ff-a8692e14813d 11:46:50 PM: debug Its a scene
80f27002-a68e-4271-b4ff-a8692e14813d 11:46:50 PM: debug Its a scene
80f27002-a68e-4271-b4ff-a8692e14813d 11:46:50 PM: debug getChildDevices(false), children=10
80f27002-a68e-4271-b4ff-a8692e14813d 11:46:50 PM: debug Response Body: {“ULikZHX-vKJptLN”:{“name”:“Relax”,“lights”:[“1”,“2”,“3”],“owner”:“Q8p9DQBV0jzI33UMrwhuu7WBaawbx8LzFtRh47a6”,“recycle”:false,“locked”:false,“appdata”:{“version”:1,“data”:“VPv0B_r01_d01”},“picture”:"",“lastupdated”:“2016-11-17T13:55:16”,“version”:2},“atmPem7BMOiChCq”:{“name”:“Read”,“lights”:[“1”,“2”,“3”],“owner”:“Q8p9DQBV0jzI33UMrwhuu7WBaawbx8LzFtRh47a6”,“recycle”:false,“locked”:false,“appdata”:{“version”:1,“data”:“UnTWS_r01_d02”},“picture”:"",“lastupdated”:“2016-11-17T13:55:16”,“version”:2},“a1wyxSk2h2CSWf3”:{“name”:“Concentrate”,“lights”:[“1”,“2”,“3”],“owner”:“Q8p9DQBV0jzI33UMrwhuu7WBaawbx8LzFtRh47a6”,“recycle”:false,“locked”:false,“appdata”:{“version”:1,“data”:“wmoNk_r01_d03”},“picture”:"",“lastupdated”:“2016-11-17T13:55:16”,“version”:2},“eor9jfu0O3SFIjZ”:{“name”:“Energize”,“lights”:[“1”,“2”,“3”],“owner”:“Q8p9DQBV0jzI33UMrwhuu7WBaawbx8LzFtRh47a6”,“recycle”:false,“locked”:false,“appdata”:{“version”:1,“data”:“7DOHW_r01_d04”},“picture”:"",“lastupdated”:“2016-11-17T13:55:16”,“version”:2},"bDSSKcVqZLf1n6p…[TRUNCATED]
80f27002-a68e-4271-b4ff-a8692e14813d 11:46:50 PM: debug Its a scene

Uh… literally the two posts above yours.

lol, it was getting very late last night.

I will give that a go now, i wonder if that’s the same reason my Logitech Harmony cannot see scenes?

Worked a treat thanks kolosy

Glad to hear it.

Logitech scenes - you mean an integration between the Harmony home and Hue? Or something through ST? I have both of those, but haven’t looked to hook them together yet…

Question: Is there a way to install this without removing the original connect and or a way to remove the original connect without loosing the current lights in the database? I have lots of things setup using the original connect so it would basically require me to completely overhaul the entire system. Thx.

Any help with this error will be greatly appreciated.

error physicalgraph.app.exception.UnknownDeviceTypeException: Device type ‘Hue Bridge’ in namespace ‘smartthings’ not found. @ line 598

I received this error after installing ReConnect, connecting to the Hue bridge, selecting the Hue bulbs and selecting the Hue Groups. It happens when click Done with a red “An unexpected error occurred.” message

BTW it happens when if I don’t select any of the bulbs or Groups.

Line 598 is d = addChildDevice(“smartthings”, “Hue Bridge”, selectedHue, vbridge.value.hub)

You get this error if you didn’t install the DeviceTypes that are needed.

Thanks Arnoud, that sent me in the right direction.

For those with the same issue here is a bit more detail:

Login to https://graph.api.smartthings.com
Go to My Device Handlers section
Click on Create New Device Handler
Select From Template
Select Phillips Bridge then Create
Select Phillips Bulb then Create

Actually, when you go to the github page for this project, you’ll find all the device types you’ll possibly need…

Hi,

I installed this app but somehow scenes are not getting discovered. I have e created them using official hue app on android from philips. I tried reinstalling this smartapp but no use. Any idea what might be wrong?

Thanks

I don’t think github integration is properly working with this repository. Is there any chance of adding version numbers or dates to the code going forward so we can tell if our devices/apps are outdated or not? Thanks!

Thank you! I’m late to the game and this was driving me nuts! Commenting out those lines fixed the issue with scenes not being discovered.

Can someone please help me identify the specific lines that need to be commented out to make scenes discoverable again? I don’t know how to read code so I’m having trouble. It looks like the one pasted above is line 318 but I don’t see the following else statement. 318-325?

Thanks for any help.

That is the correct line. You need to remove that along w/ the curly braces that encompass the body of that if statement, so if your code currently looks like this:

if (it.value.id == sceneTime?."${it.value.name.minus(~/ on \d+/)}"?.id && it.value.name ==~ /.* on \d+$/)
        {
            log.trace "Adding ${it.value.name} to scene list"
            def lights = it.value.lights ? " ${it.value.lights}" : ''
            def value = "${it.value.name.minus(~/ on \d+/)}${lights}"
            def key = app.id +"/"+ it.value.id
            scenemap["${key}"] = value
        }

you could either comment out those lines (in case you want to easily revert:

//if (it.value.id == sceneTime?."${it.value.name.minus(~/ on \d+/)}"?.id && it.value.name ==~ /.* on \d+$/)
  //{
      log.trace "Adding ${it.value.name} to scene list"
      def lights = it.value.lights ? " ${it.value.lights}" : ''
      def value = "${it.value.name.minus(~/ on \d+/)}${lights}"
      def key = app.id +"/"+ it.value.id
      scenemap["${key}"] = value
  //}

or just remove those lines if you don’t care:

log.trace "Adding ${it.value.name} to scene list"
def lights = it.value.lights ? " ${it.value.lights}" : ''
def value = "${it.value.name.minus(~/ on \d+/)}${lights}"
def key = app.id +"/"+ it.value.id
scenemap["${key}"] = value

Right now I’m trying to see if there’s any other way to determine the default scenes and exclude them again, but so far I haven’t come up with anything. I might just build a list of the names of the default scenes and exclude based on that, but that would mean that you couldn’t ever re-use those names in your own scenes.