Task 30 minutes before sunset doesn't run

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
jhoski
Member
Posts: 11
Joined: Sun Jan 03, 2010 5:00 pm

Task 30 minutes before sunset doesn't run

Post by jhoski »

Found this example the forum but the task never runs. I'm using this expresion and testing if Equal to the 'System Time.Time Without Minutes' property.

SUNSET_DATE_AND_TIME - Days=0, Hours=00, Minutes=30, Seconds=00

This evaluates to something that looks like this:

If ('System Time.Time Without Seconds' is Equal '2/21/2010 5:04:00 pm') Then
do stuff...

It has been in place for a couple of days now but does not run.
Suggestions? Jay
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Task 30 minutes before sunset doesn't run

Post by Osler »

Use it like this:

Code: Select all

If System Time.TimeAndDate is equal '<the expression defined by SUNSET_DATE_AND_TIME - Days=0, Hours=00, Minutes=30, Seconds=00>' Then
You need to have both the time and date present for it to evaluate. Hence, System Time.TimeWithoutSeconds won't get you what you want.

Osler
jhoski
Member
Posts: 11
Joined: Sun Jan 03, 2010 5:00 pm

Re: Task 30 minutes before sunset doesn't run

Post by jhoski »

Thanks, its working now.

The original post where I saw this mentioned that using a condition with seconds causes a lot of overhead checking. Do I need to be concerned? The machine I'm using is not very strong. Single processor AMD @ 995Mhz.
Osler
HouseBot Guru
Posts: 742
Joined: Fri Feb 03, 2006 11:18 pm

Re: Task 30 minutes before sunset doesn't run

Post by Osler »

It'll be fine. After being used to nested if/then functions, you will find that the very simple logic in tasks to sometimes stump you as to why it isn't working or why it is working the way that it is.

Osler
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Task 30 minutes before sunset doesn't run

Post by Richard Naninck »

I got about 50 scripts always running using a Do Loop.
The Loop checks the state of a property every milisecond.
So imagine i have about 50 state checks (GetpropertyValue) every ms and it doesn't cost a single cpu percentage.

So no worries about a 1 second check :D
Post Reply