SmartThings Community

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

hue
smartapp_lighting

(Stuart Buchanan) #201

@r4nd0m just because you can doesn’t mean you should. how long have you been running this for? for example an overpolling experience i had recently, after enabling the polling my hub stopped working after a day or so zwave network died a death even though i was not polling the zwave network. this was proved after much difficulty to be attributable to the polling cycle i had.

if its working for you then good, but i caution that if it takes a few days for your hub to stop working you wouldn’t know necessarily that the issue is caused by your excessive polling.


#202

thanks for the information - I will keep an eye on it - I am currently refreshing every 45 seconds and with the few bulbs where this applies (4) it seems to work fine at the moment - been running for a few hours - until there is a working procedure for getting an update from the HUE bridge from external changes (dimmer switch) quicker than 5 minutes I will be hunting for workarounds which this clearly is - an alternative would be using Mood Cube and the Open/Close sensor instead to have manual switches but that doesnt seem to be reasonable though I could think of some fancy looking switches …


#203

Thanks for the great app and device handlers! I’m having a couple issues though:

  1. Scenes I create using the Hue app for iOS sometimes cannot be seen by the Reconnect smart app. I have left the SmartThings app searching for extended periods and the scenes don’t show up, even though I’ve verified they’re created by using the Hue API.

  2. It seems like the Reconnect app can only see scenes put onto the Hub by the official Hue app. I’ve tried creating scenes using Hue Lights (a pretty nice Hue app for iOS), and the scenes are never detected. Is there a reason for this behavior?

Anyway, thanks again!


#204

Hi - Hue (re)connect has been working well for me over the last week or so but this morning when I selected the app from within iOS SmartThings it gave me a not authorised error and took me back to the main menu.

When I now select the app I get the spinning timer and then nothing else (ie. stays in the menu of installed SmartApps). In the debug console I am seeing the following :-

11:50:28 AM: trace NON-HUE EVENT devicetype:04, mac:5442493EF137, networkAddress:C0A80192, deviceAddress:C351, stringCount:04, ssdpPath:/Ircc.xml, ssdpUSN:uuid:00000000-0000-1010-8000-
5442493ef137::upnp:rootdevice, ssdpTerm:, ssdpNTS:ssdp:alive

11:50:28 AM: trace Location: devicetype:04, mac:5442493EF137, networkAddress:C0A80192, deviceAddress:C351, stringCount:04, ssdpPath:/Ircc.xml, ssdpUSN:uuid:00000000-0000-1010-8000-5442493ef137::upnp:rootdevice, ssdpTerm:, ssdpNTS:ssdp:alive

11:50:28 AM: error java.lang.NullPointerException @ line 286

I have looked at line 286 in the code but it’s a simple date assignment/comparison so I don’t believe this is the issue and I have tried uninstalling the app from within the IDE but receive the following message :-

“This SmartApp can’t be deleted at this time because it is installed by one or more users”

Any pointers to getting this great app working again?

Thanks.

James.


(Maroshu) #205

Hello, I’m really sorry to ask such a simple question in here, but I just picked up an ST hub and found some limitations. In searching for an answer, I found this thread, which seems to have exactly what I’m looking for! Unfortunately, I haven’t a clue as to how to get it to work. I’m copying the code from github (I click on raw code) and then copy that directly to a new smart app in the code window. It also says in the readme to copy each file from the device directory, so I went into there and copied each of those and placed them into the code window in the smartapp. When I click save and then publish, I get a bunch of errors. Really sorry, but can anyone point a new person in the right direction?


#206

Check out this FAQ


(Maroshu) #207

Thank you–my mistake was in creating device types as well as the program. I got it working now, which is really great–thank your for the link!

And thank you very much to the creator of this–I’ve read through this entire thread and it looks like a ton of work, it is much appreciated


(Stuart Buchanan) #208

FYI if anyone like me is interested in using Hue Groups, this has been added in the latest version just be sure to grab the device type also


(Cyril Peponnet) #209

Thanks @Fuzzyligic for your contribution :slight_smile:


(Cyril Peponnet) #210

Yes because I’m filtering out the scene to fetch only the one that get created by the Hue App.

All the scenes created with the Hue App have a name like " on " where the is the name scene and the is the transition time if any (otherwise it’s 0).

I’m using this because from the Hue App when you trigger a scene to Off it will create another scene like " off " that I tried to fetch from HueReconnect to be able to turnoff a scene.

This can also be done by hand (from another app for example):

Create a scene with name "myscene on 0"
Create an opposite scene (setting all the lights to off) with name “myscene off 0”

Then you should be able to see the scene and add it as well as the Off related scene.


(Stuart Buchanan) #211

@bobfather word of warning the name from hue v1.4 is a maximum of 32 characters but that includes the " on 0" and " Off 0" so that means your name for your scene should be no longer than 26 characters otherwise the " on 0" and " Off 0" will not be appended properly, i hit this problem, so just started using Codes for my Scenes that i want in ST like STLRBlPiYe ( i.e Living Room Blue Pink Yellow) then i just rename in the ST app once added.


(LJ) #212

Hello Fuzzy!

I installed it, it seems to look for the group in the hue hub. So I have the create the groups in the hue app? I can’t find where…

Thanks!


(Ryan Worrell) #213

I seem to be having a strange issue with linking my Hue bridge with this app. I have all five device handlers installed and published as well as the latest SmartApp but no matter what I get an Upgrade Needed error when I try to install this SmartApp. both my Hue bridge and my SmartThings hub are up to date. I can add my bridge and control my individual lights just fine with the stock Hue Connect SmartApp. I was having this issue previously as were many others in the thread linked below but ST pushed a code change and fixed that issue a few weeks back.


(Ryan Worrell) #214

I cannot get this SmartApp to find my bridge but I bet the groups are setup through the Hue debug tool as described in this post: Philips Hue Groups Control App


(Stuart Buchanan) #215

The issue with hub update needed is broken again it seems after ST just fixed it :(. Its not an issue with this smartapp. You can get around this by changing the end function to return true rather than the hubsallover function.


(Tony) #216

So thanks to cyril and fuzzy on this…it’s great!!!

Quick clarification around how it works??? Is ST storing the bulb states and triggering, or is it just triggering the scene on the hub…

I ask because I did something, likely by accident, where I updated a scene (it was a test of one bulb) to a different color…let’s say scene 1 for example…changed from blue to red…

i had it in my list as Scene 1…changed the scene in the Hue app…was trying to trigger to see if the change updated scene 1…it didn’t it was still blue…after reading…it looks like although the name is the same…in truth, another modded version is stored on the hub so I would have to re-add scene 1 again to ST…

what i then did was rename my existing Scene 1 to Scene 1 - Blue…added Scene 1 again and renamed it to Scene 1 - Red…BOTH worked fine…but if you look in the Hue app…i have only a Scene 1…

my question then is the reference or Scene 1 - Blue is apparently an old version of scene 1 on the hub and as scenes are created (greater than 200) it could fall off…the scene 1 - red wouldn’t as it’s a current scene, but the blue could…

am i understanding this right? I am asking because i have no problems having 20 switches for different colors of something because i can organize in ST, but in the Hue app it SUCKS…so i would rather mod a scene in Hue, add and rename in ST thereby only having one scene in Hue…but i guess then all the other versions would be at risk when storage limit is reached.

Am i on point or just batty???

Thanks again…GREAT WORK!


#217

Hi,

How can I add/update scenes after I’ve initially configured the app?

I’ve tried following the instructions in the readme (create new scene in the Hue app, trigger, turn off, rerun Hue ReConnect discovery), but new scenes aren’t found (and don’t show up in the logs anywhere either). The only way I can get new scenes to sometimes (though not always) show up in ST is by removing and then reinstalling the app.

Am I doing it wrong? Is there some trick to it I’m missing?

Appreciate any help!


(Stuart Buchanan) #218

The whole scene thing with the hue hub is a bit scatty, renaming the scenes doesn’t actually change the name of the scene on the hub unless you also change the scene slightly. Be aware of the maximum length of your scene name to be 26 chars max.
I only got sense with the discovery by deleting all the scene on my hub except the ones I am using and renaming and editing then deleting the old copy.

I’m planning when I get a moment to create a quick Windows app to list and allow you to delete scenes.


#219

Thanks. Yes, I’ve tried renaming, changing, changing and renaming, and deleting/recreating/renaming multiple times with little luck. Didn’t know about the max length constraint (thanks), but all names are <= 19 characters.

An app to manage and truly delete scenes would be welcome.

Likely will be back to deleting everything and starting over tonight. It’s a great app, I just wish the API wasn’t so flaky.

Edit: I started playing around with the Hue debugger. I added some groups and that somehow prompted the discovery process in ST to find some (though not all) scenes that I had added. Weird, eh? Now I’m currently using it to delete scenes.


#220

Just in case it helps anyone else: I’m not exactly sure which step “unclogged the pipe,” but cleaning up my scenes using the debugger caused the ReConnect discovery process to start working well every time. In no particular order, I did the following using the debugger:

  • Renamed a scene who’s name got cut off somehow (from “Star Gazing o” to “Star Gazing on 0”)
  • Manually added groups
  • Manually added “off 0” scenes (the Hue app seems to rarely create those for me)
  • Deleted loads of unused/duplicate scenes

If I had to bet on which step fixed it, I’d choose the first one … this malformed name seem to cause issues I could see in the ST logging.