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.

SunTracker - with moving ghost

Questions and comments specific to a particular plugin should go here.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
__init__.py
(2.94 KiB) Downloaded 160 times
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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).
__init__.py
(3.44 KiB) Downloaded 168 times
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
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post by Pako »

Dear Walter,
Apparently this is somehow enchanted :D .
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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post 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. :oops:
I use Windows 7 - 32bits.
krambriw wrote:I assume you used the following commands ...
Yes.

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

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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:
test.JPG
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
Last edited by krambriw on Mon Jun 09, 2014 3:33 am, edited 1 time in total.
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post by Pako »

Dear Walter,

it's perfect. This is exactly what I needed.
Thanks and best regards,

Pako
Post Reply