ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#16593 - 10/20/06 11:31 PM Turn off lights while watching TV?
Buddinski Offline
newbie


Registered: 10/20/06
Posts: 2
I need help setting up an x-10 sequence so when I turn the TV on with my pronto the lights go off in the room and go back on when Iím done. My problem is that I canít figure out how to do it so if Iím watching TV before the lights turn on that they donít come on at the normal time. Second problem is to have the lights turn on when Iím done if they should be on.
My pronto command for turning on the system is A16 on. Pronto command for turning the system off is A16 off. The lights are A7.
I suspect this involves the ELSE command which I havenít had a need to use in the 5 years Iíve had my system. How do I get the lights to operate like normal except when Iím watching TV?
Thank you in advance!

Top
#16594 - 10/21/06 02:18 PM Re: Turn off lights while watching TV? [Re: Buddinski]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
The best way to do this kind of logic is by using a variable as a flag so that your system "knows" if you're in TV watching mode or not. It could be something like this (pseudo code):

IF Receive X10 A/16 ON Command Pair //if TV is getting turned on
THEN Variable #1 = 1 //var 1 = 1 is TV watching mode
THEN X10 A/7 Turn OFF //turn off lights

IF Time of Day = normal turn on time //if usual turn on lights time
AND Variable #1 is NOT = 1 //and not watching TV
THEN X10 A/7 Turn ON //turn on lights as usual

IF Receive X10 A/16 OFF Command Pair //if TV is getting turned off
THEN Variable #1 = 0 //var 1 = 0 is mormal mode

IF Variable #1 becomes = 0 //if TV mode has just ended
AND Time of Day is > normal turn on time //and lights should be on at this time
THEN X10 A/7 Turn ON //then turn on lights now
_________________________
"If you don't know what you're doing, do it neatly..."

Top
#16595 - 10/21/06 07:20 PM Re: Turn off lights while watching TV? [Re: Guy Lavoie]
Buddinski Offline
newbie


Registered: 10/20/06
Posts: 2
Guy:
Thank you. That should work but how do I add an end time to the last sequence? Should I use AND or OR command to enter a time that the lights should not go on if it's after 12:00am. This Forum is the greatest! I'm disabled and use my Ocelot to turn channels and run my home. Couldn't imagine life without it. Thanks again

Top
#16596 - 10/21/06 07:54 PM Re: Turn off lights while watching TV? [Re: Buddinski]
Just Another Joe Offline
enthusiast
****

Registered: 09/02/03
Posts: 204
Loc: Adanac
Hi Bud,

I'm not speaking for Guy (whom you asked), but I'm sure he'll correct me if there is any error in the following:

The code Guy posted will use an end time of midnight, since midnight is 0:00, which will never be greater than the normal turn on time. If you wanted to have an earlier (than midnight) end time, such as 11:00pm (23:00), you could add an additional line like this:

IF Variable #1 becomes = 0 //if TV mode has just ended
AND Time of Day is > normal turn on time //and lights should be on at this time
AND Time of Day is < end normal turn on time
THEN X10 A/7 Turn ON //then turn on lights now

Conversely, if you wanted an end time that was past midnight, such as 1:00am, you could again add a single line:

IF Time of Day is > normal turn on time //lights should be on at this pm time
OR Time of Day is < end normal turn on time //or this am time
AND Variable #1 becomes = 0 //and TV mode has just ended
THEN X10 A/7 Turn ON //then turn on lights now

Notice the order of the statements had to be slightly modified, because of the OR clause.
_________________________
Just Another Joe
Why be politically correct, when you can be right?

Top
#16597 - 10/21/06 09:34 PM Re: Turn off lights while watching TV? [Re: Just Another Joe]
Guy Lavoie Administrator Offline
Beyond All Hope
*****

Registered: 12/21/02
Posts: 6548
Loc: Montreal, QC, Canada
Nothing to add there...
_________________________
"If you don't know what you're doing, do it neatly..."

Top
Page 1 of 1 1


Moderator:  Dan Smith, Monte G, ADI Tech Support, Guy Lavoie 
Hop to:
Who's Online
0 registered and 51 anonymous users online.
Recent Posts
Shout Box

Newest Members
brigiel, vevevie, zhutree, 416, saiqul
3003 Registered Users
Forum Stats
3003 Members
19 Forums
4004 Topics
23442 Posts

Max Online: 132 @ 11/13/16 10:07 AM
December
Su M Tu W Th F Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31