jimboca / ISYHelper

Program to assist with communication between ISY994 and anything else.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to start ISYHelper

ggiesen opened this issue · comments

When I try to manually start ISYHelper with only a very basic configuration on a fresh install, it crashes:

./isyhelper.py
ISYHelper: Version 1.14 Started: 2016-11-04 20:59:07.911936
isyhelper: host: 1.2.3.146:8081
This host IP is 1.2.3.146
isyhelper: Writing to log: isyhelper.log level=info
Initializing new helper: PyHarmony
Scheduling helper: MyHarmony
Starting PyISY: host=1.2.3.148 PORT=80
Traceback (most recent call last):
File "./isyhelper.py", line 72, in
isy = PyISY.ISY(config['isy']['host'], config['isy']['port'], config['isy']['user'], config['isy']['password'], False, "1.1", logger)
File "../PyISY/PyISY/ISY.py", line 84, in init
self.nodes = Nodes(self, xml=self.conn.getNodes())
File "../PyISY/PyISY/Nodes/init.py", line 52, in init
self.parse(xml)
File "../PyISY/PyISY/Nodes/init.py", line 202, in parse
Group(self, nid, nname, members, controllers), ntype)
File "../PyISY/PyISY/Nodes/group.py", line 40, in init
for m in self.members]
File "../PyISY/PyISY/Nodes/init.py", line 283, in getitem
raise KeyError('Unrecognized Key: [' + val + ']')
KeyError: u'Unrecognized Key: [00:21:b9:00:de:ad]'
Exception AttributeError: "'Group' object has no attribute '_membersHandlers'" in <bound method Group.del of <PyISY.Nodes.group.Group object at 0x128ad30>> ignored

My ISY is running 5.0.6.

Sorry, I can't test on 5.0.6, I am on 5.0.4 and don't ha any issues. It looks like the PyISY module doesn't like your xml. I may need to send me the xml or see if somon is already looking into this for PyISY.

Sent you my nodes.xml. I suspect it's the new "universal" scene support that may be the culprit

Sorry, I forgot about this while out of town. I didn't receive the xml, where did you send it? Also, can you try again if/when you move to 5.0.7 ?

I sent to your gmail account as I didn’t want to expose it to Github. I tried again with 5.0.7 and same result.

From: jimboca [mailto:notifications@github.com]
Sent: November-14-16 3:53 PM
To: jimboca/ISYHelper ISYHelper@noreply.github.com
Cc: ggiesen ggiesen+github@giesen.me; Author author@noreply.github.com
Subject: Re: [jimboca/ISYHelper] Unable to start ISYHelper (#10)

Sorry, I forgot about this while out of town. I didn't receive the xml, where did you send it? Also, can you try again if/when you move to 5.0.7 ?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #10 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AE9BoqLFQ8BYE2zNEmKJTszawGY-f04gks5q-MowgaJpZM4KqHnw . https://github.com/notifications/beacon/AE9BoqtAO00VVL5lwWbFUU5Be-DEtozyks5q-MowgaJpZM4KqHnw.gif

I too have this issue. Any updates @jimboca?

Sorry I searched for the email and could not find anything. I've updated my changes with the latest PyISY, can you run the update.sh script in ISYHelper directory? I expect it will still have issues, but the line numbers in the traceback will help. Not sure if I can get this fixed today, but I will try since I will be out of town until next Saturday.

Hello jimboca!

Running on 5.0.7, This is the output I receive from isyhelper.py after running update.sh:

user@ISYHelper:~/isyhelper/ISYHelper$ ./isyhelper.py
ISYHelper: Version 1.14 Started: 2016-11-21 07:32:28.026282
isyhelper: host: 10.0.1.61:8080
This host IP is 10.0.1.61
isyhelper: Writing to log: isyhelper.log level=debug
Initializing new helper: PyHue
  Scheduling helper: PyHue
Starting PyISY: host=10.0.1.150 PORT=80
Traceback (most recent call last):
  File "./isyhelper.py", line 72, in <module>
    isy = PyISY.ISY(config['isy']['host'], config['isy']['port'], config['isy']['user'], config['isy']['password'], False, "1.1", logger)
  File "../PyISY/PyISY/ISY.py", line 84, in __init__
    self.nodes = Nodes(self, xml=self.conn.getNodes())
  File "../PyISY/PyISY/Nodes/__init__.py", line 73, in __init__
    self.parse(xml)
  File "../PyISY/PyISY/Nodes/__init__.py", line 223, in parse
    uom=units, prec=prec),
UnboundLocalError: local variable 'units' referenced before assignment

Here is my xml file

Thanks. I'll try to look at this next weekend when I am back home.

@cptechie @ggiesen I see there are many changes waiting approval at https://github.com/automicus/PyISY/pulls which might resolve this issue, so hopefully we can get those changes merged and see if that resolves this issue.

Fix commited. Run update.sh and try again.

Actually, I was never able to repeat the original issue from @ggiesen so I can not confirm that is resolved.

@jimboca Not fixed yet. Getting the same error message as with v1.14.

user@ISYHelper:~/isyhelper/ISYHelper$ ./isyhelper.py
ISYHelper: Version 1.15 Started: 2016-11-26 16:37:33.236988
isyhelper: host: 10.0.1.61:8080
This host IP is 10.0.1.61
isyhelper: Writing to log: isyhelper.log level=debug
Initializing new helper: PyHue
  Scheduling helper: PyHue
Starting PyISY: host=10.0.1.150 PORT=80
Traceback (most recent call last):
  File "./isyhelper.py", line 72, in <module>
    isy = PyISY.ISY(config['isy']['host'], config['isy']['port'], config['isy']['user'], config['isy']['password'], False, "1.1", logger)
  File "../PyISY/PyISY/ISY.py", line 84, in __init__
    self.nodes = Nodes(self, xml=self.conn.getNodes())
  File "../PyISY/PyISY/Nodes/__init__.py", line 73, in __init__
    self.parse(xml)
  File "../PyISY/PyISY/Nodes/__init__.py", line 223, in parse
    uom=units, prec=prec),
UnboundLocalError: local variable 'units' referenced before assignment

@cptechie They keep breaking PyISY, I just committed a quick hack that should fix your issue. Run update.sh to get the latest PyISY and try again.

@jimboca Sorry to be the bearer of bad news but it's still not working, this time with a different traceback though. I removed my ISY's MAC address from the output below.

user@ISYHelper:~/isyhelper/ISYHelper$ ./isyhelper.py
ISYHelper: Version 1.15 Started: 2016-11-26 19:49:48.792781
isyhelper: host: 10.0.1.61:8080
This host IP is 10.0.1.61
isyhelper: Writing to log: isyhelper.log level=debug
Initializing new helper: PyHue
  Scheduling helper: PyHue
Starting PyISY: host=10.0.1.150 PORT=80
Traceback (most recent call last):
  File "./isyhelper.py", line 72, in <module>
    isy = PyISY.ISY(config['isy']['host'], config['isy']['port'], config['isy']['user'], config['isy']['password'], False, "1.1", logger)
  File "../PyISY/PyISY/ISY.py", line 84, in __init__
    self.nodes = Nodes(self, xml=self.conn.getNodes())
  File "../PyISY/PyISY/Nodes/__init__.py", line 73, in __init__
    self.parse(xml)
  File "../PyISY/PyISY/Nodes/__init__.py", line 233, in parse
    Group(self, nid, nname, members, controllers), ntype)
  File "../PyISY/PyISY/Nodes/group.py", line 40, in __init__
    for m in self.members]
  File "../PyISY/PyISY/Nodes/__init__.py", line 314, in __getitem__
    raise KeyError('Unrecognized Key: [' + val + ']')
KeyError: u'Unrecognized Key: [XX:XX:XX:XX:XX:XX]'
Exception AttributeError: "'Group' object has no attribute '_membersHandlers'" in <bound method Group.__del__ of <PyISY.Nodes.group.Group object at 0xb5b50fec>> ignored

Sorry, there are a bunch of changes in this section of the PyISY code. I'm trying to get the author of those changes to make some fixes, and hopefully get it merged soon.

But, why do you have a Scene with your ISY MAC address? Where did that come from?

@cptechie Wait, or you have a node in a scene that is the ISY? Is this something new in the latest release?

@jimboca Yes, that is a change that was made to the xml response. It can be seen in the XML that I have shared above.

@cptechie Sorry, I never saw the file you shared on dropbox, I'll review it.

@cptechie Run update.sh again and try. Really weird that the ISY MAC is a member of the scene, but there is not a node associated with it... No guarantee since I can't test this, but hopefully it will work. If not I'll need you to grab a debug version and try.

Sorry for the late reply. Sorry, but this also didn't work.

user@ISYHelper:~/isyhelper/ISYHelper$ ./isyhelper.py
ISYHelper: Version 1.15 Started: 2016-11-29 06:54:45.280704
isyhelper: host: 10.0.1.61:8080
This host IP is 10.0.1.61
isyhelper: Writing to log: isyhelper.log level=debug
Initializing new helper: PyHue
  Scheduling helper: PyHue
Starting PyISY: host=10.0.1.150 PORT=80
Traceback (most recent call last):
  File "./isyhelper.py", line 72, in <module>
    isy = PyISY.ISY(config['isy']['host'], config['isy']['port'], config['isy']['user'], config['isy']['password'], False, "1.1", logger)
  File "../PyISY/PyISY/ISY.py", line 84, in __init__
    self.nodes = Nodes(self, xml=self.conn.getNodes())
  File "../PyISY/PyISY/Nodes/__init__.py", line 52, in __init__
    self.parse(xml)
  File "../PyISY/PyISY/Nodes/__init__.py", line 210, in parse
    Group(self, nid, nname, members, controllers), ntype)
  File "../PyISY/PyISY/Nodes/group.py", line 40, in __init__
    for m in self.members]
  File "../PyISY/PyISY/Nodes/__init__.py", line 301, in __getitem__
    raise KeyError('Unrecognized Key: [' + val + ']')
KeyError: u'Unrecognized Key: [ADR0001]'
Exception AttributeError: "'Group' object has no attribute '_membersHandlers'" in <bound method Group.__del__ of <PyISY.Nodes.group.Group object at 0xb5bb1dcc>> ignored

Actually, last error is fixed, it ignored the ISY, now need to figure out how to ignore this one.

@cptechie Try again, it should really be fixed this time. I just have PyISY ignore group with flag=12.

@jimboca That did the trick! Thanks for your relentless commitment!

Glad to hear, thanks for relentless testing :-)