exking / udi-hue-poly

Hue interface Poly for Polyglot v2
MIT License
2 stars 0 forks source link

Won't release phantom IP address? #6

Open ferventgeek opened 3 years ago

ferventgeek commented 3 years ago

Thanks for this plugin, it was working great for weeks However now it can't connect to the bridge, which changed it's IP. Looking at the log (below) it's finding an incorrect IP in it's config data and using that instead of the discoverable bridge IP that the Hue iOS app, Elgato stream deck and hueDynamic Windows app all discover just fine. Here's what I've tried so far to fix it:

  1. Set an ip custom parameter with the correct IP
  2. Stop node server, hit the pair button on the bridge, restart
  3. Delete and and re-add the Hue node server
  4. Uninstall, reboot and re-add the node server, reboot Polisy (Polyglot)

Still, it returns the result below. Any ideas on what to do next? Where is "Using ip from config:" getting it's data? Feels like something that could be reset.

Thanks again for this module!

2021-04-11 11:33:02,492 MQTT       polyinterface      INFO     polyinterface:_subscribe: MQTT Subscribed Succesfully for Message ID: 1 - QoS: (0,)
2021-04-11 11:33:02,494 MQTT       polyinterface      INFO     polyinterface:_subscribe: MQTT Subscribed Succesfully for Message ID: 2 - QoS: (0,)
2021-04-11 11:33:02,537 MQTT       polyinterface      INFO     polyinterface:addNode: Adding node Hue Bridge(huebridge)
2021-04-11 11:33:02,538 MQTT       polyinterface      INFO     polyinterface:_gotConfig: Waiting on Controller node to be added.......
2021-04-11 11:33:02,540 NodeServer polyinterface      INFO     hue:connect: Saved bridges information is not found
2021-04-11 11:33:02,541 NodeServer polyinterface      INFO     hue:connect: No bridge configuration found, trying discovery...
2021-04-11 11:33:02,542 NodeServer polyinterface      INFO     phue:connect: Attempting to connect to the bridge...
2021-04-11 11:33:02,555 NodeServer polyinterface      INFO     phue:connect: Using ip from config: {wrong one}
2021-04-11 11:33:02,562 NodeServer polyinterface      INFO     phue:connect: Using username from config: {name string}
2021-04-11 11:33:02,607 NodeServer polyinterface      ERROR    hue:_get_lights: Can't contact Hue Bridge. Network communication issue.
2021-04-11 11:33:02,608 NodeServer polyinterface      ERROR    hue:connect: Connect: Failed to read Lights from the Hue Bridge
ferventgeek commented 3 years ago

Workaround update: It appears that the node server's .python_hue file with the list of server and usernames isn't being deleted from /var/polyglot on node server uninstall. Deleting or renaming this file solves the issue. I don't see this in the install script. Is this file managed by Polyglot's framework or each node server?

drwxr-xr-x   7 polyglot  polyglot  11 Apr 11 12:20 .
drwxr-xr-x  28 root      wheel     28 Apr 11 11:00 ..
drwxr-xr-x   3 polyglot  polyglot   3 Dec 23 14:49 .cache
drwx------   4 polyglot  polyglot   4 Dec 23 14:49 .local
-rw-r--r--   1 polyglot  polyglot  74 Apr 11 12:20 .python_hue
drwxr-xr-x   2 polyglot  polyglot  22 Apr 11 11:01 log
drwxr-xr-x   7 polyglot  polyglot   7 Apr 11 11:32 nodeservers
-rw-r--r--   1 polyglot  polyglot   4 Apr 11 11:01 polyglot.pid
-rw-------   1 polyglot  polyglot   3 Apr 11 11:01 polyglot_daemon.pid
drwxr-xr-x   3 polyglot  polyglot   9 Feb  2  2020 ssl
RC-Michael commented 3 years ago

Same or Similar issue. Can you help?

Polisy Version: 2.2.13 ISY Version: 5.0.16

Issue: Installed new Router and it assigned new/different ip address to Hue Bridge. Upon trying to connect the Hue Bridge with the udi-hue-poly resident on Polisy, I found that the old ip address stored in the udi-hue-poly was not reset/changed to the new address and therefore could not find the Hue Bridge.

I’ve tried the following with no success:

  1. Checked for updates on Polisy and restarted
  2. Added custom parameter with the correct (new) ip address, but Polyglot is still searching for the old ip address
  3. Attempted multiple times to stope the node server, press the pair button on the Hue Bridge, and then restart the node server
  4. Delete the Hue node server, uninstall it, reinstall it and then adding it

None of these actions worked as you can see from the log below. Is there any way to change the “Using ip from config:” when running udi-hue-poly on Polisy

2021-05-16 07:09:00,258 Interface polyinterface INFO polyinterface:_startMqtt: Connecting to MQTT... localhost:1883 2021-05-16 07:09:00,262 MainThread polyinterface INFO hue:init: Started Hue Protocol 2021-05-16 07:09:00,326 MQTT polyinterface INFO polyinterface:_connect: MQTT Connected with result code 0 (Success) 2021-05-16 07:09:00,329 MQTT polyinterface INFO polyinterface:_connect: MQTT Subscribing to topic: udi/polyglot/ns/7 - MID: 1 Result: 0 2021-05-16 07:09:00,329 MQTT polyinterface INFO polyinterface:_connect: MQTT Subscribing to topic: udi/polyglot/connections/polyglot - MID: 2 Result: 0 2021-05-16 07:09:00,331 MQTT polyinterface INFO polyinterface:_connect: Sent Connected message to Polyglot 2021-05-16 07:09:00,337 MQTT polyinterface INFO polyinterface:_subscribe: MQTT Subscribed Succesfully for Message ID: 1 - QoS: (0,) 2021-05-16 07:09:00,342 MQTT polyinterface INFO polyinterface:_subscribe: MQTT Subscribed Succesfully for Message ID: 2 - QoS: (0,) 2021-05-16 07:09:00,435 NodeServer polyinterface INFO hue:connect: Saved bridges information is not found 2021-05-16 07:09:00,446 NodeServer polyinterface INFO hue:connect: No bridge configuration found, trying discovery... 2021-05-16 07:09:00,460 NodeServer polyinterface INFO phue:connect: Attempting to connect to the bridge... 2021-05-16 07:09:00,496 NodeServer polyinterface INFO phue:connect: Using ip from config: Wrong.IP.address 2021-05-16 07:09:00,503 NodeServer polyinterface INFO phue:connect: Using username from config: PnqvJdfIqwcAeH2Ltu2smFF4rAl9qIhQuB5nU1qE 2021-05-16 07:09:10,525 NodeServer polyinterface ERROR phue:request: GET Request to Wrong.IP.address/api/PnqvJdfIqwcAeH2Ltu2smFF4rAl9qIhQuB5nU1qE/lights/ timed out. Traceback (most recent call last): File "/var/polyglot/nodeservers/Hue/phue.py", line 651, in request connection.request(mode, address) File "/usr/local/lib/python3.7/http/client.py", line 1277, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/local/lib/python3.7/http/client.py", line 1323, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.7/http/client.py", line 1272, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/local/lib/python3.7/http/client.py", line 1032, in _send_output self.send(msg) File "/usr/local/lib/python3.7/http/client.py", line 972, in send self.connect() File "/usr/local/lib/python3.7/http/client.py", line 944, in connect (self.host,self.port), self.timeout, self.source_address) File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection raise err File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) socket.timeout: timed out 2021-05-16 07:09:10,539 NodeServer polyinterface ERROR hue:_get_lights: Timed out trying to connect to Hue Bridge. 2021-05-16 07:09:10,540 NodeServer polyinterface ERROR hue:connect: Connect: Failed to read Lights from the Hue Bridge