Jump to content

Night Light


sfhutchi

Recommended Posts

Posted

For years, I had 'night lights' setup in multiple rooms that functioned as follows:

 

-If the light was off, I would press 'off' and the light would turn on to a dim setting, and then slowly ramp to off.

 

With the same code, it doesn't work with my current setup anymore.

 

Any other robust ways to do this?  I have tried this with out more straightforward ways.... but in the past, I had to invoke a second program to initiate the scene that is essentially a slow ramp of the same light.

 

 

Program (Twin Light Dim)
 
If
        Status  'Twins Room Light' is Off
    And Control 'Twins Room Light' is switched Off
 
Then
        Run Program 'Twin Light Dim Off' (Then Path)
        Set 'Twins Room Light' 35%
 
Else
   - No Actions - (To add one, press 'Action')
 
 
 
Program (Twin Light Dim Off)
 
If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Set Scene 'Twins Room Light - Very Slow' Off
 
Else
   - No Actions - (To add one, press 'Action')
 
 
 
 
Posted

What actually occurs when you press Off?  Try placing Set 'Twins Room Light' 35% before Run Program 'Twin Light Dim Off' (Then Path) with a 1 second delay between the two.

Posted

Currently the light turns on to 35% but never turns off. I admit that the current logic doesn't seem to make sense, but it was what someone suggested several years ago and it worked well for years.

 

Sent from my HTC6525LVW using Tapatalk

Posted (edited)

Currently the light turns on to 35% but never turns off. I admit that the current logic doesn't seem to make sense, but it was what someone suggested several years ago and it worked well for years.

Sent from my HTC6525LVW using Tapatalk

Your last line in the first program cancels the scene ramping and sets the lights to 35%.

 

ISY programming is not concurrent but threaded style.

You call the scene control program it it spawns off to do it while the next line sets the lamps to 35% nullifying any scene action that has already taken place.

 

Switch the lines order and insert a Wait 1 second between them.

 

or

 

 

Just write a delay loop with dimming in each loop, as Stu suggested above.

 

If you have v5.xx you can examine the level, and subtract x% from it each time.

Edited by larryllix
Posted

Your last line in the first program cancels the scene ramping and sets the lights to 35%.

 

ISY programming is not concurrent but threaded style.

You call the scene control program it it spawns off to do it while the next line sets the lamps to 35% nullifying any scene action that has already taken place.

 

Switch the lines order and insert a Wait 1 second between them.

 

I agree that this didn't seem logical, but (at least for a while in the past) it worked as is written.  Something about calling the other program to start the slow ramp to off.

 

Changing the order and including a delay doesn't seem to work either.  I am restoring the switch now.  I am starting to have a feeling that I may have lost the 'slow' scene on this switch.

 

I'll report back.

Posted

The original programs may be race dependent, and work sometimes having two programs hit on a lamp for the last word on the setting.

 

Yes.. I guess I need to keep experimenting.  I rebuilt the slow scene and it works when run directly.  I can't seem to get it to work in any of the programs.

 

Have others created any 'night light' type scenes?  Something that I can trigger to bring a light to a low level and then slowly ramp off?  I used it for years when checking on the kids at night.  It was fantastic.  Walk in their room... press off and I had a few minutes to check on them while the light slowly ramped to off.  When I was done I simply left the room.  No more interaction with switches.

Posted

The reason the programs can't work is that as soon as the light is not off the first program will stop running due to the Status command. Try this:

 

Program 1
If
        Status  'Twins Room Light' is Off
    And Control 'Twins Room Light' is switched Off
 
Then
        Run Program 'Test2' (Then Path)
 
Else
   - No Actions - (To add one, press 'Action')
 
Program 2

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Set Scene 'Twins Room Light - Very Slow' On
        Wait  2 seconds
        Set Scene 'Twins Room Light - Very Slow' Off
 
Else
   - No Actions - (To add one, press 'Action')
 
You may want to change the wait time.

Posted

Okay.  So I think that I have it generally working again....

 

I had to wait about 6 seconds to the 'Dim Off' routine.  Seems that this 'slow off' command was happening too fast.  As you stated earlier, it was like there was a race to the finish and for some reason I never needed the delay in the past.  The program always took longer to initiate so the 35% command in the first program always happened first.  I have continued to update and add devices over the years and upgraded my ISY twice, so possibly I have a much faster and more reliable network now.  :)

Twin Light Dim - [ID 0016][Parent 0019]

If
        Status  'Twins Room Light' is Off
    And Control 'Twins Room Light' is switched Off
 
Then
        Run Program 'Twin Light Dim Off' (Then Path)
        Set 'Twins Room Light' 35%
 
Else
   - No Actions - (To add one, press 'Action')
Twin Light Dim Off - [ID 0017][Parent 0019]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        Wait  6 seconds
        Set Scene 'Twins Room Light - Very Slow' Off
 
Else
   - No Actions - (To add one, press 'Action')
Posted

Twin Light Dim - [ID 0016][Parent 0019]

If
Status 'Twins Room Light' is Off
And Control 'Twins Room Light' is switched Off

Then
Set 'Twins Room Light' 35%
Wait 6 seconds
Set Scene 'Twins Room Light - Very Slow' Off

Else
- No Actions - (To add one, press 'Action')

Posted

When the status changes from Off to something other, then the program evaluates as false and ends.

Posted

When the status changes from Off to something other, then the program evaluates as false and ends.

Stu is correct. This takes two programs to isolate the negative trigger from the sequence.

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.5k
×
×
  • Create New...