PalChgo Posted April 21, 2013 Posted April 21, 2013 I was beginning to mess around with the eventghost and can confirm it works with 3.3.10 and not the latest beta
Michel Kohanim Posted April 21, 2013 Posted April 21, 2013 Does anyone else have the source for this plugin? With kind regards, Michel
PalChgo Posted April 21, 2013 Posted April 21, 2013 Hi Michel, I opened up the ISYEvent.zip file and its kinda like a configuration file and some call outs to the ISY. You guys may have more luck than me at figuring out how to fix it. ISYevent.zip
Michel Kohanim Posted April 22, 2013 Posted April 22, 2013 Hi PalChgo, Thanks so very much. Please replace class ISYeventer(asynchat.async_chat) with the following: class ISYeventer(asynchat.async_chat): """Telnet engine class. Implements command line user interface.""" def __init__ (self, host, port, username, password, plugin): asynchat.async_chat.__init__(self) self.set_terminator("\n") self.data = "" self.host=host self.port=port self.username=username self.password=password self.plugin=plugin # connect to ftp server self.create_socket(socket.AF_INET, socket.SOCK_STREAM) eg.RestartAsyncore() self.connect((self.host, self.port)) def handle_connect(self): # connection succeeded subscribestr="REUSE_SOCKETinfinite" self.push("POST /services HTTP/1.1\r\n") self.push("Host: " + str(self.host) + ":" + str(self.port)+"\r\n") self.push("Content-Length: "+str(len(subscribestr))+"\r\n") self.push("Content-Type: text/xml; charset=\"utf-8\"\r\n") self.push("Authorization: Basic "+ base64.encodestring('%s:%s' % (self.username, self.password))) self.push(subscribestr+"\r\n") def handle_close(self): self.plugin.TriggerEvent("Subscription-Closed", str(self.host)+":"+str(self.port)) self.close() def handle_expt(self): # connection failed self.plugin.TriggerEvent("Subscription-Error", str(self.host)+":"+str(self.port)) self.close() def collect_incoming_data(self, data): # received a chunk of incoming data self.data = self.data + data def found_terminator(self): # got a response line data = self.data if data.endswith("\r"): data = data[:-1] self.data = "" if (data.find("HTTP/1.1 200 OK") > -1): self.plugin.TriggerEvent("Subscribed", str(self.host)+":"+str(self.port)) if (data.find(" -1): epx=data.find(" eprops=data[epx] eprops=eprops[eprops.find(">")+1:] #print "E:",eprops status="None" node="None" Heartbeat="None" RunProg="None" Program="None" icmd="None" econtrol="None" eaction="None" enode="None" if (eprops.find("") > -1): econtrol=eprops[eprops.find("")+9:eprops.find("")] if (eprops.find("") > -1): eaction=eprops[eprops.find("")+8:eprops.find("")] if (eprops.find("") > -1): enode=eprops[eprops.find("")+6:eprops.find("")] if (eprops.find("") > -1): eeventinfo=eprops[eprops.find("")+6:eprops.find("")] if (eeventinfo.find("[") >-1): enode=eeventinfo[eeventinfo.find("[")+1:eeventinfo.find("]")].strip() icmd=eeventinfo[eeventinfo.find("]")+1:].strip() if (eeventinfo.find("") >-1): Program=eeventinfo[eeventinfo.find("")+4:eeventinfo.find("")] if econtrol=="_0": self.plugin.TriggerEvent("Heartbeat") elif econtrol=="ST" or econtrol=="RR" or econtrol=="OL": self.plugin.TriggerEvent("Status",str(enode)+":"+str(eaction)) self.plugin.xlightmap[str(enode)]=str(eaction) for index, sublist in enumerate(self.plugin.devices): if sublist[0] == str(enode): sublist[2]=str(eaction) color=str(hex(int(eaction)))[2] sublist[3]=color+color+color elif econtrol=="_1": if Program=="None": self.plugin.TriggerEvent("Command."+str(enode)+":"+str(icmd)) else: self.plugin.TriggerEvent("Program."+str(Program)) # This processes pre-2.6 beta commands if (data.find("") > -1): eprops=data[data.find(" # print "E:",eprops status="None" node="None" Heartbeat="None" RunProg="None" Program="None" icmd="None" while (eprops.find("")>-1): dpoint=eprops[eprops.find("")+12:eprops.find("")] eprops=eprops[eprops.find("")+13:] tpoint=dpoint[dpoint.find("")] dpoint=dpoint[dpoint.find(">")+1:dpoint.find(""+tpoint+">")] #print "Type: ",tpoint, "Data: ",dpoint if (tpoint=="node"): node=dpoint elif (tpoint=="ST"): status=dpoint #if (tpoint=="RR"): # status=dpoint elif (tpoint=="_0"): Heartbeat="Heartbeat" elif (tpoint=="_1"): RunProg=dpoint elif (tpoint=="eventInfo"): if (dpoint.find("[") >-1): node=dpoint[dpoint.find("[")+1:dpoint.find("]")].strip() icmd=dpoint[dpoint.find("]")+1:].strip() if (dpoint.find("") >-1): Program=dpoint[dpoint.find("")+4:dpoint.find("")] else: status=tpoint+":"+dpoint if (node != "None" and status != "None"): self.plugin.TriggerEvent("Status",str(node),str(status)) self.plugin.xlightmap[node]=status if not(str(node) in eg.globals.excludedinsteondevices): for index, sublist in enumerate(self.plugin.devices): if sublist[0] == str(node): sublist[2]=str(status) if (Heartbeat == "Heartbeat"): self.plugin.TriggerEvent("Heartbeat") if (RunProg != "None" and Program != "None"): self.plugin.TriggerEvent("Program."+str(Program)) if (icmd != "None" and icmd != "None"): self.plugin.TriggerEvent("Command."+str(node)+":"+str(icmd)) With kind regards, Michel
PalChgo Posted April 22, 2013 Posted April 22, 2013 Thanks Michel, I will try and check this out today or tomorrow. Hopefully it solves the problem and also fixes the other guys that have reported an issue.
PalChgo Posted April 23, 2013 Posted April 23, 2013 Hi Michel, Ok I tried doing a cut and paste into the file and all sorts of issues trying it that way so I went through the original and the parts you posted. I think you had only changed one line self.push("POST /services HTTP/1.1\r\n") Can you confirm that as true.. I was able to just edit the file and make that one change. When it runs I can see it open up the dialog for a split second and then it closes the connection. The eventghost comes up with the following (Note the first three Lines are the error lines): 20:47:55 File "C:\Program Files (x86)\EventGhost\plugins\ISY\__init__.py", line 436, in GetNodesConfig 20:47:55 if (xadd not in eg.globals.excludedinsteondevices): 20:47:55 AttributeError: 'Bunch' object has no attribute 'excludedinsteondevices' 20:47:55 Insteon.Authenticated '192.168.1.253:80' 20:47:55 Insteon.Set Log Level to 1 '192.168.1.253:80' 20:47:55 Main.OnInit 20:47:55 Insteon.Subscription-Closed '192.168.1.253:80' Just an fyi I do not have the networking module. I'm gonna play with this a little more and look at this globabls.exclude line. Maybe something needs to be added there.. Let me know if you have any more clues. Thanks!
Michel Kohanim Posted April 23, 2013 Posted April 23, 2013 Hi PalChgo, No, you also need the following: subscribestr="REUSE_SOCKETinfinite" And, you need to remove a few headers. It's best to simply copy the whole function as-is again. With kind regards, Michel
PalChgo Posted April 29, 2013 Posted April 29, 2013 I know there's a few others who were using Eventghost. As you saw Michel posted some changes that needed to be replaced in the isyevent file that you have to use with EG. Have any of you tried to get this working? I've tried doing a full cut and paste of the area that he has changed and the program really blows up and I can only guess its got something to do with CR/LF or a tabbing issue with the editor I am using. So I opened up the original file and have gone through line by line doing a cut in paste where necessary and it still does not seem to be working for me. It doesn't blow up like it did when I cut and paste the entire section that Michel posted before but it does close down the connection with this error. 17:41:34 File "C:\Program Files (x86)\EventGhost\plugins\ISY\__init__.py", line 432, in GetNodesConfig 17:41:34 if (xadd not in eg.globals.excludedinsteondevices): 17:41:34 AttributeError: 'Bunch' object has no attribute 'excludedinsteondevices' 17:41:34 Insteon.Authenticated '192.168.1.253:80' 17:41:34 Insteon.Set Log Level to 1 '192.168.1.253:80' 17:41:34 Main.OnInit 17:41:44 Insteon.Subscription-Closed '192.168.1.253:80' I've spent hours just trying to make this work and have become obsessed with making this work again.. Anyone else figured this out. I'll post what I have edited in case some of you don't have it... __init__.zip
Michel Kohanim Posted April 30, 2013 Posted April 30, 2013 Hi PalChgo, Please contact me via email and attach what you already have and I'll try to help .. (support@universal-devices.com). With kind regards, Michel
evilpete Posted May 5, 2013 Posted May 5, 2013 I'll take a look at this later today, and see if I can fix things I already have a Python API that works with both 3.3.10 on a ISY991 and 4.0.4 on a ISY994 The API is available at https://github.com/evilpete/ISYlib-python with the relevant Event 'subscribe' code is at : https://github.com/evilpete/ISYlib-python/blob/master/ISY/IsyEvent.py#L429
Physpher Posted May 8, 2013 Posted May 8, 2013 If it's of interest to you, I wrote an eventghost plugin for the ISY-99i a while back. It's still a work in progress (as all of these things tend to be) but it already does quite a bit. I've attached my latest version here in case you want to play with it. It automatically shows events and allows you to send commands. Device status is monitored and stored in a python list called eg.plugins.ISYEvent.plugin.devices, so you can use that in conjunction with the Eventghost webserver's Jinja templates and for loops to show status (which is my primary use case). ~K Bringing this thread back from the dead. King, how do you dim individual devices to specified level (e.g. .../DON/128)? I have tried a few different ways of adding "/" but none work. To compensate, I have a few macros that are DON then 8*x (x=1,2, or 3) DIMs. The only downside to this is that it takes a little while to dim down (and I try to be a minimalist when it comes to this stuff, but that isn't a real issue). Thanks, Bryan
GeneInSoCal Posted May 12, 2013 Posted May 12, 2013 Has anyone gotten this Event Ghost plugin to work with ISY-994i as of yet? I too tried to modify the .ini file with Wordpad as well as Notepad and it still does not work. If someone has, could you please post the file like the initial configuration file on page 1 of this posting. Thanks, Gene
Michel Kohanim Posted May 12, 2013 Posted May 12, 2013 Hi Gene, PalChgo seems to have fixed the issue. He was going to post back after some cleanup. With kind regards, Michel
Drosen Posted May 25, 2013 Posted May 25, 2013 Has anyone figured out ISYevent.zip that works with ISY v4.0.x? Would be a good addition. Thanks, Dave
PalChgo Posted May 27, 2013 Posted May 27, 2013 Hi Guys, Just been so busy lately haven't had a chance to follow the threads. I did get the event ghost working with some assistance. I have not gotten to clean up where the initial errors occur when it starts but it does not seem to affect the operation. Posted below is the file you need to put in the event plugin module.. eventghostforisy.zip
GeneInSoCal Posted May 27, 2013 Posted May 27, 2013 Yahooooooooo...it works. Thank you for your efforts. Gene
abuttino Posted September 26, 2013 Posted September 26, 2013 There is one problem left with this plugin in it's last form, there seems to be an error on exit, it's not "releasing" properly and keeps eventghost open forever on exit. Other than that, it works perfect. Can anyone take a look? __init__.zip
abuttino Posted September 26, 2013 Posted September 26, 2013 Nevermind... It was a different EG plugin that wasn't allowing me to exit properly.
bocarob Posted November 28, 2013 Posted November 28, 2013 Hi can some one explain how to program event ghost to run a program I assume that send manual command it the ticket but what goes where ....control action etc many thanks .. Robert
bocarob Posted December 5, 2013 Posted December 5, 2013 Come on guys is no one using this plugin.......many thanks in advance
isyrocks! Posted December 10, 2013 Posted December 10, 2013 Absolutely loving this program. Thankyou Thankyou for the the plugin. Security Question: How secure is my ISY password which is stored inside of EventGhost ISY Plugin Config? Is it now stored in plain text somewhere on my computer? Just wondering if I need to take any further precautions. Thanks in advance.
isyrocks! Posted January 2, 2014 Posted January 2, 2014 I have easily discovered ways for my ISY to call Eventghost Macros. What I have not been able to figure out is how to have Eventghost call an ISY program. Could you point me in the right direction? Can I execute the runThen section of an ISY program by using the "Send Manual Command" function? What would I put under control/action/flag/node? Thanks in advance.
JST829 Posted January 23, 2014 Posted January 23, 2014 I have EventGhost installed with the ISY plugin. Thanks for the work you did on this! I see all of my ISY events showing up in the log - great! However, when I drag an event over to a macro, it doesn't copy the full event -- it just copies a generic term, like 'insteon.command'. Therefore, my macro executes whenever EventGhost sees ANY 'insteon.command', not just the command I want it to react to. I've attached a screenshot of this behavior. Anyone know what I'm doing wrong?
isyrocks! Posted January 23, 2014 Posted January 23, 2014 Here is how I am doing it: I create a program. Every program get's a unique number. The program contents is empty. I then run the program by right clicking on it and choosing run and then I get the corresponding event in EG. You can also look up the unique numbers in the summary page on the ISY. Then I just make respective calls to the program when I want to trigger something in EG. Seems to be working great so far. Not sure how others are doing things.
Recommended Posts