SchedulGhost

Questions and comments specific to a particular plugin should go here.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SchedulGhost

Post by krambriw » Fri May 27, 2016 5:25 am

in my personal belief if something in my home wants to communicate with something else in my home then it shouldn't have to go out onto the internet to do so.
I fully agree on this. But your assumption that you have to go 'outside' when using MQTT is completely wrong. You can, and this is how I have my own setups at home, have one or more so called MQTT brokers locally on your network with no dependencies to the outside. There is nothing that will break suddenly, you decide yourself if & when you would like to update the broker or client software. With MQTT the backward compatibility is key.

The advantage in using MQTT is that you do not need to bother & be worried about many of the things you are mentioning; like client re-connections, getting latest event when connecting, event priorities etc. MQTT software is based on an open standard, provided as open source so there is no risk for any company bankruptcy either.

As for setup & installation, it is not much more complicated than with other software's, there are setup packages for most common platforms, but you have to think differently, it is not a peer-to-peer communication. It is so much better; you have a broker providing data and clients subscribing & publishing. Myself, in my own setups, I have decided to run MQTT brokers under Linux in Raspberry Pi's. This has proven to be rock-solid.

When writing a plugin, you easily embed the MQTT for communication, a good example is my MQTT Client plugin. If it becomes complicated for the end user (or not) is more depending on you as author of the plugin. From my perspective, you may use code from my plugins as you like, they are free software released under GNU (see below).

EDIT: I just forgot one thing, it makes sense not making the plugins too complex, better split the functionality into several plugins and use macros/events/actions. Some of mine are too complex, like SunTracker. But it was one of the first stumbling ones, originating back in 2008 if I remember correctly

Best regards, Walter
The Foundations of the GPL

Nobody should be restricted by the software they use. There are four freedoms that every user should have:

the freedom to use the software for any purpose,
the freedom to change the software to suit your needs,
the freedom to share the software with your friends and neighbors, and
the freedom to share the changes you make.

When a program offers users all of these freedoms, we call it free software.

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: SchedulGhost

Post by Sem;colon » Fri May 27, 2016 1:54 pm

kgschlosser wrote:i know there are already various plugins to do this but would be nice not to have to install a plugin for this dedicated function
but adding the ability to have the plugin trigger the event at sunrise (with a trim option) and sunset (with a trim option as well)

and also adding the ability to send the event off to another computer running eventghost
a second piece would have to be made to listen for the event on the remote computer that shouldn't be to difficult to do. and maybe do a broadcast that way all the person has to do is set a name for each of the running schedule ghosts and a check box to use that feature then the use wouldn't have to be worried about static ip's or remembering who is what.

maybe an option to have it generate html to a file and written to a user selectable directory and name per event would make it easier for posting the events to the webserver plugin for remote checking if the event has occurred

maybe adding the ability to have it display as an OSD overlay when will stay up indefinitely until the mouse is clicked or a specific action is triggered.

and last but not least having it read the schedule from a user created text file xml is easy for you and i but not so easy for everyone else i would suggest having it read directly from google calendars but i think that would be quite a lot of work to do
Hi K,

well, as you can see, SchedulGhost is already not the most easy-to-use plugin, you need some time to get familiar with all it's functionalities.
I'd strongly recommend to not integrate these features into the SchedulGhost plugin, it would make it unnecessarily complex and the Users will be even more confused.
Also, you are much more flexible with a modular approach – after all that’s what plugins are designed for.

One example: I use SchedulGhost on one PC to show an OSD at a given time, to remind me that I need to go to bed, just that, nothing else. The things you suggested are nice, but I don’t need them in my setup at all. So I have actions that need to be initialized at EG startup I’ll never going to use – they are just slowing down the startup for me.

Also, why reinvent the bicycle? All the features you suggested are already available with other plugins, and sometimes more than one!
That gives the user also more flexibility, Example: You trigger an event with SchedulGhost and want to send it to another PC running EventGhost, now the user can decide, if he wants to use MQTT (mqtt plugin), HTTP (webserver plugin) or TCP (TCP plugin) to get the event transferred to the other PC. And that’s awesome.

So, for everything that doesn’t directly have something to do with scheduling, I’d recommend to create another plugin or extending one that does something similar.

I don't recommend it, but it's also possible to create a plugin that uses SchedulGhost as prerequisite. You don’t have to edit a plugin to access it’s functionality.

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

Re: SchedulGhost

Post by kgschlosser » Fri May 27, 2016 6:04 pm

@ semi;colon

I am going to agree with you it is very complex already and i agree with you on the modular approach maybe writing something that the user can add as a plugin that will use the schedule ghost plugin. what i don't know how to do and i have looked into before and can't seem to figure out is how to have a plugin actually install another plugin if it depends on it. I know how to check if it's installed but instead of just sitting there doing nothing and maybe showing an error i would much rather have it load it if it's already added to the plugins folder. maybe add having it download the latest version if it's not and reboot eventghost.

this is why the forums are here tho to put some reality into doing something and that's why i ask before i start most times, to get an objective view of things. and it helps during the brain storming process.
If you like the work I have been doing then feel free to Image

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: SchedulGhost

Post by Sem;colon » Fri May 27, 2016 7:14 pm

Hi K,
good approach, saves time! :)
The problem with resolving the dependencies is the reason why it's not my first recommendation...
I did create plugins that rely on another plugin (e.g. the Webserver - Z-Way plugin) but I also didn't find a good way to automatically add the other plugin to the config (and configure it).
I ended up printing an error if the other plugin is not loaded...
If you find a good way to do it, let me know ;)
You could create a post in the coding corner, maybe someone else knowes?

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

Re: SchedulGhost

Post by kgschlosser » Fri May 27, 2016 11:54 pm

it's funny tho i do remember seeing how exactly it can be done a week or 2 ago, and i said to myself hmm... i have to investigate this a little more. I was right in the middle of looking for something else and i didn't want to get side tracked. now for the life of me i can't remember where or what it was that i saw in the EG core files or what file it was. i am going to go hunting around again in a little bit. I do know how to run a file tho and that may be useful to add the plugin that is required you would have to duplicate the startup parameters in your plugins config to launch it but i am almost thinking that way is better that way you only load the bits you need to use.

K
If you like the work I have been doing then feel free to Image

tjabas
Experienced User
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: SchedulGhost

Post by tjabas » Mon May 30, 2016 9:44 am

Hi

I have a tellstick duo and i Wonder if its possible to start a timer with a push of a button.

Lets say that i start my roof lamp by pushing the Wall switch, it creates an action in eventghost, can this start a timer so the light turns off after about 10 minutes, if its possible, how do i set it up?

Thanks

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SchedulGhost

Post by Pako » Mon May 30, 2016 10:09 am

tjabas wrote:if its possible, how do i set it up?
Of course, it is possible. And it's easy:
SchedulGhost_TimeSpan1.png
SchedulGhost_TimeSpan1.png (11.7 KiB) Viewed 5453 times
SchedulGhost_TimeSpan2.png
SchedulGhost_TimeSpan2.png (3.74 KiB) Viewed 5453 times
Pako
You know flattr ? You can Image

tjabas
Experienced User
Posts: 98
Joined: Sun Feb 07, 2016 6:28 pm

Re: SchedulGhost

Post by tjabas » Mon May 30, 2016 8:08 pm

Pako wrote:
tjabas wrote:if its possible, how do i set it up?
Of course, it is possible. And it's easy:
SchedulGhost_TimeSpan1.png
SchedulGhost_TimeSpan2.png
Pako

thank you, it works great :)

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: SchedulGhost

Post by Sem;colon » Tue Apr 11, 2017 10:05 pm

Hi Pako,

there are some problems with the dialogues in this plugin and EG 0.5.
The "Public holidays ..." windows doesn't show up at all
And the "Show SchedulGhost manager ..." Dialog looks very strange and doesn't work as intended.
sg1.PNG
Will you look into this?
I'm not very good with wx or Python UI in general...

Thank you!

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

Re: SchedulGhost

Post by kgschlosser » Wed Apr 12, 2017 1:37 am

@Sem;colon

This should be a way of adding a plugin programmatically the trick would be to stall your plugins installation somehow without causing EG to hang or to run a thread to check if the other plugin has been installed. this is due to the need for the installation of the other plugin to be in the main thread. that is what the wx.CallAfter does. you need to fill in the 2 places with the proper information but that should be a starting place for ya.

Code: Select all

if not hasattr(eg.plugins, PLUGIN_CLASS_NAME):
    pluginInfo = eg.pluginManager.GetPluginInfo(PLUGIN_NAME/PLUGIN_GUID)
    wx.CallAfter(eg.UndoHandler.NewPlugin(eg.document).Do, pluginInfo)

One other thing. i also looked at that issue with the dialog.. and for the life of me it's a mystery why it is doing that.. it's probably something really simple but nothing jumped out at me. I think it has something to do with the dynamic adding of widgets to a sizer.


***EDIT***

I have made a new post for this in coding corner with complete working code.

viewtopic.php?f=10&t=9642
If you like the work I have been doing then feel free to Image

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SchedulGhost

Post by Pako » Wed Apr 12, 2017 5:36 am

Sem;colon wrote:Hi Pako,

there are some problems with the dialogues in this plugin and EG 0.5.
...
I expect that the transition to 5.0 brings many similar problems.
I have fears that it will require a lot of work and spend a lot of time thus. That's why I still do not plan to transition to 5.0.

Pako
You know flattr ? You can Image

Sem;colon
Experienced User
Posts: 609
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: SchedulGhost

Post by Sem;colon » Wed Apr 26, 2017 4:39 pm

Hmm, fair enough...
But I don't think the release of 0.5 is too far away now and 0.4 will be obsolete by that time ;-)

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

Re: SchedulGhost

Post by kgschlosser » Thu Apr 27, 2017 12:40 am

I am going to make my best effort to make wrappers for things like this. But for the life of me I can't even pinpoint which part is having the problem. I think they may have changed how wxSizer.Clear() works. I am not sure tho. I do want to make this transition as simple as possible for the plugin developers. If someone could tell me exactly what class and function is causing the issue and how exactly it used to work then I could create the wrapper.
If you like the work I have been doing then feel free to Image

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

Re: SchedulGhost

Post by topix » Sat Apr 29, 2017 11:13 am

I took a look at the plugin an tried to fix the layout problems. Attached is a version with dynamic window resizing. The only "problem" now is, that your screen resolution must be at least 1024x768, otherwise the bottom part of the dialog might be hidden for some schedule types.
Attachments
__init__.py
SchedulGhost 0.1.17
(146.56 KiB) Downloaded 121 times
Last edited by topix on Sat Apr 29, 2017 2:41 pm, edited 1 time in total.

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

Re: SchedulGhost

Post by kgschlosser » Sat Apr 29, 2017 1:49 pm

what was it that was causing the problem?

and you forgot to increment the version number
If you like the work I have been doing then feel free to Image

Post Reply