xKing Posted December 16, 2017 Share Posted December 16, 2017 Hue Poly is now available as an Alpha version, basic functionality has been implemented and tested. I'm open to any improvement suggestion that experienced Hue users might have There is the GitHub repo It should also be available in the Polyglot store as soon as Einstein42 approves it. p.s. I would like to thank Einstein42 for his tremendous work on the Polyglot v2 and original v1 Hue authors for starting the Hue integration Link to comment Share on other sites More sharing options...
einstein.42 Posted December 17, 2017 Share Posted December 17, 2017 Sorry for the delay. This is in the NodeServer Store as of now. Thanks for doing this! Link to comment Share on other sites More sharing options...
einstein.42 Posted December 17, 2017 Share Posted December 17, 2017 For whatever reason the auto-discovery (even after pushing the button on the hub) never works for me. I actually have to modify the NodeServer and put the IP address in. ``` self.hub = phue.Bridge('10.0.0.228') ``` No big deal there, but for other users it might be easier if you create a customParam key of 'ip' or something that they can just enter it on the Frontend after they add the NodeServer. Then if the customParam exists, use it, if not do the search? Other than that, it is working really well. Nice job! Link to comment Share on other sites More sharing options...
xKing Posted December 17, 2017 Author Share Posted December 17, 2017 Thanks! Could you please try curl https://www.meethue.com/api/nupnp from any of your systems and see if it returns the bridge internal IP? You have to register your bridge with the meethue.com in order for that to work though... Pushing button does not affect the discovery - it's only needed for "user" creation on the bridge Once IP and user are saved under ~/.python_hue - that file is used for for any future communications. I'll certainly add an option to specify Bridge IP in the NodeServer custom parameters! Link to comment Share on other sites More sharing options...
einstein.42 Posted December 17, 2017 Share Posted December 17, 2017 Ok, so on my dev boxes (which are all VM's on ESXi). I get: curl https://www.meethue.com/api/nupnp [] However. I just tried it on my pi3 dev and pi3b prod environments and I get: curl https://www.meethue.com/api/nupnp [{"id":"001788fffe6e5fe3","internalipaddress":"10.0.0.228"}] Which is actually weird, because I installed it this morning on my prod rpi3b and got this until I added the IP to the Bridge() command. 2017-12-17 19:33:20,515 INFO Polyglot v2 Interface Starting... 2017-12-17 19:33:20,517 INFO Received Config from STDIN. 2017-12-17 19:33:20,590 INFO Connecting to MQTT... localhost:1883 2017-12-17 19:33:20,650 INFO Started Hue Protocol 2017-12-17 19:33:20,659 INFO MQTT Connected with result code 0 (Success) 2017-12-17 19:33:20,661 INFO MQTT Subscribing to topic: udi/polyglot/ns/1 - MID: 1 Result: 0 2017-12-17 19:33:20,663 INFO MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2017-12-17 19:33:20,664 INFO Sent Connected message to Polyglot 2017-12-17 19:33:20,718 INFO Adding node Hue Bridge(huebridge) 2017-12-17 19:33:20,720 INFO Updating Driver huebridge - ST: 1 2017-12-17 19:33:20,722 INFO Waiting on Primary node to be added....... 2017-12-17 19:33:20,892 DEBUG Connect method called 2017-12-17 19:33:20,893 INFO Attempting to connect to the bridge... 2017-12-17 19:33:20,894 INFO Error opening config file, will attempt bridge registration 2017-12-17 19:33:21,079 INFO Connecting to meethue.com/api/nupnp 2017-12-17 19:33:21,247 ERROR Cannot find Hue Bridge 2017-12-17 19:33:21,248 INFO Updating All Drivers to ISY for Hue Bridge(huebridge) Then I added it Bridge('10.0.0.228') 2017-12-17 19:49:01,760 INFO Polyglot v2 Interface Starting... 2017-12-17 19:49:01,763 INFO Received Config from STDIN. 2017-12-17 19:49:01,779 INFO Connecting to MQTT... localhost:1883 2017-12-17 19:49:01,847 INFO Started Hue Protocol 2017-12-17 19:49:01,871 INFO MQTT Connected with result code 0 (Success) 2017-12-17 19:49:01,872 INFO MQTT Subscribing to topic: udi/polyglot/ns/1 - MID: 1 Result: 0 2017-12-17 19:49:01,873 INFO MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2017-12-17 19:49:01,874 INFO Sent Connected message to Polyglot 2017-12-17 19:49:01,976 INFO Updating Driver huebridge - ST: 1 2017-12-17 19:49:01,979 DEBUG Connect method called 2017-12-17 19:49:01,980 INFO Attempting to connect to the bridge... 2017-12-17 19:49:01,980 INFO Error opening config file, will attempt bridge registration 2017-12-17 19:49:01,983 DEBUG POST /api {'devicetype': 'python_hue'} 2017-12-17 19:49:01,988 ERROR IP Address OK. Node Server not registered. Then I ran downstairs and hit the button and sprinted back upstairs to restart it again: 2017-12-17 19:51:07,112 INFO Polyglot v2 Interface Starting... 2017-12-17 19:51:07,114 INFO Received Config from STDIN. 2017-12-17 19:51:07,129 INFO Connecting to MQTT... localhost:1883 2017-12-17 19:51:07,198 INFO Started Hue Protocol 2017-12-17 19:51:07,208 INFO MQTT Connected with result code 0 (Success) 2017-12-17 19:51:07,209 INFO MQTT Subscribing to topic: udi/polyglot/ns/1 - MID: 1 Result: 0 2017-12-17 19:51:07,210 INFO MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2017-12-17 19:51:07,211 INFO Sent Connected message to Polyglot 2017-12-17 19:51:07,336 INFO Updating Driver huebridge - ST: 1 2017-12-17 19:51:07,337 DEBUG Connect method called 2017-12-17 19:51:07,338 INFO Attempting to connect to the bridge... 2017-12-17 19:51:07,339 INFO Error opening config file, will attempt bridge registration 2017-12-17 19:51:07,342 DEBUG POST /api {'devicetype': 'python_hue'} 2017-12-17 19:51:07,352 INFO Writing configuration file to /home/pi/.python_hue 2017-12-17 19:51:07,352 INFO Reconnecting to the bridge 2017-12-17 19:51:07,353 INFO Attempting to connect to the bridge... 2017-12-17 19:51:07,354 INFO Using ip: 10.0.0.228 2017-12-17 19:51:07,355 INFO Using username from config: Success! I don't know why it didn't find it automatically. That curl command worked from it just now. Link to comment Share on other sites More sharing options...
xKing Posted December 18, 2017 Author Share Posted December 18, 2017 Thanks, I'll check on automatic discovery, will get the custom parameter added tomorrow. p.s. just pushed a small update that optimizes bridge polling, now it will pull all bulbs in a single request every 15 seconds instead of asking about each bulb status individually. However manual Query command - will ask about the specific bulb only. Next things would be bridge discovery optimization and I'll look into adding groups support (does not really make sense to turn each individual bulb on if you have like 6 bulbs in the same room ) Link to comment Share on other sites More sharing options...
einstein.42 Posted December 18, 2017 Share Posted December 18, 2017 Very cool! I'll update. Link to comment Share on other sites More sharing options...
xKing Posted December 18, 2017 Author Share Posted December 18, 2017 Added custom ip parameter real quick, seems to work... Link to comment Share on other sites More sharing options...
xKing Posted December 18, 2017 Author Share Posted December 18, 2017 Added custom ip parameter real quick, seems to work... BTW, how do I delete a custom parameter? I'm getting a message "No Settings Changed." on the red background and if I go back to Nodeservers -> Custom parameters - it's still there... Link to comment Share on other sites More sharing options...
einstein.42 Posted December 18, 2017 Share Posted December 18, 2017 Uh oh! Bug alert. Link to comment Share on other sites More sharing options...
einstein.42 Posted December 18, 2017 Share Posted December 18, 2017 I see what it is. It wont let you delete the LAST key. So create another one and then you can delete the one you want to delete. Lol. I'll fix it. Link to comment Share on other sites More sharing options...
einstein.42 Posted December 18, 2017 Share Posted December 18, 2017 I fixed it, it'll be updated in 2.0.29 Link to comment Share on other sites More sharing options...
xKing Posted December 18, 2017 Author Share Posted December 18, 2017 Thanks Another weird thing - somehow I ended up with the node listed twice in the Polyglot DB, see the screenshot. Not sure how that happened... Guess I'll remove the node server and re-add it back to clear it up. ISY shows it only once and it works just fine. Noticed it while I was looking at custom parameters. Link to comment Share on other sites More sharing options...
einstein.42 Posted December 18, 2017 Share Posted December 18, 2017 Whoa. that's a bizarre one. I don't know how that would even happen. Let me know if you see it again. Link to comment Share on other sites More sharing options...
xKing Posted December 22, 2017 Author Share Posted December 22, 2017 UPDATE: Version 0.1.0 is out with Groups support. It requires a new profile.zip to be uploaded to ISY, so your best bet is to remove node server and re-add it again after hitting the update button. Please let me know if you see any problems Link to comment Share on other sites More sharing options...
Greg Posted December 29, 2017 Share Posted December 29, 2017 For us unix dummies....how/what does "copy that file into ~/.python_hue" mean? I have found the "bridges" file. I have tried creating a new file named "python_hue" in my "/home/pi" directory, I also created a folder in the same directory and just copied the "bridges" file to that folder. I then tried creating a folder in my "/home/pi/Polyglot/config" folder and copying the bridges file there, I still get the same message in my log: 2017-12-29 10:12:42,906 INFO Polyglot v2 Interface Starting... 2017-12-29 10:12:42,908 INFO Received Config from STDIN. 2017-12-29 10:12:42,937 INFO Connecting to MQTT... localhost:1883 2017-12-29 10:12:42,994 INFO Started Hue Protocol 2017-12-29 10:12:43,007 INFO MQTT Connected with result code 0 (Success) 2017-12-29 10:12:43,008 INFO MQTT Subscribing to topic: udi/polyglot/ns/2 - MID: 1 Result: 0 2017-12-29 10:12:43,008 INFO MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2017-12-29 10:12:43,010 INFO Sent Connected message to Polyglot 2017-12-29 10:12:43,079 INFO Updating Driver huebridge - ST: 1 2017-12-29 10:12:43,081 INFO Attempting to connect to the bridge... 2017-12-29 10:12:43,082 INFO Error opening config file, will attempt bridge registration 2017-12-29 10:12:43,246 INFO Connecting to meethue.com/api/nupnp 2017-12-29 10:12:43,450 DEBUG POST /api {'devicetype': 'python_hue'} 2017-12-29 10:12:43,453 ERROR IP Address OK. Node Server not registered Since I am trying to do this remotely (60+ miles away) I would like to not have to push the hue button to get this back up and running. Link to comment Share on other sites More sharing options...
xKing Posted December 29, 2017 Author Share Posted December 29, 2017 File name should have a dot in the front (~/.python_hue) in other words: cp bridges ~/.python_hue Link to comment Share on other sites More sharing options...
einstein.42 Posted December 29, 2017 Share Posted December 29, 2017 This update worked nicely for me. Thanks. Link to comment Share on other sites More sharing options...
Greg Posted December 29, 2017 Share Posted December 29, 2017 Thanks, still don't understand all the meanings of things in the unix world. So, what does having the "." in front of the file name do/mean? BTW it is now working, just trying to understand the significance of the . Link to comment Share on other sites More sharing options...
einstein.42 Posted December 29, 2017 Share Posted December 29, 2017 Greg, it makes it a 'hidden' file. Not really, but you can think of it that way. If you do a standard ls you wont see the files or folders that start with '.' Typically developers and package maintainers use . folders or files as configuration folders/files as a way to not clutter up your home directory. Polyglot does this too e.g.: ~/.polyglot/ Link to comment Share on other sites More sharing options...
Greg Posted December 29, 2017 Share Posted December 29, 2017 That makes sense. I knew about it with my phone, but did not realize it was the same here. Link to comment Share on other sites More sharing options...
Greg Posted December 30, 2017 Share Posted December 30, 2017 None of my white bulbs seem to be reporting/working correctly. In the log they are all listed as Unsupported Dimable Light Bulb: NAME(NUMBERS) 2017-12-30 15:11:11,032 INFO Found Unsupported Dimmable light Bulb: Upper1(880102098a800b) 2017-12-30 15:11:11,033 INFO Found Unsupported Dimmable light Bulb: Bedroom South(88010268bd890b) 2017-12-30 15:11:11,033 INFO Found Unsupported Dimmable light Bulb: Upper 2(8801022a10c10b) 2017-12-30 15:11:11,033 INFO Found Unsupported Dimmable light Bulb: DStairs(8801020987d80b) 2017-12-30 15:11:11,033 INFO Found Unsupported Dimmable light Bulb: Bedroom North(8801023059f40b) 2017-12-30 15:11:11,034 INFO Found Unsupported Dimmable light Bulb: Bedroom East(88010208cf110b) Link to comment Share on other sites More sharing options...
xKing Posted December 30, 2017 Author Share Posted December 30, 2017 Can you update the nodeserver and try again, please? Link to comment Share on other sites More sharing options...
Greg Posted December 31, 2017 Share Posted December 31, 2017 I ended up having to completely delete and re-add the node....also and I don't know if this made any difference...I had a set of lights that I was not using so they were unreachable, I deleted all those lights from the hub prior to deleting and re-adding the node. I don't know if it was somehow hanging on those unreachable lights and then everything below them in the search was just failing. Link to comment Share on other sites More sharing options...
xKing Posted December 31, 2017 Author Share Posted December 31, 2017 Well, the problem was that I was looking for "Dimmable Light" and Hue reported "Dimmable light" (case difference), I've fixed that once I've seen your report. I do not have a pure dimmable bulb to test with, only tested with Extended Color and White Ambiance bulbs. Unreachable bulbs should not affect the Node Server. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.