TIMERS
TIMERS
Good evening All.
I am trying to enter a small routine, that would work like so.
1 - If input 1 = On ( Front door open )
2 - Then A2 = On ( Turn front door light on )
Want to add a timer on line 3
3 - Would like to set a timer here for 90 Secs.( Subsequent to door opening)
4 - And once timer of 90 secs. has expired.
5 - Then A2 = Off
I have an ADI Ocelot, which I know will work with Timers and Variables, but how do I implement them.
Thanks Guys for your assistance.
Dom
I am trying to enter a small routine, that would work like so.
1 - If input 1 = On ( Front door open )
2 - Then A2 = On ( Turn front door light on )
Want to add a timer on line 3
3 - Would like to set a timer here for 90 Secs.( Subsequent to door opening)
4 - And once timer of 90 secs. has expired.
5 - Then A2 = Off
I have an ADI Ocelot, which I know will work with Timers and Variables, but how do I implement them.
Thanks Guys for your assistance.
Dom
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: TIMERS
Why not time in HouseBot itself and use the Ocelot just for control (on / off). That way you maintain a clear view on what's going on in HouseBot.
Can't help you with the Ocelot stuff though
Can't help you with the Ocelot stuff though
Re: TIMERS
Good morning Richard,
I have no problem in using Housebot with a timer.
But how.
Dom
I have no problem in using Housebot with a timer.
But how.
Dom
-
- HouseBot Guru
- Posts: 785
- Joined: Wed Apr 02, 2003 8:10 pm
- Location: Pelham AL
Re: TIMERS
FWIW, when I was using and ADI Leopard (and later an Ocelot), I did ALL the programming in HB. The ADI eqpt was there only to be the hardware interface to the outside world (X10, IR, dig I/O..). In fact, there was NO programming running in the ADI eqpt other than the basic boot routine (3 LED blinks). I didnt think that there was a need to add an additional layer of programming or propagation delay to the HA tasks. Even then, I found the delay that the ADI introduced (primarily IR) to be unacceptable. I binned the ADI stuff and converted to USB-UIRT for IR and a Velleman USB interface board for A/D I/O.
Steve
-
- HouseBot Special Member
- Posts: 304
- Joined: Wed May 07, 2003 2:19 pm
- Location: Tel-Aviv, Israel
- Contact:
Re: TIMERS
Use HB's Sleep Timer device. set the time to 1 minute and 30 seconds.I have no problem in using Housebot with a timer.
But how.
Build an automatic task (mark the 'when conditions are met' field) that will fill your condition like this:
If ('input1.property' is euqal 'On') Then
Change 'YourDevice.YourProperty' to 'On'
Change 'YourSleepTimer.Running' to 'Yes'
Build another automatic task that will look like this:
If ('YourSleepTimer.Running' is Equal 'No') Then
Change 'YourDevice.YourProperty' to 'Off'
HTH,
Yoram
Re: TIMERS
Good afternoon Steve, Yoram,
Steve, I agree, I don't want to add another layer of programming, I am trying to figure out how to use the features from HOUSEBOT, one is called ( Get Timer / Timer ) and ( Get Variables / Variables ) I think these features were introduces in order to enable these functions that are available on ADI Ocelot.
But I think I will use Yoram's routine before persuing any further.
Thanks guys I will advise shortly on the outcome.
Dom
Steve, I agree, I don't want to add another layer of programming, I am trying to figure out how to use the features from HOUSEBOT, one is called ( Get Timer / Timer ) and ( Get Variables / Variables ) I think these features were introduces in order to enable these functions that are available on ADI Ocelot.
But I think I will use Yoram's routine before persuing any further.
Thanks guys I will advise shortly on the outcome.
Dom
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: TIMERS
One small remark: I have had many problems with Delays in Tasks.
Example: Long ago while I was still using X10, I set up a Task that switched my X10 lights to a certain setting. It looked something like this:
Dim Light a
Delay 1000
Dim Light b
Delay 2000
Dim Light c
For some reason this turned out to be very unreliable. It appeared as if all X10 commands were put through at once and the delays (3000 in total) followed thereafter.
Delays used in If The Else statement also seem to cause problems in Tasks. So I dropped the tasks for that purpose and put it all into script which worked like it should do.
Maybe Tasks will work for you, but if they don't do what you expect them to do, remind this one..
Example: Long ago while I was still using X10, I set up a Task that switched my X10 lights to a certain setting. It looked something like this:
Dim Light a
Delay 1000
Dim Light b
Delay 2000
Dim Light c
For some reason this turned out to be very unreliable. It appeared as if all X10 commands were put through at once and the delays (3000 in total) followed thereafter.
Delays used in If The Else statement also seem to cause problems in Tasks. So I dropped the tasks for that purpose and put it all into script which worked like it should do.
Maybe Tasks will work for you, but if they don't do what you expect them to do, remind this one..
-
- HouseBot Guru
- Posts: 785
- Joined: Wed Apr 02, 2003 8:10 pm
- Location: Pelham AL
Re: TIMERS
That's interesting, because I have several tasks that have multiple delays in them. Not X10 related but instead delay the transmission of IR commands. That is, don't send one device several IRs in an immediate sequence to avoid "confusion" at the receiving device. I don't know that your experience has been a problem here with IR, but sometimes the IR commands do not work as expected... so I inserted the delays to slow things down.
Maybe Scott can comment on this, especially your X10 experience, and if its a bug at least we'll know its a bug. My occasional occurrence has not been serious enough to justify your script solution though. And I cannot say that its even the same as what you've described.
Maybe Scott can comment on this, especially your X10 experience, and if its a bug at least we'll know its a bug. My occasional occurrence has not been serious enough to justify your script solution though. And I cannot say that its even the same as what you've described.
Steve
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: TIMERS
So are you saying you fixed your problems after adding delays or are you still having unexpected behavious sometimes even with the delays?
Especially with X10 this happened, but I have seen other wierd stuff concerning delays in tasks but I can never reproduce them. It happened often but not always so it's hard to report on it. Whenever I see it happen in a (new) Task I created, I leave it and go for scripting to be sure. I will look for the posts where I touched this issue because I am sure I posted it before a long time ago..
EDIT: Did a search and can't find it. May have been a direct email to Scott or maybe even on the beta test forum. I am happy with the workaround and just report a heads up here.
Especially with X10 this happened, but I have seen other wierd stuff concerning delays in tasks but I can never reproduce them. It happened often but not always so it's hard to report on it. Whenever I see it happen in a (new) Task I created, I leave it and go for scripting to be sure. I will look for the posts where I touched this issue because I am sure I posted it before a long time ago..
EDIT: Did a search and can't find it. May have been a direct email to Scott or maybe even on the beta test forum. I am happy with the workaround and just report a heads up here.
-
- HouseBot Guru
- Posts: 785
- Joined: Wed Apr 02, 2003 8:10 pm
- Location: Pelham AL
Re: TIMERS
No, still occasional (not serious or frequent enough to lose sleep over) problems with IR commands and delays in tasks. But I cannot be sure that its delay (or lack of, or additive) related. But your X10 posting made me wonder if your experience is more than just X10. (I don't know why it would JUST be X10; it could apply (?) to any actions separated by delays... maybe?)
.
.
Steve
Re: TIMERS
Each Task runs in it's own thread, as do the Devices and Hardware Interfaces. When you execute a 'delay' in a Task, it will put the task thread to sleep for the specified amount of time which will block the Task thread but *should* allow any device or hardware interface commands that were sent previously to be executed normally in their own threads of execution.
I can't think of how this would effect any X10 execution, but X10 can be mysterious sometimes.
I can't think of how this would effect any X10 execution, but X10 can be mysterious sometimes.
Scott
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: TIMERS
I went ahead and created a test. Results can be seen in the images attached.
The task is simple: Switch on a light in my office by sending a command to an Action property and a script handles the command. Wait 3 seconds and send another command to switch off the lights. Repeat this a couple of times.
Most of the times it works OK, but sometimes it just doesn't. Maybe because another task sends a command to the same Action property (Check Patio Screen), but this should work like advertised. You can see in the attached image that some commands are received in the Action property without the Delay in between.
Anyways; no such thing in script so I am happy.
@Scott: Happy to test anything you can think of! I can set up complex tasks real easy so it should take long to test certain conditions.
The task is simple: Switch on a light in my office by sending a command to an Action property and a script handles the command. Wait 3 seconds and send another command to switch off the lights. Repeat this a couple of times.
Most of the times it works OK, but sometimes it just doesn't. Maybe because another task sends a command to the same Action property (Check Patio Screen), but this should work like advertised. You can see in the attached image that some commands are received in the Action property without the Delay in between.
Anyways; no such thing in script so I am happy.
@Scott: Happy to test anything you can think of! I can set up complex tasks real easy so it should take long to test certain conditions.
- Attachments
-
- naamloos.PNG (23.31 KiB) Viewed 13442 times
-
- naamloos1.PNG (18.17 KiB) Viewed 13442 times
Re: TIMERS
That certainly doesn't look right to me either. It might be good to enable the 'Task' tracing (or Task Block in the advanced tracing) and run the same test.
Scott
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: TIMERS
I am having a bit of trouble with isolating the task in tracing. I can't find tasks in the advanced list. Just the properties so I have to fiddle a bit with it before coming back with test results.