Page 31 of 38
Re: SunTracker - with moving ghost
Posted: Thu May 08, 2014 11:09 am
by Pako
Dear Walter,
krambriw wrote:I guess it is a matter of taste which you want to use.
That's certainly true.
However, it is necessary to take into account that (in theory) solution with a separate thread that monitors changes probably causes more resource consumption.
Best regards,
Pako
Re: SunTracker - with moving ghost
Posted: Thu May 08, 2014 12:52 pm
by krambriw
Dear Pako,
So finally, after struggeling a bit with thread handling and configuration dialog, here is my version. It works to change the configuration both from external calls as earlier like
Code: Select all
eg.plugins.MyPlugin.plugin.var1 = True
eg.plugins.MyPlugin.plugin.var1 = False
as well as when using the normal plugin configuration dialog
Now I am happy after this interesting excercise, you learn something everyday
Best regards & thanks for an interesting discussion (and support)
Walter
Re: SunTracker - with moving ghost
Posted: Thu May 08, 2014 4:52 pm
by Pako
Dear Walter,
I tried your version and I have a problem with that.
I opened the configuration dialog, I changed a value of variable and I pressed Apply. Then I pressed OK, but EventGhost crashes.
This is the content of the debug log:
Code: Select all
Traceback (most recent call last):
File "threading.pyc", line 532, in __bootstrap_inner
File "threading.pyc", line 484, in run
File "D:\Programs\E\EventGhost\plugins\TestSample\__init__.py", line 79, in PollingThread
self.SetConfig(self.var1)
File "D:\Programs\E\EventGhost\plugins\TestSample\__init__.py", line 66, in SetConfig
trItem.SetArguments(args) #automatically __stop__ / __start__
File "D:\Programs\E\EventGhost\eg\Utils.py", line 115, in LogItWrapper
return func(*args, **kwargs)
File "D:\Programs\E\EventGhost\eg\Utils.py", line 167, in AssertWrapper
(func.__name__, func.__module__)
AssertionError: Called outside ActionThread: SetArguments() in eg.Classes.PluginItem
Best regards,
Pako
Re: SunTracker - with moving ghost
Posted: Fri May 09, 2014 8:16 am
by krambriw
Dear Pako,
This is strange because it works fine for me (however, I have re-worked it a bit and attached the latest sample).
Things I have seen during my testing is the following:
- it works fine under Windows XP 32 bit SP3 (I have tested on two machines) one with really old EG version 1534 and one with newer 1610
- it does not work with Windows 7 64 bit even if I run as admin. I guess it is the access rights that are blocking somehow
I am in favour of your solution using actions instead of threads for this purpose, I think it will cause less problems. Anyway, was interesting to experiment...
(I am also investigating a problem I saw with 1640, it takes a couple of minutes to start in the Windows XP 32 bit machine so I have for the moment reverted back to 1610 in my development system, 1640 seems however to work fine with Windows 7 64bit)
My kindest regards, Walter
Re: SunTracker - with moving ghost
Posted: Fri May 09, 2014 11:54 am
by Pako
Dear Walter,
Apparently this is somehow enchanted

.
Plus: Now it does not crash EventGhost after pressing the Apply button.
Minus: Change the value using the command does not work (Note: in the previous version I have not tried it).
Best regards,
Pako
Re: SunTracker - with moving ghost
Posted: Fri May 09, 2014 12:32 pm
by krambriw
Dear Pako, that is good to hear
What operating system Windows version and type do you use (32/64bits)?
I assume you used the following commands:
Code: Select all
eg.plugins.MyPlugin.plugin.var1 = True
eg.plugins.MyPlugin.plugin.var1 = False
My best regards
Re: SunTracker - with moving ghost
Posted: Fri May 09, 2014 3:24 pm
by Pako
Dear Walter,
krambriw wrote:What operating system Windows version and type do you use (32/64bits)?
I actually had intended to write, but I forgot about it.
I use Windows 7 - 32bits.
krambriw wrote:I assume you used the following commands ...
Yes.
Best regards,
Pako
Re: SunTracker - with moving ghost
Posted: Fri May 09, 2014 4:20 pm
by krambriw
Hello Pako,
I see, I suspect somekind of access rights problem related to Win 7
When I tried myselfwith Win 7 64 bit , I noticed a difference if I issued the commands from the python shell or if I created a python action inside EG
Best regards & have a nice weekend
Re: SunTracker - with moving ghost
Posted: Mon May 12, 2014 7:55 am
by krambriw
Dear Pako,
I have re-worked some of my plugins (SunTracker & Scheduler) using your proposal and it is working very stable and fine, thank you!
I had some problems with my suggestion using threads, especially in Windows 7 64bit (I think the user access rights could be the cause).
Anyway, the solution using actions are the good way. It works
- Win XP (32bits): without any problems
- Win 7 (64bits): is working ok except saving config unless I run EG as admin (might be that different user rights could solve the issue but I am not allow to configure such settings for my company laptop)
The plugins are now in testing in my production (home automation) system and I will release them shortly if everything continues to work as expected.
My kindest regards,
Walter
Re: SunTracker - with moving ghost
Posted: Mon May 12, 2014 8:20 am
by Pako
Dear Walter,
krambriw wrote:... using your proposal and it is working very stable and fine, thank you!
I always like it when I can help you.
And I have one question:
In SunTracker plugin, it will be possible to change Latitude, Longitude and Location using an action (preferably all at once) ?
I use my laptop in different cities.
Best regards,
Pako
Re: SunTracker - with moving ghost
Posted: Mon May 12, 2014 9:37 am
by krambriw
Dear Pako,
In SunTracker plugin, it will be possible to change Latitude, Longitude and Location using an action (preferably all at once) ?
In current version, you cannot but I will look into this (now that we have this nice mechanism, it will not be hard)
Maybe we can find a service so wherever you have your laptop, the location can get automatically updated (this could work if you do not use a proxy service in some far location, like if you connect to the Tor network or similar...). Maybe a checkbox if you would like manual or automatic update of this feature could be helpful as well?
Best regards, Walter
Re: SunTracker - with moving ghost
Posted: Mon May 12, 2014 10:00 am
by Pako
Dear Walter,
krambriw wrote:Maybe a checkbox if you would like manual or automatic update of this feature could be helpful as well?
Of course it is also a good idea, but the "manual setup" I prefer. And is it even possible to automatically set the (Yahoo) Location code as well?
Best regards,
Pako
Re: SunTracker - with moving ghost
Posted: Mon May 12, 2014 10:08 am
by krambriw
Dear Pako,
I will start with the manual and then we can see later if I find a good automatic variant some time
Best regards, Walter
Re: SunTracker - with moving ghost
Posted: Tue May 13, 2014 8:36 am
by krambriw
Dear Pako,
Here is the first version of SunTracker with the actions
- set plugin configurations for your location specific data including latitude, longitude, time zone and others
- vacation and empty house modes on/off
(find the official updated version in the first post)
Example screen shot:
Just to configure and execute and the plugin will be restarted and settings updated
It is of course still possible to execute the actions from a script the normal way like this:
Code: Select all
eg.plugins.Suntracker.SetLocation(u'test', '18.07', '59.33', u'905335', u'0101,0501,0606,1224,1225,1226', u'0106,0402,0405,0512,0522,0523,0625', u'04', u'09', u'+01.00')
My best regards, Walter
Re: SunTracker - with moving ghost
Posted: Sat May 17, 2014 10:08 am
by Pako
Dear Walter,
it's perfect. This is exactly what I needed.
Thanks and best regards,
Pako