System Time Capture

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
talisman
Senior Member
Posts: 119
Joined: Sat Jun 19, 2004 2:30 pm
Location: UK

System Time Capture

Post by talisman »

Im hopeing someone can help me here.

I re configured my setup yesterday and created loads of tasks to control Meedio funtions and more.

I have also created one to turn ALL my Home theatre equipment on, Amp ON, Sub, ON, Projector ON and Screen DOWN.

I also created one to Turn it all Off as well, but what i would like to do is prevent it being turned off if it hasnt been turned on for at least an hour.

Turning projectors ON and OFF too quickly is bad for the bulb Life so i am told.

So what i wanted to do is to have a task Capture the Ststem time at TURN ON and record it some how and then say if this Equals Less than System caputre time + 1 hour then do nothing. But if This Equal Greater Than System Capture Time +1 Hour then Run Task OFF.

Hope you get what i mean.

Tally
Childe Roland to the Dark Tower Came
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

If you shut down your beamer so that it gets the time to cool down (usually the time the fan keeps running after the power off command), you should have no problems. For sure you don't need to wait an hour. It is bad for a beamer if you just cut the power to it (let's say with an X10 switch or so) but if you give it the time to auto shutdown, you can do this 10 times withing the hour if you like.

If you do want to get a task running that checks time + 1 hour, you should create a NULL Device and add a time property to it.
When your START task runs, you can fill the null device tim eproperty with current time and date. While running the STOP task, you can check this same property against current time and date + 1 hour.
I know I didn't spell it out for you here, but hopefully this gives you an idea of how to work this...
talisman
Senior Member
Posts: 119
Joined: Sat Jun 19, 2004 2:30 pm
Location: UK

Post by talisman »

hi thanks for that ill give it a shot.

ive heard so many stories about powering up and down the bulb too quick reducing its life span and at £400 - £500 per bulb id rather play it safe mate.
Childe Roland to the Dark Tower Came
talisman
Senior Member
Posts: 119
Joined: Sat Jun 19, 2004 2:30 pm
Location: UK

Post by talisman »

Ok i can figure out how to create the Null Device and capure the system time.

But i cannot figure out how to compare the system time against the old capured time and check its + 1 hour.

How do i do this?

Thanks
Childe Roland to the Dark Tower Came
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

If ('System Time.Time' is Greater Than '%%YourNullDevice.YourCapturedTime%%') Then .........

Make sure you already added one hour to your 'YourCapturedTime' and maybe you might even include the Date (System Time.TimeAndDate) to prevent errors around midnight.
talisman
Senior Member
Posts: 119
Joined: Sat Jun 19, 2004 2:30 pm
Location: UK

Post by talisman »

Thanks for that Richard.

I do know how to get it to check if the time is greater than the captured time, i just dont get how to add any time to the captured time.

Capture Sytem time = Easy.

Add an hour to it. = ahhhhhhhhhh How??

I cannot see anyway to Add a time scale/period...

thats where its losing me.
Childe Roland to the Dark Tower Came
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

I do that using a script.
I hope the thing below will help you further. Maybe you can even catch this in a task the way I do it in a script. I haven't tested that.



'Script to set a Time property to current time + 1 hour

SetPropertyValue "YourNullDevice.YourCapturedTime", "CURRENT_DATE_AND_TIME + Days=0, Hours=01, Minutes=00, Seconds=00"
spike5884
Senior Member
Posts: 129
Joined: Thu Aug 26, 2004 8:08 am
Location: WI

Post by spike5884 »

I found this in the Fast Start Examples section of the Help for you:
Tip

To turn lights on 30 minutes before sundown, use the System Time.TimeAndDate property in the Task condition. For the condition test value, test for SUNSET_DATE_AND_TIME - Days=0, Hours=00, Minutes=30, Seconds=00.
Thanks,
Scott J
aka spike5884
talisman
Senior Member
Posts: 119
Joined: Sat Jun 19, 2004 2:30 pm
Location: UK

Post by talisman »

ahhhh fantastic. :D

It works adding CURRENT_TIME + Days=0, Hours=01, Minutes=00, Seconds=00

So i set a Cinema Status with a time property.

When i run my Power On task it takes changes the Cinema Time Prop to current time plus 1 hour.

When i run Power Off it checks to see if System time is greater than cinema status Time. If so turn off. If not do nothing.

This is superb guys, many thanks fr your help there Richard and Spike.

Easy when you know how huh.

Tally
Childe Roland to the Dark Tower Came
talisman
Senior Member
Posts: 119
Joined: Sat Jun 19, 2004 2:30 pm
Location: UK

Post by talisman »

Bugger.... Ok i thouht i had this nailed but NOOOOOO.

What i did was create a Cinema Status Time Property.

When i press Power On Task it changes the Cinema Status Time to Current Time + 1 hour.

When i Press Power Off Task i says If Cinema Status Time Is Less Than Current Time then blah blah.

In theory this works. But what is hapening in the ACTUAL TASK is that it is recording CURRENT_TIME +1 hour as

Change Cinema Status Time to "9.00:00" (for example)

So when i run Power On Task again the next day instead of it actually re looking at the Current time and adding an hour it takes this old time of 9.00:00 again that is already in the task. grrrrrr

help please.... what am i doing wrong here. Why isnt the task taking the current system time again?
Childe Roland to the Dark Tower Came
Post Reply