Please login or register.

Login with username, password and session length

Author Topic: eternal loop  (Read 15308 times)

b4unothing

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
eternal loop
« on: May 18, 2006, 09:44:35 PM »

I simply want to turn an appliance on for 1 minute and off for 20 minutes forevah!  How do I do it?  Loop, macro, timer, trigger, huh? ::)
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: eternal loop
« Reply #1 on: May 18, 2006, 11:13:51 PM »

I simply want to turn an appliance on for 1 minute and off for 20 minutes forevah!...
...and you want to trust X10 to do this. ;)

You can do this with AHP by building creating a dummy module say M1 and a matching macro M1

M1 macro
B1 ON;             Where B1 is your appliance module
delay 1 min
B1 OFF
delay 20 min
M1 On;             By triggering dummy module M1 you call macro M1 again, starting an endless loop.

BEFORE YOU DO THIS, I STRONGLY RECOMMEND YOU CONSIDER....

  • What would happen if your appliance were to run more than a minute? Say continuously for hours.
  • What would happen if your appliance were to never come on for hours?

Both of these situations above can happen. I would even bet that one will happen in the life of product.
eg. Even if the X10 module were to never fail, remember that after even a brief power failure the module will return to the ON/OFF state it was before the power failure. Also what happens if a glitch triggers the local control turning the appliance module ON?

If you're creating a light display that's one thing but if you're trying to keep a small pond from freezing I wouldn't rely on X10.
X10 is a great product but there are too many variables too make it reliable for some applications.

How are you thinking of using it?
« Last Edit: August 06, 2006, 02:29:35 PM by steven r »
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

b4unothing

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: eternal loop
« Reply #2 on: May 19, 2006, 12:05:56 PM »

It's just a humidifier for adding water vapor to the air.  Your reply is very helpful.  If I can figure out what to do with it I will try it.  Thank you. :)
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: eternal loop
« Reply #3 on: May 19, 2006, 12:57:53 PM »

It's just a humidifier for adding water vapor to the air....
The plug in kind? Cool mist or heated? The heated ones may require some warm up. If so try to allow some extra time for it.

Hmm... I wonder how much a humidity switch would cost? I bet you could connect one of those to an X10Powerflash unit and be able to set and exact humidity setting.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

b4unothing

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: eternal loop
« Reply #4 on: May 19, 2006, 05:34:45 PM »

 :)Thank you so much.  It works like magic!!  Yoo Da Man!! 8)
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: eternal loop
« Reply #5 on: May 25, 2006, 09:40:41 AM »

A word of caution.  If you accidentally trigger the macro twice you will have two copies of the macro running simultaniously, which would produce unexpected results.
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: eternal loop
« Reply #6 on: May 25, 2006, 11:23:30 AM »

...If you accidentally trigger the macro twice you will have two copies of the macro running simultaniously...
Or what about a 3rd or 4th time... 
It might be a good idea to purge running macros every now and then or anytime things seem off and restart the macro. Also use a HC that you don't use for anything else and trigger it from AHP. Don't have any controllers on the same code.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: eternal loop
« Reply #7 on: May 25, 2006, 12:05:37 PM »

By adding a condition and setting a flag that problem could be solved ;)
eg:
trigger M1 on if flag 1 clear
set flag 1
B1 ON;             
delay 1 min
B1 OFF
delay 20 min
clear flag 1
delay 2 sec
M1 On;

A short delay between the clearing of the flag and the restarting of the macro may be needed or is this just theory?
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: eternal loop
« Reply #8 on: May 25, 2006, 12:23:27 PM »

By adding a condition and setting a flag that problem could be solved ;)
eg:
trigger M1 on if flag 1 clear
set flag 1
B1 ON;             
delay 1 min
B1 OFF
delay 20 min
clear flag 1
delay 2 sec
M1 On;

A short delay between the clearing of the flag and the restarting of the macro may be needed or is this just theory?
That could possibly work unless the macro was triggered again in the 2 sec window of opportunity. Unlikely but Murphy has ways of finding niches to work through. Another reason to only have it be able to start from AHP.
I was thinking of some sort of daily reset but your idea seems like it could work.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: eternal loop
« Reply #9 on: May 25, 2006, 12:36:06 PM »

A short delay between the clearing of the flag and the restarting of the macro may be needed or is this just theory?

I don't believe the delay is needed, but I may be wrong.  I have had the opposite problem where if you set a flag which is a condition for the macro at the beginning of the macro without a delay, the else macro will also run with one trigger.  From this I would take it that flags get set very quickly.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10497
  • I don't work for X10, I use it successfuly!
Re: eternal loop
« Reply #10 on: May 25, 2006, 12:59:41 PM »

That could possibly work unless the macro was triggered again in the 2 sec window of opportunity.
If that was the case the macro would only restart a split second faster when the 2 sec delay was over and the macro tried to restart the flag condition wouldn't let it. Most instances of the macro running would be TWO and only for 2 seconds or less. If in fact the 2 second delay is actually needed as roger1818  pointed out it may not be needed! ;)
True MURPHY does find his way!  :) :D
Logged
Please Read Topic:
General Forum Etiquette
Before you post!
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.