Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
SunTracker - with moving ghost
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Dear Pako,
Actually, as usual, a very good suggestion! Maybe I could add a checkbox where you can select 'SunTracker.WeatherConditionChanged' or the current type of event?
Best regards, Walter
Actually, as usual, a very good suggestion! Maybe I could add a checkbox where you can select 'SunTracker.WeatherConditionChanged' or the current type of event?
Best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: SunTracker - with moving ghost
Dear Walter !
A user who is accustomed to the current state and meets him, he does not need to change anything.
But the user like me, he can select the mode that suits him more.
Great !
Best regards, Pako
I think that is the ideal solution.krambriw wrote: Maybe I could add a checkbox where you can select '<prefix>.WeatherConditionChanged' or the current type of event?
A user who is accustomed to the current state and meets him, he does not need to change anything.
But the user like me, he can select the mode that suits him more.
Great !
Best regards, Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Dear Pako!
A new version is attached. See pictures below.
Here the selection is for getting an event even if the weather condition is unchanged Here the setting to get an event only if the weather condition is changed compared to previous The upgrade procedure is the same as before (since an attribute has been added, it is needed to it like this)
1) When EG is running current version, disable the SunTracker plugin and all SunTracker actions so that they all stops
- save and exit EG
2) Replace with the new version (see first post)
- start EG again
3) Now configure the SunTracker plugin:
- accept or change the event prefix
- check the boxes to select when the event shall happen
When finished, click ok, then enable the plugin so that it starts.
4) Now for each action, configure each of them by opening them and clicking ok
5) Enable each of the actions
6) Open the settings for the plugin again and check that they are all running
- save the configuration
7) You are done!
Kind regards, Walter
A new version is attached. See pictures below.
Here the selection is for getting an event even if the weather condition is unchanged Here the setting to get an event only if the weather condition is changed compared to previous The upgrade procedure is the same as before (since an attribute has been added, it is needed to it like this)
1) When EG is running current version, disable the SunTracker plugin and all SunTracker actions so that they all stops
- save and exit EG
2) Replace with the new version (see first post)
- start EG again
3) Now configure the SunTracker plugin:
- accept or change the event prefix
- check the boxes to select when the event shall happen
When finished, click ok, then enable the plugin so that it starts.
4) Now for each action, configure each of them by opening them and clicking ok
5) Enable each of the actions
6) Open the settings for the plugin again and check that they are all running
- save the configuration
7) You are done!
Kind regards, Walter
Last edited by krambriw on Thu Apr 17, 2014 8:07 am, edited 2 times in total.
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: SunTracker - with moving ghost
Dear Walter,
Thank you for your extraordinary support.
I set Create only on weather change and now I'm waiting until the weather changes.
We just have SunTracker.Weather Condition: 'Sunny' and it appears that at least a few hours it will be the same.
BTW: what settings you use it (regarding the last new options) ?
Best regards, Pako
Thank you for your extraordinary support.
I set Create only on weather change and now I'm waiting until the weather changes.
We just have SunTracker.Weather Condition: 'Sunny' and it appears that at least a few hours it will be the same.
BTW: what settings you use it (regarding the last new options) ?
Best regards, Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Dear Pako,
That is excellent, sunny weather is nice! Here, since yesterday we have 'Fair' weather, means clear and sunny, also very good...
My settings are updating weather data every 5 minutes and I get an event every minute because I need it for a specific purpose
Reason is I have a web page on android tablets showing current status of various things and it is updated with your Tornado plugin with websockets. The current html coding could eventually be improved so that I could avoid to update all the time but it works fine right now so I left it as is.
In the web page (see picture below) I have a banner showing a mix of information as well as a number of buttons to control and show status of lamps and other things. Everything is updated using websockets and it works very well.
My best regards, Walter
That is excellent, sunny weather is nice! Here, since yesterday we have 'Fair' weather, means clear and sunny, also very good...
My settings are updating weather data every 5 minutes and I get an event every minute because I need it for a specific purpose
Reason is I have a web page on android tablets showing current status of various things and it is updated with your Tornado plugin with websockets. The current html coding could eventually be improved so that I could avoid to update all the time but it works fine right now so I left it as is.
In the web page (see picture below) I have a banner showing a mix of information as well as a number of buttons to control and show status of lamps and other things. Everything is updated using websockets and it works very well.
My best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
New version is now published in the first post
New features:
When set to vacation or empty house mode, the special day and time settings will be used instead of the normal Monday to Sunday settings
The plugin is utilizing Yahoo! Weather to get current local weather conditions. To find your location ID, browse or search for your city from the Yahoo! Weather home page(http://weather.yahoo.com/) The weather ID is in the URL for the forecast page for that city. You can also get the location ID by entering your zip code on the home page. For example, if you search for Berlin in Germany on the Yahoo! Weather home page, the forecast page for that city is http://weather.yahoo.com/germany/berlin/berlin-638242/. The location ID is 638242.
To upgrade from a previous version, it is very important to follow the steps described in the first post.
New features:
The vacation and empty house modes are useful when you need to have different behavior of your home automation when you have vacation or if you are away from your house (like a holiday stay elsewhere). To activate the different modes you can use python scripts that you can can trigger with suitable events. The python syntax looks like in the following example:- Added plugin setting for customizing the event prefix
- Weather condition event now synchronized with the update rate
- Added plugin setting to select if weather condition event will be triggered on weather changes only
- Added new day type, 'empty house', and new empty house mode. Empty House mode can be set from external signal and is also saved persistent
- Fixed a bug in function for setting vacation mode. Vacation mode set from external signal is now also saved persistent.
- Synchronization is deactivated during vacation and empty house modes
Code: Select all
#To set/unset vacation mode
eg.plugins.Suntracker.plugin.vacation_m = True
eg.plugins.Suntracker.plugin.vacation_m = False
Code: Select all
#To set/unset empty house mode
eg.plugins.Suntracker.plugin.emptyHouse_m = True
eg.plugins.Suntracker.plugin.emptyHouse_m = False
The plugin is utilizing Yahoo! Weather to get current local weather conditions. To find your location ID, browse or search for your city from the Yahoo! Weather home page(http://weather.yahoo.com/) The weather ID is in the URL for the forecast page for that city. You can also get the location ID by entering your zip code on the home page. For example, if you search for Berlin in Germany on the Yahoo! Weather home page, the forecast page for that city is http://weather.yahoo.com/germany/berlin/berlin-638242/. The location ID is 638242.
To upgrade from a previous version, it is very important to follow the steps described in the first post.
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: SunTracker - with moving ghost
Hi Walter,
I have a trouble with this plugin (1.5.2).
Here's how you can reproduce it:
1.) Open a new (empty) configuration file
2.) Add the plugin SunTracker (no need to set anything)
3.) Save the file under any name.
4.) Close and reopen EventGhost
5.) Disable the plugin SunTracker
6.) Save the file
7.) Close EventGhost
8.) Restart EventGhost
9.) Close the EventGhost
Here's the problem: EventGhost will remain in memory.
The procedure looks as absurd. However, you must understand that it is very simplified.
In fact, I perform various other actions and I have some plugins disabled...
Best regards,
Pako
I have a trouble with this plugin (1.5.2).
Here's how you can reproduce it:
1.) Open a new (empty) configuration file
2.) Add the plugin SunTracker (no need to set anything)
3.) Save the file under any name.
4.) Close and reopen EventGhost
5.) Disable the plugin SunTracker
6.) Save the file
7.) Close EventGhost
8.) Restart EventGhost
9.) Close the EventGhost
Here's the problem: EventGhost will remain in memory.
The procedure looks as absurd. However, you must understand that it is very simplified.
In fact, I perform various other actions and I have some plugins disabled...
Best regards,
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Thanks Pako, this is of course no good behaviour, I just wonder how to fix it
What could be blocking the termination? Since the plugin is already disabled one would expect that EG is not doing anything but I think at least the code is also checked for disabled plugins (if there is a syntax error in a disabled plugin, this will also be recognized at startup).
If I just could understand what is happening? Could it be that EG is running some of the code even though the plugin is disabled???
My best regards, Walter
What could be blocking the termination? Since the plugin is already disabled one would expect that EG is not doing anything but I think at least the code is also checked for disabled plugins (if there is a syntax error in a disabled plugin, this will also be recognized at startup).
If I just could understand what is happening? Could it be that EG is running some of the code even though the plugin is disabled???
My best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: SunTracker - with moving ghost
Hi Walter !
Best regards,
Pako
Maybe if you use -debug switch, so you'll see it.krambriw wrote:What could be blocking the termination?
Best regards,
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Thanks Pako, I saw the problem with the debug...
The attached version is working now (I made it a beta version untill we know for sure it is OK...).The problem was related to persistent data. I wanted to save some data (variables) persistent (using eg.PersistentData) but when the plugin was closed, the variables to be stored where not alive anymore
So in this version I have removed the persistens for those variables. My ideal solution is yet to be found.
My best regards & thank you,
Walter
The attached version is working now (I made it a beta version untill we know for sure it is OK...).The problem was related to persistent data. I wanted to save some data (variables) persistent (using eg.PersistentData) but when the plugin was closed, the variables to be stored where not alive anymore
So in this version I have removed the persistens for those variables. My ideal solution is yet to be found.
My best regards & thank you,
Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: SunTracker - with moving ghost
Hi Walter!
I thank you for prompt resolution. It seems to be fine.
Yes, I also had some problems earlier (I do not remember the details) with eg.PersistentData and I stopped using it.
There is certainly several possibilities how to solve it, but I use only two options.
1) Saving to an external file (eg xml format). As an example I can mention SchedulGhost. This is definitely the most clean solution.
2) Saving directly into the configuration file (self.info.treeItem). Right now I can not remember a suitable example. But it is not completely clean solution, I think.
Best regards,
Pako
I thank you for prompt resolution. It seems to be fine.
Yes, I also had some problems earlier (I do not remember the details) with eg.PersistentData and I stopped using it.
There is certainly several possibilities how to solve it, but I use only two options.
1) Saving to an external file (eg xml format). As an example I can mention SchedulGhost. This is definitely the most clean solution.
2) Saving directly into the configuration file (self.info.treeItem). Right now I can not remember a suitable example. But it is not completely clean solution, I think.
Best regards,
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Dear Pako,
Thank you for your feedback!
Related to the above, in the attached simple plugin, I have only a variable (var1) that I can configure either 'True' or 'False'. In runtime, I can change the value very simple by using this code:
Do you know if there is a way to make the plugin save the new configuration in runtime? So if I open the config dialog, this is correctly reflected in the checkbox? If this would be possible, that would then also solve my problem...
My best regards, Walter
Thank you for your feedback!
Related to the above, in the attached simple plugin, I have only a variable (var1) that I can configure either 'True' or 'False'. In runtime, I can change the value very simple by using this code:
Code: Select all
eg.plugins.MyPlugin.plugin.var1 = True
eg.plugins.MyPlugin.plugin.var1 = False
My best regards, Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: SunTracker - with moving ghost
Yes it is possible.krambriw wrote:Do you know if there is a way to make the plugin save the new configuration in runtime? So if I open the config dialog, this is correctly reflected in the checkbox?
Look at Nmap plugin.
Compare versions 0.2 and 0.3.
Pako
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: SunTracker - with moving ghost
Hi Walter!
I apologize for my previous brief answer.
I had to go to sleep, but I wanted to write something.
So here is the modified plugin (version 0.0.1):However, the command is to be changed:I had to find a way to make it work regardless of the thread from which it started.
Best regards,
Pako
I apologize for my previous brief answer.
I had to go to sleep, but I wanted to write something.
So here is the modified plugin (version 0.0.1):However, the command is to be changed:
Code: Select all
eg.plugins.MyPlugin.plugin.SetVar1(True)
eg.plugins.MyPlugin.plugin.SetVar1(False)Best regards,
Pako
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: SunTracker - with moving ghost
Dear Pako, you do never have to apologize! Your advice actually was perfect, I found the way also with your advice
Funny, I was also working this morning with the test version, I also found out I needed the better thread handling...
Anyway, thanks a lot, I think this is a good example, maybe useful for other developers as well
Now I will look at the SunTracker plugin to implement what I have been wanting for long time!!!
My warmest regards,
Walter
EDIT My version is a little bit different, I use a thread that is detecting the variable value change, then terminates itself and calls a function that is updating the configuration. Then the plugin is automatically restarted by the methods you proposed and a new thread is started, just waiting for the variable to change value again. This also works and it allows you to change variable values from a python command or script (or from another plugin).
Using actions as in your example is also working fine. I guess it is a matter of taste which you want to use.
Anyway, both examples will be excellent samples for others as well I think
I will publish mine as well once finished...
Code: Select all
trItem = self.info.treeItem
args = list(trItem.GetArguments())
trItem.SetArguments(args) #automatically __stop__ / __start__
eg.document.SetIsDirty()
eg.document.Save()
Anyway, thanks a lot, I think this is a good example, maybe useful for other developers as well
Now I will look at the SunTracker plugin to implement what I have been wanting for long time!!!
My warmest regards,
Walter
EDIT My version is a little bit different, I use a thread that is detecting the variable value change, then terminates itself and calls a function that is updating the configuration. Then the plugin is automatically restarted by the methods you proposed and a new thread is started, just waiting for the variable to change value again. This also works and it allows you to change variable values from a python command or script (or from another plugin).
Using actions as in your example is also working fine. I guess it is a matter of taste which you want to use.
Anyway, both examples will be excellent samples for others as well I think
I will publish mine as well once finished...
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM