Git Product home page Git Product logo

udi-hue-poly's People

Contributors

exking avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

udi-hue-poly's Issues

Attempting to query for Group "0" results in error

Attempting to call /api/username/groups/0 results in an error during initialization of the Node server.

2018-02-12 12:50:57,052 DEBUG    GET /api/376169333a8f86f59a543592a68d7017eb37da84/groups/ None
2018-02-12 12:50:57,089 DEBUG    GET /api/376169333a8f86f59a543592a68d7017eb37da84/groups/0 None
2018-02-12 12:50:57,101 ERROR    MQTT Received Payload Error: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/skynet/.local/lib/python3.5/site-packages/polyinterface/polyinterface.py", line 222, in _message
    self.inConfig(parsed_msg[key])
  File "/home/skynet/.local/lib/python3.5/site-packages/polyinterface/polyinterface.py", line 432, in inConfig
    watcher(config)
  File "/home/skynet/.local/lib/python3.5/site-packages/polyinterface/polyinterface.py", line 588, in _gotConfig
    self.start()
  File "./hue.py", line 37, in start
    self.discover()
  File "./hue.py", line 131, in discover
    self.groups = self._get_groups()
  File "./hue.py", line 192, in _get_groups
    groups = self.hub.get_group()
  File "/home/skynet/.polyglot/nodeservers/Hue/phue.py", line 1069, in get_group
    groups['0'] = self.request('GET', '/api/' + self.username + '/groups/0')
  File "/home/skynet/.polyglot/nodeservers/Hue/phue.py", line 667, in request
    return json.loads(response.decode('utf-8'))
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

This started after including Pull Request studioimaginaire/phue#100 in commit b1ad8ab and is a result of this line:

groups['0'] = self.request('GET', '/api/' + self.username + '/groups/0')

According to the Hue API: Group "0" is "A special group containing all lights in the system, and is not returned by the ‘get all groups’ command. This group is not visible, and cannot be created, modified or deleted using the API."

When calling /api/username/groups/0 in a web browser, nothing is returned.

Won't release phantom IP address?

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

TypeError: Cannot read property 'noticeByKey' of undefined

2019-1-29 16:10:32 - error: unhandledRejection REPORT THIS!: TypeError: Cannot read property 'noticeByKey' of undefined
at Object.features (/snapshot/polyglot-v2/lib/modules/nodeserver.js:736:51)
at Object.checkCommand (/snapshot/polyglot-v2/lib/modules/nodeserver.js:158:42)
at nsCommand (/snapshot/polyglot-v2/lib/modules/parse/mqtt.js:19:24)
at Object.parse (/snapshot/polyglot-v2/lib/modules/parse/mqtt.js:63:29)
at MqttClient. (/snapshot/polyglot-v2/lib/services/mqttc.js:65:15)
at MqttClient.emit (events.js:159:13)
at MqttClient._handlePublish (/snapshot/polyglot-v2/node_modules/mqtt/lib/client.js:956:12)
at MqttClient._handlePacket (/snapshot/polyglot-v2/node_modules/mqtt/lib/client.js:315:12)
at work (/snapshot/polyglot-v2/node_modules/mqtt/lib/client.js:271:12)
at Writable.MqttClient._setupStream.writable._write (/snapshot/polyglot-v2/node_modules/mqtt/lib/client.js:281:5)
at doWrite (/snapshot/polyglot-v2/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:418:64)
at writeOrBuffer (/snapshot/polyglot-v2/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:407:5)
at Writable.write (/snapshot/polyglot-v2/node_modules/mqtt/node_modules/readable-stream/lib/_stream_writable.js:334:11)
at TLSSocket.ondata (_stream_readable.js:642:20)
at TLSSocket.emit (events.js:159:13)
at addChunk (_stream_readable.js:265:12)

After upgrading Hue node server, I couldn't start Hue node server

I see the below error in the debug.log file:

12/30/2019, 2:06:44 PM - info: Hue(2): Processing command: start
12/30/2019, 2:06:44 PM - info: NS: Starting Local NodeServer Hue profile number 2 :: Version 0.1.10
12/30/2019, 2:06:44 PM - error: NSChild STDERR: Hue:   File "./hue.py", line 219
    LOGGER.debug(f"Hub {hub_idx} {data['type']} {name} {scene_data['type']} {scene_idx}:{scene_id}:{scene_data['name']}")
                                                                                                                       ^
SyntaxError: invalid syntax

12/30/2019, 2:06:44 PM - info: Hue(2): NodeServer Disconnected.
12/30/2019, 2:06:44 PM - info: Hue(2): n002_huebridge ST set sucessfully to 0 : UOM 2

I edited the "hue.py" file and removed the extra "f" character in the LOGGER invocations. After clearing the "f" character in line 219 of the code, the nodeserver startup failed with the same error in other calls to the LOGGER. So, I fixed all of them.

After fixing the hue.py file, the startup failed in node due to invalid "f" character in "node_types.py" file. So I fixed that file too and then I was able to startup. Not sure what caused the "f" character in the LOGGER calls.

Did my upgrade complete?

I just updated the Hue node server using the "Update" button in the node server store. It looks like the update failed reading the log messages below. But the "Update" button is not available in the node server store anymore. Did my upgrade complete successfully? If not, how do I update Hue node server??

12/30/2019, 1:57:19 PM - info: Hue(2): n002_88010217b00d0b ST set sucessfully to 0 : UOM 51
12/30/2019, 1:57:19 PM - info: Hue(2): n002_huegrp0 ST set sucessfully to 0 : UOM 51
12/30/2019, 2:03:09 PM - error: NSChild: Install failed - Non-zero exit code: 2
12/30/2019, 2:03:09 PM - error: NSChild: Hue pullRepo: Error: runInstallProcess: undefined
12/30/2019, 2:03:09 PM - error: Error: runInstallProcess: undefined
    at runInstallProcess (/snapshot/polyglot-v2/lib/modules/children.js:45:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
12/30/2019, 2:03:09 PM - error: NSResponse: Success: false - pullRepo: runInstallProcess: undefined
12/30/2019, 2:03:25 PM - info: Roomba(4): Processing command: status
12/30/2019, 2:03:25 PM - info: Roomba(4): n004_rm0062127620 GV4 set sucessfully to 70 : UOM 51
12/30/2019, 2:03:30 PM - info: Roomba(4): Processing command: status
12/30/2019, 2:03:30 PM - info: Roomba(4): n004_rm0062127620 GV4 set sucessfully to 100 : UOM 51
12/30/2019, 2:03:38 PM - info: Hue(2): Processing command: restart
12/30/2019, 2:03:38 PM - info: Hue(2): Processing command: connected
12/30/2019, 2:03:38 PM - info: Hue(2): NodeServer Disconnected.
12/30/2019, 2:03:38 PM - info: MQTTS: Client Disconnected: Hue
12/30/2019, 2:03:38 PM - info: Hue(2): n002_huebridge ST set sucessfully to 0 : UOM 2
12/30/2019, 2:03:39 PM - info: Hue(2): NodeServer Disconnected.
12/30/2019, 2:03:39 PM - info: Hue(2): n002_huebridge ST set sucessfully to 0 : UOM 2
12/30/2019, 2:03:41 PM - info: NS: Starting Local NodeServer Hue profile number 2 :: Version 0.1.10
12/30/2019, 2:03:41 PM - error: NSChild STDERR: Hue:   File "./hue.py", line 219
    LOGGER.debug(f"Hub {hub_idx} {data['type']} {name} {scene_data['type']} {scene_idx}:{scene_id}:{scene_data['name']}")
                                                                                                                       ^
SyntaxError: invalid syntax

12/30/2019, 2:03:41 PM - info: Hue(2): NodeServer Disconnected.
12/30/2019, 2:03:41 PM - info: Hue(2): n002_huebridge ST set sucessfully to 0 : UOM 2

Change IP Address and now Hue Poly doesn't recognize Hue Bridge

Polisy Version: 2.2.13
ISY Version: 5.0.16

Issue: Installed a new Router and it assigned new/different ip address to the 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:

Checked for updates on Polisy and restarted
1.) Added custom parameter with the correct (new) ip address, but Polyglot is still searching for the old ip address
2.) Attempted multiple times to stop the node server, press the pair button on the Hue Bridge, and then restart the node server
but ip address did not change
3.) Deleted the Hue node server, uninstall it from the Node Store, reinstalled it and then added it. No change in the ip address.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.