Page 1 of 1

Simple EG Database

Posted: Fri Sep 11, 2015 3:17 am
by kgschlosser
I have made a kind of database for EG, I used and modified a MySQL plugin I found here on the forums but every query took exactly 2.7 seconds far to slow for storing things like remote codes and what have you.

so what I have done is created a kind of database that will save and load to/from a file.

and it removes the complications of having to learn the different standard python data types.

it is not yet finished but I am stuck with trying to make the actions appear properly in EG.

attached is the plugin. and there are things that still have yet to be finished buy any ideas and or suggestions would be really appreciated.

and how and what exactly I am doing wrong when using the AddAction.

Thanks again

Re: Simple EG Database

Posted: Tue Sep 15, 2015 2:52 am
by kgschlosser
ok problem sorted with the Action name and descriptions. still a work in progress. but here is the newest version.


Re: Simple EG Database

Posted: Thu Sep 17, 2015 2:33 am
by kgschlosser
Added a transfer Action.

Completed the delete Action.

Refined the load and save Actions.

To Do -
Checking for directory existence on the load and save.
Load and Save to MySQL Database.
Load and Save to MSSQL Database.

Timer feature for automatic save (gonna need some help with that one I think)

Any Suggestions and or Errors please let me know.



Re: Simple EG Database

Posted: Sun Sep 27, 2015 2:27 am
by kgschlosser
I have attached a more updated version. and is actually working properly. LOL

if you happen across any notifications that have swears in them let me know as sometimes i do that because i get aggravated when trying to get something to run right.

It has been about a week or so since i modified the plugin last so i don't remember exactly what changes i made but I know i did make a lot this time around.

if you move the plugin the the Autostart tree to the top it will load first.

one major modification i added was an event is triggered as soon as the plugin is done loading. since eventghost all plugins first before it registers an init command i found this useful as a true Eventghost just started Event and not one that runs after all plugins have loaded first. Purpose for that is if you have script errors on occasion from something that you have happening using the main.init event that's because one of your plugins events is dependant on say a variable that needs to be set when EG loads. problem is if the plugin loads before the variable is set and error will occur. this is a solution to that problem.

I just found it useful

just remember you have to move the plugin to the top of the Autostart tree. that way the event will trigger before any other plugin loads.

what I have personally done since I have a highly modified version of the HarmanKardon plugin running (to be honest i don't think there is much original code left) and that plugin contains over 600 line items as well as all the serial commands is i have moved all of these items into a common location. as well as my smart TV It centralizes management a lot.

Re: Simple EG Database

Posted: Wed Nov 09, 2016 7:46 am
by pearbear
This plugin was causing the translation editor(eventghost -translate command line option) to not load. The problem was caused by the line:

Code: Select all

text = Text
in the action classes. I have managed to fix this issue while still allowing the issues to share the strings from the Text class. The updated plugin is attached.

Re: Simple EG Database

Posted: Thu Nov 10, 2016 7:54 am
by kgschlosser
ok i re wrote the thing. chopped it down to about 500 lines or so. and the horrible thing is that 60-70% of those lines are for backwards compatibility so it will function as it does now. otherwise it would have been maybe 200 lines.

but i do need someone's save file to test the thing with. the version i am running on my setup has a lot of alterations and causes problems during conversion. so i would like to use someone's save file for a more "real world" testing

Re: Simple EG Database

Posted: Tue Aug 29, 2017 11:03 am
by Foune

Are you still waiting for a tester?
I can try your work in the next weeks if I can. Is your Wed Nov 09, 2016 zip file still up to date?

Re: Simple EG Database

Posted: Wed Aug 30, 2017 4:26 am
by kgschlosser
ya know. I would have to go and dig the thing out. But in all honesty. this thing was i believe my very first plugin.. and really isn't that good. But the one that is posted should work just fine. as long as you don't need to use the language editor as I think there is some issues with how i set the thing up. that is the only problem with it that i am aware of.

I would have to see if i can locate the newest one i made as it was a while ago that i made it.

Re: Simple EG Database

Posted: Fri Feb 23, 2018 11:53 pm
by Snowbird

I might be interested by this plugin, is there any update or upgrade since then ? :)

Re: Simple EG Database

Posted: Sun Feb 25, 2018 8:38 pm
by Snowbird
is the parsing to use variables is enabled ? it doesn't seem to work.

Re: Simple EG Database

Posted: Mon Feb 26, 2018 5:58 am
by kgschlosser
This plugin is EOL and has to many issues. One of them being that the storage container I am using is mutable. and also the plugin is not thread safe. I would need to rewrite it to make it work properly. These are things I did not know about when i made it. This was the very first plugin I had ever made. I should rewrite the plugin it would make it more efficient as well as make it thread safe and not mutable.

and to answer your question it does not make use of parsing variables passed into it.

Re: Simple EG Database

Posted: Mon Feb 26, 2018 8:14 am
by Snowbird
ok, thanks for your reply, too bad I started liking it :)

It was a good idea to have a database, EG was missing this feature, it would be so nice to store some values, for example temperatures indefinitely and query what was the temperature on a specific day/hour. There is also another feature that is missing in EG, it's the ability to graph series of values, I think it should be included in the webserver plugin, but it's related in some way to this database plugin, we collect data and display them on a graphic.

Re: Simple EG Database

Posted: Mon Feb 26, 2018 9:25 am
by kgschlosser
The graphic thing is very complex. I do understand what you want with that bit of it. What makes it complex is how the information is to be computed to generate the graph. And how to allow the user to input that information in a manner that could be converted into python code.

As far as the database thing. I know that EG needs some form of a database and there are several already made libraries that could be used. I have to do some checking to see if the mysql connector has fixed the speed issue as this is one of the things I wanted to use initially. But the 2-3 second lag each time a query was made was an issue.

I will revisit this.

Re: Simple EG Database

Posted: Fri Mar 02, 2018 9:59 am
by Snowbird
I've found some good candidates : ... nydb-zodb/

this one in particular :