kershner / screenBloom

Fake Ambilight for Philips Hue via Python
http://www.screenbloom.com
329 stars 48 forks source link

Registering with Hue Bridge hangup #26

Closed gotteric closed 7 years ago

gotteric commented 7 years ago

After clicking register, it seems to stay on the loading overlay indefinitely. So far I have tried:

All have had the same result.

Other relevant stuff I can think of:

Not sure if there is something simple I've overlooked.. Thanks in advance for the help!

pauliftw commented 7 years ago

Delete the 2.2 install. Use the 2.1 version instead still works. I cant register 2.2 with bridge also tried all i could think off. Or try unpowering bridge and unplug utp and router reset.

Scharmen commented 7 years ago

Same problem here.

Version 2.1 isn't working as well ( in my case).

OS: Windows 10 (Up to date)

kershner commented 7 years ago

Hey guys - thanks for opening this issue.

I'm fairly certain I know what the problem is and I have some user data to help fix it. I will for sure have a fix by the end of the weekend, but probably sooner.

In the meantime, more data is good data, so if you guys could post your config files, that would be a big help!

It's located in

c:/Users/your_username/AppData/Roaming/screenBloom/screenbloom_config.cfg

Thanks for your patience!

Kakifrucht commented 7 years ago

Or just navigate to %APPDATA%\screenBloom in Windows explorer.

Scharmen commented 7 years ago

ScreenBloom v2.1 screenBloom_config.zip

I hope it will help. If there is anything i can do please let me know.

kershner commented 7 years ago

Hey everyone,

I think I might have fixed it. Can you guys test it for me?

http://kershner.org/static/distribute/screenBloom_test.zip

Scharmen commented 7 years ago

Unfortunately, it isn't working.

Still can't register (endless loop). If I'm trying to start the installed program a second time I get a Python Error Window (See picture). pythonerror

gotteric commented 7 years ago

Also still having the same issue. Here is the contents of my config file:

[Configuration] hue_ip = 192.168.1.243 username = D5Y-7MOlYJSWmCPJ5U4O35O2gyUMyRfizU-dEXTq auto_start = 0 current_preset = `[Light Settings]` `all_lights = 3,4,7,6` `active = 0,0,0,0` `bulb_settings = {"3": {"max_bri": 254, "min_bri": 1}, "4": {"max_bri": 254, "min_bri": 1}, "7": {"max_bri": 254, "min_bri": 1}, "6": {"max_bri": 254, "min_bri": 1}}` `update = 0.7` `update_buffer = 0` `default = ` `max_bri = 254` `min_bri = 1` `zones = []` `zone_state = 0` `display_index = 0` `sat = 1.0` [Party Mode] running = 0 `[App State]` `running = False` ``

kershner commented 7 years ago

Ok, I was afraid of that lol. Sorry to make you guys jump through all these hoops. I've also fixed the XY keyerror, that fix is in the live version on screenbloom.com. Hopefully this will be the last time you have to re-install!

Let me know if that ends up working for you guys.

Also, if you get the time - can you tell me what Hue lights you guys have? A certain type is causing all kinds of issues, I think it's related to the non-color bulbs.

Scharmen commented 7 years ago

I am sorry to bring you the bad news, but still not working for me.

I am using

I hope it will help.

kershner commented 7 years ago

Man the different light setups are really not well documented at all with the Hue API.

So, you go to click 'Register' and it hangs there, like always, right? If you then try to launch the app again, you should probably get an error message. Can you send me that error message?

Basically what I think I'm gonna have to do, if you're willing to keep helping me test, is I'll send you a modified file or a script which will give me a readout of all the light data structures your bridge is reporting. That way I can see exactly which one is causing the problem (that Lightify plug looks suspicious haha, never even heard of that one).

Do you have Python installed on your PC? That'd make things a bit faster as I wouldn't have to compile an EXE for a simple script.

Scharmen commented 7 years ago

Yes, it hangs at the registration. pythonerror

Of course, I will help you. I don't need an .exe version, just send me the python script.

gotteric commented 7 years ago

Ditto, I'm happy to help, though my response time depends on if I am home of course. And I also have python already.

For my lights I have:

kershner commented 7 years ago

@gotteric did you try the new live version from screenbloom.com? I think with your bulb setup it should work.

@Scharmen thanks for the error readout. I think it's becoming clearer what the problem is. As part of registration (and lots of other functions within the codebase) ScreenBloom will query your Hue bridge and build a dictionary of commonly used values for each light. These errors are cropping up because there are some Hue lights that are apparently missing key->value pairs (although not documented).

The error you got is saying one of your lights is missing the bri key, which makes no sense because that is functionality that should be supported by every single Hue product.

With all the lights you've mentioned, are you able to control all of them via the Hue app? Color, brightness, etc? Or are there some that can't be manipulated using the official Hue app?

I'll cook up the debug script later tonight or tomorrow and send it along. Thanks so much for helping, guys.

Scharmen commented 7 years ago

@kershner Oh I forgot some Devices. First at all, I can use all my Bulb and the Plug with the Philips Hue app. The Plug just turns on and off.

The additional devices are:

kershner commented 7 years ago

I can almost guarantee that the Plug is the issue. You're saying it just turns on and off, which would be consistent with it missing a bri key->value. Should be pretty simple to confirm and then fix. Once I get a look at all the actual data structures I'll know for sure.

Scharmen commented 7 years ago

Great to hear you found the problem. I hope you don't have to much work because of my setup.

kershner commented 7 years ago

Ok, I have a little debug version ready to go.

http://kershner.org/static/distribute/screenBloom_test.zip

What this will do is dump the light data from the Hue bridge to a file called LIGHT_DATA.txt inside the directory. If your config file doesn't exist yet it'll dump the data just after you register with the bridge. But if you already have a file, which you probably will if you downgraded back to 2.1, it'll just dump it immediately upon startup.

Once the data dump is done the program will take a key input and then crash. Send me the contents of the LIGHT_DATA.txt file or the file itself and then you can delete the debug version if you want.

There is a chance Windows will give you grief about permissions, since it wants to write to a file on the harddrive. Running the .exe as an admin should fix that if you run into it.

Let me know if you have any questions and thanks again!

Scharmen commented 7 years ago

Here we go :)

{"1": {"resource": {"name": "Schlafzimmer Decke", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": false, "hue": 12510, "colormode": "ct", "effect": "none", "alert": "none", "xy": [0.5268, 0.4133], "reachable": true, "bri": 1, "ct": 500, "sat": 226}, "uniqueid": "00:17:88:01:10:5d:12:7f-0b", "type": "Extended color light", "modelid": "LCT007"}}, "2": {"resource": {"name": "Fernseher Lampe", "swversion": "5.23.1.13452", "manufacturername": "Philips", "state": {"on": false, "hue": 47884, "colormode": "xy", "effect": "none", "alert": "none", "xy": [0.1544, 0.0859], "reachable": true, "bri": 254, "sat": 254}, "uniqueid": "00:17:88:01:00:c1:59:62-0b", "type": "Color light", "modelid": "LLC012"}}, "3": {"resource": {"name": "Schlafzimmer Bett", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": false, "hue": 12510, "colormode": "ct", "effect": "none", "alert": "none", "xy": [0.5268, 0.4133], "reachable": true, "bri": 1, "ct": 500, "sat": 226}, "uniqueid": "00:17:88:01:10:5d:07:ac-0b", "type": "Extended color light", "modelid": "LCT007"}}, "4": {"resource": {"name": "Couchlampe", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": false, "hue": 14956, "colormode": "ct", "effect": "none", "alert": "none", "xy": [0.4571, 0.4097], "reachable": true, "bri": 254, "ct": 366, "sat": 140}, "uniqueid": "00:17:88:01:10:3c:a5:c8-0b", "type": "Extended color light", "modelid": "LCT003"}}, "5": {"resource": {"name": "B\u00fcro 2", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": true, "hue": 33016, "colormode": "xy", "effect": "none", "alert": "none", "xy": [0.3689, 0.3719], "reachable": true, "bri": 254, "ct": 230, "sat": 53}, "uniqueid": "00:17:88:01:02:06:72:2b-0b", "type": "Extended color light", "modelid": "LCT007"}}, "6": {"resource": {"name": "B\u00fcro 1", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": true, "hue": 33016, "colormode": "xy", "effect": "none", "alert": "none", "xy": [0.3689, 0.3719], "reachable": true, "bri": 254, "ct": 230, "sat": 53}, "uniqueid": "00:17:88:01:10:5d:13:26-0b", "type": "Extended color light", "modelid": "LCT007"}}, "7": {"resource": {"name": "Strom Zimmer", "swversion": "V1.04.12", "manufacturername": "OSRAM", "state": {"on": true, "reachable": false, "alert": "none"}, "uniqueid": "84:18:26:00:00:09:83:05-03", "type": "On/Off plug-in unit", "modelid": "Plug 01"}}, "8": {"resource": {"name": "Fernseher Stehlampe", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": false, "hue": 47104, "colormode": "xy", "effect": "none", "alert": "none", "xy": [0.167, 0.04], "reachable": true, "bri": 254, "ct": 153, "sat": 254}, "uniqueid": "00:17:88:01:02:07:ac:42-0b", "type": "Extended color light", "modelid": "LCT007"}}, "9": {"resource": {"name": "Schreibtisch", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": true, "hue": 33016, "colormode": "xy", "effect": "none", "alert": "none", "xy": [0.3689, 0.3719], "reachable": true, "bri": 254, "ct": 230, "sat": 53}, "uniqueid": "00:17:88:01:02:30:a3:50-0b", "type": "Extended color light", "modelid": "LCT007"}}, "10": {"resource": {"name": "Klo", "swversion": "5.50.1.19085", "manufacturername": "Philips", "state": {"on": true, "colormode": "ct", "alert": "none", "reachable": true, "bri": 254, "ct": 230}, "uniqueid": "00:17:88:01:02:04:3d:c2-0b", "type": "Color temperature light", "modelid": "LTW001"}}}

kershner commented 7 years ago

That was fast!

And yes, it looks like it is indeed the Osram Plug that is missing attributes. My fix is to just skip lights that don't have a bri attribute, because that is the most basic level of functionality that ScreenBloom can manipulate.

Here's what I think will be the final version http://kershner.org/static/distribute/screenBloom_2.2_win.zip

Should be good to go, just let me know if you run into any issues.

Scharmen commented 7 years ago

I am sorry, but I still get the same issue.

pythonerror

kershner commented 7 years ago

That's pretty odd, there is now handling for that exact KeyError. Makes me think it's a caching issue. Try the classic uninstall previous version, reboot, install this new version.

If you want to make double sure you can open up the hue_interface.py and check line 29 like I linked earlier. If that try/catch isn't there then it's gotta be a cached version.

Scharmen commented 7 years ago

That was fast!

And yes, it looks like it is indeed the Osram Plug that is missing attributes. My fix is to just skip lights that don't have a bri attribute, because that is the most basic level of functionality that ScreenBloom can manipulate.

Here's what I think will be the final version http://kershner.org/static/distribute/screenBloom_2.2_win.zip

Should be good to go, just let me know if you run into any issues.

I installed the version of your post. I think you compiled an old version of the hue_interface.py file. There is no Error handling for 'bri' (please see screenshot):

hue_interface py_screenshot

File (C:\Program\Screenbloom\ hue_interface.py) hue_interface.py.zip

kershner commented 7 years ago

Wow I have no clue how that happened other than I'm an idiot. Just re-uploaded it and verified that the files are correct. Sorry about that!

gotteric commented 7 years ago

Finally got to try again. Everything is working for me with the new version on the screenbloom site. Thanks!

Scharmen commented 7 years ago
kershner commented 7 years ago

Welp OK. I was hoping this wouldn't be an issue but I know how to fix it, just need to find the time. Will definitely be sometime this week. I'll keep you posted.

kershner commented 7 years ago

Alright this one should definitely do it. http://kershner.org/static/distribute/screenBloom_test.zip

Lemme know how it goes and as always thanks for your patience!

Scharmen commented 7 years ago

It is working.

Great job, thank you!

kershner commented 7 years ago

Glad to hear it!

Thanks again to everyone for all of the feedback.

Going to close this issue now, feel free to raise more if you run into further problems.