ADICON Support Forum Applied Digital, Inc.
Page 1 of 1 1
Topic Options
#12470 - 01/25/03 01:20 PM Smart Bedroom Lamps
John Warner Offline
old hand
*****

Registered: 01/09/03
Posts: 834
Loc: Port Perry, Ontario, Canada
This code will turn the bedroom lamps ON or OFF when the hardwired PIR gets a detect or from a Palmpad or sticka-switch button press. The lamps are on an PLM21/LM14A which supports preset dims and ramps the lamps ON or OFF and to the appropriate dim level depending on a number of conditions.

Two button presses within 10 seconds tells the lamp to stay ON for 30 minutes or until explicitly turned OFF.

The PIR is positioned such that it does not trigger if someone rolls over in bed but will turn the lamps on to night-light level if you sit up or if my son comes into the room at night.

Since I am still on V1.7, it does not take advantage of the new SKIP command.

[CODE]STATEMENT COMMENT

*
IF v5 = 1 Dark?
OR TimeOfDay > Sunset - 30 minute(s) Or within 1/2 hour of sunset
THEN v13=1 Set OK to turn on MB lamps
ELSE v13=0 Set Not OK to turn on MB lamps
*
IF Module/Point 1/5Turns OFF MB PIR detect
AND v13 = 1 OK to turn on flag set?
AND Timer10 = 0 And not already ON
THEN Timer10=1680 Set 30 minute timer at 28 minutes
THEN v15=1 Set turn on Lamps flag
*
IF Module/Point 1/5Turns OFF MB PIR detect
AND Timer10 > 1680 And not 1st detect
THEN Timer10=1680 Reset for 2 more minutes
*
IF X10 M/3 ON Command MB Lamps Turned On?
AND Timer11 = 0 First Time?
THEN Timer11=1 Start 10 sec Leave On detect timer
THEN v15=1 Set Turn on Lamps flag
THEN Timer10=1680 Set 30 minute timer at 28 minutes
*
IF X10 M/3 ON Command MB Lamps Turned On?
AND Timer11 > 1 Already done once?
THEN Timer10=1 Set 30 minute ON timer
*
IF X10 M/3 OFF Command Palmpad or sticka-switch
THEN X10 Quick Off K/8 MB Lamp Off
THEN Timer11=0 Reset 10 second timer
THEN Timer10=0 Reset 30 minute timer
*
IF Timer10 Becomes > 1800 30 Minutes ?
THEN Timer10=0 Reset Timer
THEN X10 Quick Off K/8 Turn Off MB Lamp
*
IF Timer11 Becomes > 10 10 seconds since 1st ON?
THEN Timer11=0 Reset Timer
*
IF v15 Becomes = 1 Turn On flag set?
AND v1 != 1 Gone to Bed Flag not set
AND TimeOfDay > 644 Between 6:45 AM
AND TimeOfDay < 716 and 7:15 AM
THEN X10 Preset Dim32 K/8 MB Lamp on 50%
THEN v15=0 Reset turn on flag
*
IF v15 Becomes = 1 Turn On flag set?
AND v1 != 1 Not Gone to Bed
THEN X10 Preset Dim63 K/8 MB Lamp on full
THEN v15=0 Reset turn on flag
*
IF v15 Becomes = 1 Turn on flag set?
AND v1 = 1 Gone to Bed
THEN X10 Preset Dim10 K/8 MB Lamp on 16%
THEN v15=0 Reset turn on flag
*
END OF PROGRAM
[/CODE]To download John's snippet file, click on
www.appdigsupport.com/ADI_Files/JohnMBLamps.SNP

Top
#12471 - 05/07/03 04:00 AM Re: Smart Bedroom Lamps
Mike Cunningham Offline
journeyman


Registered: 01/09/03
Posts: 81
Loc: Southern NH
Thanks for the great advice guys.
Top
#12472 - 04/02/06 08:38 AM Re: Smart Bedroom Lamps [Re: Mike Cunningham]
Paul_dup1 Offline
newbie


Registered: 04/17/03
Posts: 21
Loc: Berlin, MA


As a suggestion add if timer becomes > than 3600 then turn off lights. Then timer to 1801. Then the lights get turned off forever even if turned on manually. I have this code in most all of my stuff and have reduced my electric bill by half!

I actually do if timer >3600 or <1 and 2 second eternal timer is 1 then all lights off then timer to 1801.

Paul
_________________________
Paul

Top
Page 1 of 1 1


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

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

Max Online: 132 @ 11/13/16 10:07 AM
April
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