For the diehard EG'rs

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 3407
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

For the diehard EG'rs

Post by kgschlosser » Sun Nov 12, 2017 1:33 am

Ok so here I go again....

On more then one occasion it has been brought up if there is a way to run EG directly from a python interpreter. And the answer is Yes. I have discovered the way to do this. However it is not the simplest process because of the use of wx.App.MainLoop which causes the interpreter to get locked into a loop. So it will not exit.

But the jist of it is you have to make independent threads that you want to carry out whatever it is you want after wx.App.Mainloop runs. But you can set up specific callbacks and register them using eg.Bind and this can be done before the loop is run. So if you wanted to merge EG with specific tasks you can. And the GUI also still operates while it is running from the interpreter. This is my new preffered way of running EG. I have a console so I am able to execute commands and such as well as get logging output without all the "fluff". I am going to write up a nice little package that will simplify this process. But if you want the most basic of displays go to your EG install folder from a command prompt. And type in pyw.exe. this will launch an interpreter.

In that interpreter key in

Import eg

This will get eg part of the way there.

If you then do

eg.debugLevel = 1
eg.Main()

EG will run. And you will notice the debugging output being put into that console window. But you are not able to do anything else from there. So this is where I am going to make up a wrapper to give you functionality and be able to key in commands. And also have the events transferred to the console window.
If you like the work I have been doing then feel free to Image

User avatar
topix
Experienced User
Posts: 390
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: For the diehard EG'rs

Post by topix » Sun Nov 12, 2017 1:53 pm

What's the usecase for this?

User avatar
kgschlosser
Site Admin
Posts: 3407
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: For the diehard EG'rs

Post by kgschlosser » Sun Nov 12, 2017 9:43 pm

use case would be if you wanted to run EG without a GUI say.. On a Windows Core server. But still have log output and still be able to manipulate and add macros.
If you like the work I have been doing then feel free to Image

User avatar
Possessed
Posts: 8
Joined: Thu Jun 01, 2017 5:35 am

Re: For the diehard EG'rs

Post by Possessed » Wed Nov 29, 2017 2:16 am

Probably not the right place to ask....

does eventghost run on Windows 10 IOT core on raspberry pi?

User avatar
kgschlosser
Site Admin
Posts: 3407
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: For the diehard EG'rs

Post by kgschlosser » Wed Nov 29, 2017 4:53 am

not the pie EG has been coded for windows, The original author made a port for linux. but never released it unfortunately. If there is someone that is very familiar with the inner workings of linux I would be more then happy to work on porting it with them.

I think with a wee bit of messin with it I could get it to run on Win IOT. But everything would have to be run from a python shell. Unless someone designed a web front end for it.
If you like the work I have been doing then feel free to Image

User avatar
Possessed
Posts: 8
Joined: Thu Jun 01, 2017 5:35 am

Re: For the diehard EG'rs

Post by Possessed » Thu Nov 30, 2017 4:41 am

Either sounds good - even without a UI - we can develop the setup / config on windows. Doesn't anyone else have a desire to deploy EG on cheap hardware? Perhaps I'm the only one?

But, it could be that either is trek down a long road of pain...

User avatar
kgschlosser
Site Admin
Posts: 3407
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: For the diehard EG'rs

Post by kgschlosser » Thu Nov 30, 2017 6:15 am

well It is going to be a while off before anything like running EG without a GUI is going to happen.

Because you need to be able to configure and use the thing.
I mean You could run EG and load a save file. But you really would not be able to add macros/actions or delete macros/actions from it. and you would have to alter the save file on another PC and send it over to the pi and tell EG to load it. that is not exactly convenient.
If you like the work I have been doing then feel free to Image

User avatar
Possessed
Posts: 8
Joined: Thu Jun 01, 2017 5:35 am

Re: For the diehard EG'rs

Post by Possessed » Thu Nov 30, 2017 2:29 pm

Thanks, that sounds about right - figured it was no slam dunk. I also seeing you guys talk about a python based project home-assistant in another thread http://eventghost.net/forum/viewtopic.p ... ant#p47398 that already runs on a pi. Assuming it runs as fast as EG, I may just port over all the goodness I require from EG to it... Anybody with experience with speed on Pi vs EG on Win with that project?

User avatar
kgschlosser
Site Admin
Posts: 3407
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: For the diehard EG'rs

Post by kgschlosser » Wed Dec 13, 2017 10:03 pm

I have found that most HA software that is web GUI based is really not all that fast. It might be does to it having to generate the code for the pages. But also no other piece of software has the eventing system EG has. It is really simple to use. Home assistant I believe requires you to hard code things like macros (scenes) not something you ha e a drag and drop interface for. We are trying to bring EG up to date and offer things like an Android app with full control. And also a web GUI. But I do not know if the actual windows GUI will ever go away.

This is something that is going to take a huge amount of time and will be almost a full rewrite to do. Because we would need EG to run as a service at that point and we would try to port it to Linux at the same time. I am simply waiting for the person that has the knowledge we need and that person. Is willing to dedicate the time to such an undertaking.

I got the one piece I wanted from Home Assistant to compile on python 2.7 and I am going to bring it over to EG. This is going to take some time for me to do. A d if speed is something you want I have a multi threaded version of EG where it processes more then one event at a time. I should start tinkering with that again at some point. I ha e slot of open projects. I really need to finish some of them up.
If you like the work I have been doing then feel free to Image

Post Reply