SunTracker - with moving ghost

Questions and comments specific to a particular plugin should go here.

Re: SunTracker - with moving ghost

Postby krambriw » Sun Jul 29, 2012 8:29 am

I understand, I think it is not too difficult, I'll look into it.

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: SunTracker - with moving ghost

Postby Livin » Sun Jul 29, 2012 3:06 pm

krambriw wrote:I understand, I think it is not too difficult, I'll look into it.

Best regards, Walter


that would be great, thank you!
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: SunTracker - with moving ghost

Postby krambriw » Sun Jul 29, 2012 7:14 pm

Got the basics working, just a few questions:

- we shall base the calculation on civil twilight (dusk / dawn) ( Civil twilight starts/ends when the Sun's center is 6 degrees below the horizon) ?
- with a positive offset of 30 min, should lamps be turned on 30 mins after dusk?
- with a positive offset of 30 min, should lamps be turned off 30 mins before dawn?

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: SunTracker - with moving ghost

Postby Livin » Sun Jul 29, 2012 7:44 pm

krambriw wrote:- we shall base the calculation on civil twilight (dusk / dawn) ( Civil twilight starts/ends when the Sun's center is 6 degrees below the horizon) ?


Can you calculate all of the options and then provide a drop down box so people can pick which they want to use in any given macro (instead of hard coding)?

krambriw wrote:- with a positive offset of 30 min, should lamps be turned on 30 mins after dusk?
- with a positive offset of 30 min, should lamps be turned off 30 mins before dawn?


I was thinking SunTracker itself would not trigger anything... but it would be the Action (e.g. 'condition') inside the EG macro itself. Thus, SunTracker would be the mechanism used to continue and/or stop a macro. The time offset would simply be what SunTracker added to, or removed from the sunset/sunrise/dusk/dawn settings to determine if it allowed the macro to continue.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: SunTracker - with moving ghost

Postby krambriw » Mon Jul 30, 2012 4:57 am

Can you calculate all of the options


Sure, the options I can provide would then be:
- Civil twilight starts/ends when the Sun's center is 6 degrees below the horizon
- Nautical twilight starts/ends when the Sun's center is 12 degrees below the horizon
- Astronomical twilight starts/ends when the Sun's center is 18 degrees below the horizon

SunTracker would be the mechanism used to continue and/or stop a macro


Agree, I think we have the same understanding, I re-phrase my questions:

- with a positive offset of 30 min, would you like to get "True" as response until 30 mins after dusk or should I only give you "True" until 30 min before?
- with a positive offset of 30 min, would you like to get "True" as response until 30 mins after dawn or should I only give you "True" until 30 min before?

(Dusk and Dawn will be defined depending on your selection Civil, Nautical, Astro)

BR Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: SunTracker - with moving ghost

Postby krambriw » Mon Jul 30, 2012 11:11 am

Hello Livin,
Attached is a new version that I believe is working fine (all tests I have made seems to be ok).
SunTracker_30.07.2012.zip
(81.61 KiB) Downloaded 36 times

There is now a new action type available, you will see it in the list of available actions as "Check if we are between Dawn and Dusk".

In a python script you should however use the label "BrightEnough" as in the example below:

Code: Select all
if eg.plugins.Suntracker.BrightEnough(30, 'Astronomical Twilight'):
    print "Still bright enough"
    eg.StopMacro()
else:
    #Continue macro
    print "Time to turn on lights"


As in your example, it would be the following structure:
Macro: WATCH MOVIE
-- Action: turn on tv
-- Action: turn on dvd player
-- Python Script as above
-- Action: turn on light to 30%

As parameters to the call in the script, you may use +/- 120 mins and one of the following key strings:
'Normal Sunrise/Sunset',
'Civil Twilight',
'Nautical Twilight',
'Astronomical Twilight'

In this version, I kept a print statement just to let you verify the calculations (we will comment it out later when we are convinced it is working correctly).

You can also execute the action directly just be adding and configure it like in the following screen:
Image2.jpg


BR Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: SunTracker - with moving ghost

Postby Livin » Mon Jul 30, 2012 5:48 pm

Awesome! I'll test this today and get back to you ASAP.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: SunTracker - with moving ghost

Postby Livin » Mon Jul 30, 2012 8:12 pm

Walter,
I think it is working fine... Just curious... can you add a user selectible option inside the Action itself to StopMacro if False is returned? Two reasons... 1) easier for noobies 2) reduces the # of items in the macro.

For complex situations, having the global variable is useful but for simple macros (e.g. most users' needs), scripting will not be needed :)


Awesome work my friend! This just eliminated the need for one other plugin and several scripts to create & change sunset/sunrise variables.

2nd UPDATE: forget the first update... I had Long in wrong. All is working fine!
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: SunTracker - with moving ghost

Postby krambriw » Tue Jul 31, 2012 12:45 pm

Thanks,

Added the "stop macro" option setting (checkbox) in the configuration setting. It works as expected when I try it.

If you still wanna call the action from a script in advanced cases, you can do it in the following way (you have to add one more param in the call):

Code: Select all
eg.plugins.Suntracker.BrightEnough(0, 'Civil Twilight', True)

or
Code: Select all
eg.plugins.Suntracker.BrightEnough(0, 'Civil Twilight', False)


If you put an action in a macro it will either stop or continue depending on your choice.

Best regards, Walter
SunTracker_31.07.2012.zip
(81.77 KiB) Downloaded 36 times
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: SunTracker - with moving ghost

Postby Livin » Thu Aug 02, 2012 11:59 pm

Hi Walter,
I finally got a chance to try the latest version.

An option for True and for False with StopMacro is needed. Also, I think the way the options are in the drop down it will not work (unless I misunderstand something)... different actions/events need to happen depending on if it is Light or Dark but the way the plugin works, opposites (like Sunrise & Sunset, etc) are treated as the same... so in the below example, Lights would always come on, even when it is daytime. Or never. But if you separate Sunrise & Sunset, it then will work.

Example:

Turn on TV
Start Movie
SunTracker: If Sunset = False StopMacro
Turn Lights ON

... thus there really should be 8 options:

Sunrise
Sunset
Civil Dusk
Nautical Dusk
Astronomical Dusk
Civil Dawn
Nautical Dawn
Astronomical Dawn
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: SunTracker - with moving ghost

Postby krambriw » Fri Aug 03, 2012 5:30 am

An option for True and for False with StopMacro is needed

Why? I do not get it...

different actions/events need to happen depending on if it is Light or Dark

???

Your example would (or should) work like this with the current implementation:
Turn on TV
Start Movie
SunTracker action (Nautical Dawn and checked to stop macro if bright enough)
-> Turn Lights ON only if the SunTracker action is returning False (will basically be the case from Nautical Dawn until Nautical Dusk)

And when finished:
Stop Movie
Turn off TV
Turn Lights OFF (no need for SunTracke action)

Or what do you want to achieve?

There are many scenarios possible I think:
- what if you start watching when it is still bright? What will then happen at Nautical Dawn?
- what if you started watching a movie very late (or early morning) while it was dark already and it is getting bright during watching? What will then happen at Nautical Dusk?

I need a better spec on all scenarios been better analyzed, it takes unfortunately too much effort with trial and error, changing back and forth.

BR
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: SunTracker - with moving ghost

Postby Livin » Fri Aug 03, 2012 6:25 am

Checked Items (sunset, sunrise, etc) should to be separated because a people may want to use different on/off triggers... everyone has different homes, rooms face different ways, different lighting, etc. Example: my master bedroom faces East and In the morning the room gets completely lit up very early and thus gets very dark early too. This combo would be normal sunset (dark) and nautical dawn (light)

Maybe the option to set something like... "Time is between: __________ and __________ "

krambriw wrote:
An option for True and for False with StopMacro is needed

Why? I do not get it...

Currently you are only checking if there is "light" aka BrightEnough. So by providing only a Stop if True, there is no way to Stop if False.
There may be different things you want to do based on True vs False.

BrightEnough = False (it is dark): do not turn on the subwoofer -- my 3 yr old is sleeping (i.e. stop the Macro)

... thus, if you only StopMacro on True, then my 3 year old wakes up at the first car explosion in the movie :(
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: SunTracker - with moving ghost

Postby krambriw » Sat Aug 04, 2012 8:44 am

Hi, I think I understand...

I have re-worked the action completely like the description below. I think you can now configure it in any way you like and trigger things almost without limitations.

SunTracker_04.08.2012.zip
(82.39 KiB) Downloaded 33 times

I am now instead calculating a virtual range based on your freely selected start and end twilight types...

So typically, your master bedroom sample for when lights are allowed could be:

Image3.jpg

This one could be suitable to control when use of your sub-woofer is allowed:

Image5.jpg

You can in addition add offsets to the settings and you can stop the running macro either on True or False condition (or none or both to cover all use cases).

If you need to call the action from a script, the syntax could be similar to:
Code: Select all
eg.plugins.Suntracker.InsideRange("", 0, 'Civil Dawn', 'Civil Dusk', True, False)

(Range name can be left empty when used from a script)

Let's see if this will cover the required scenarios,

Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: SunTracker - with moving ghost

Postby Livin » Sat Aug 04, 2012 4:48 pm

Looks fantastic. I'm out of town until Monday night so it may take me a few days to test it out. This adds some serious power to allow Scene creation in EG when EG is integrated into Home Automation apps/devices like Vera. I will be creating an entire "Vacation Mode" Scene in EG using your plugin, and the recently released EG Vera plugin.

Talk to you soon... thank you for making this happen!!!
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
 
Posts: 749
Joined: Wed Oct 08, 2008 4:56 am

Re: SunTracker - with moving ghost

Postby krambriw » Sat Aug 04, 2012 5:28 pm

Thanks,
Have a pleasant stay,
Best regards, Walter
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

PreviousNext

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 1 guest