Lamp return to previous lighting level after timeout

networkcrasher

Active Member
Hi, I have some code to increase a hallway lamp to 100% brightness when the doorbell is rang (lamp is previously at 50%) for a period of 2 minutes after the doorbell is pressed, but it never seems to go back to 50% once the 2 minutes is expired. I also trigger the front porch lamp, which is originally at 0% (off) and goes to 100% for 2 minutes, then goes back to off once the timer is expired.

What code am I missing that puts the hallway lamp back to 50% once the 2 minute 100% is expired?
 
Code:
5. WHEN Doorbell NOT READY
WHEN Front Door NOT READY
  AND IF DARK
   THEN Front Door ON FOR 2 MINUTES
   THEN SET LIGHTING LEVEL Little Foyer Lamp 9 TO 100% FOR 2 MINUTES
 
The action used at the end of the 2 minutes is always going to be "OFF". The lights will not revert to their previous state.

To get around this, I would set a flag for the two minutes instead of turning the lights on. Then add two additional code blocks to test when the flag is ON and OFF. When the flag goes ON, turn the lights on. When the flag goes OFF, set Front Door to 50% and Foyer to 0% (or off).
 
Actually, it seemed that if the light was already on, and was raised to 100%, it just stayed at 100% after the timeout. Now any light that was OFF prior to being turned on, went back to off.

Anywho, I took your advice and have some flags now that will automate this for me. Has been hard for me a few times to write code as sometimes you have to take roundabout ways to get something simple done, or write multiple blocks of code when if you could only do if/then/or type statements (as the statement progressed), could all be in one block.
 
It may be less complicated than you think...

Assume we are starting with the foyer light at 50%.

Example 1:
Code:
1. WHEN Front Door NOT READY
   THEN Foyer Lt ON FOR 10 SECONDS

This code will turn the foyer light ON (100%) for ten seconds but when the 10 seconds expires the light will go off.

Example 2:
Code:
1. WHEN Front Door NOT READY
   THEN SET LIGHTING LEVEL Foyer Lt TO 100% FOR 10 SECONDS

This code will set the foyer light to 100% (ON) for ten seconds but when the 10 seconds expires the light will go to the previous level.
 
Code:
1. WHEN Front Door NOT READY
   THEN SET LIGHTING LEVEL Foyer Lt TO 100% FOR 10 SECONDS

This code will set the foyer light to 100% (ON) for ten seconds but when the 10 seconds expires the light will go to the previous level.
Mine seemed to stay at 100% when I did this. I coded around it, but will have to try again.
 
In the past there have been some problems with timed light level commands on some third party lighting systems. Most of the time this was related to a late status report message from the lighting system...

All known issues have been resolved. In some cases it required a firmware update to the lighting system and in other cases it required changes on our end. So for my reference what Model/firmware is your controller? Next I would recommend updating your controller to the latest firmware and also if possible update the firmware in your lighting system. After you have done this retest. The timed level commands should work as described in my previous message.
 
Back
Top