Jump to content

Timer


boser

Recommended Posts

I'm using the following code to automatically turn off a light after a set period:

If
       Control 'Downstairs / Stair.Light' is switched On
    Or Control 'Downstairs / Stair.KP.Down Garden Lights / Stair.KP.A.Staircase Light' is switched On

Then
       Set Scene 'Downstairs / Scene:Staircase Light' Fast On
       Wait  2 minutes 
       Set Scene 'Downstairs / Scene:Staircase Light' Fade Down

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

 

Questions:

 

- Is this code correct?

- Occasionally the light does not turn off. Aside from the two controls in the if clause, there are no other buttons to turn on the light. I've also checked the error log - it does not show any communication errors (only entries are DHCP renewals). Any ideas for getting this to work reliably?

- Is there a way to print a message from the program to the log (or other file)? This could be very handy for debugging. In fact, how does one debug these programs?

 

 

Many thanks,

Bernhard

Link to comment

A Fade Down (or Fade Up) is half of the expected sequence which is the functional equivalent to pressing and holding the Off button/paddle. When done from a device the sequence always ends with a Fade Stop when the button/paddle is released. This is missing in the posted example. Don't know if a Fade Stop will resolve the problem but it is necessary to complete the Fade process in each device.

 

Add a Wait of some seconds to allow the Fade Down to run its course and then issue a Fade Stop.

Link to comment

I wrestled with this same thing recently, here is what I ended up with and it works flawlessly:

 

 

If

Control 'Staircase' is switched On

Or Control 'Staircase Slave' is switched On

 

Then

Wait 30 seconds

Set Scene 'Staircase Pair' Fade Down

Wait 3 seconds

Set Scene 'Staircase Pair' Off

Set 'Staircase' Off

Set 'Staircase Slave' Off

 

Else

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

 

 

LeeG helped a lot.

 

I also added this separate program to keep the lights on:

 

 

If

Control 'Staircase Slave' is switched Fast On

Or Control 'Staircase' is switched Fast On

 

Then

Set Scene 'Staircase Pair' On

 

Else

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

 

Another cool thing is to lower the brightness at night.

Link to comment

Skripo

 

Thanks for posting a working example.

 

Boser

 

The posted example issues a Set Scene Off followed by Direct commands to each Responder to turn Off. This should not be necessary and will be cumbersome if several Responders are in the Scene. I suggest trying it the way Insteon protocol is expecting it to be done with a Fade Stop.

If
       Control 'Downstairs / Stair.Light' is switched On
    Or Control 'Downstairs / Stair.KP.Down Garden Lights / Stair.KP.A.Staircase Light' is switched On

Then
       Set Scene 'Downstairs / Scene:Staircase Light' Fast On
       Wait  2 minutes 
       Set Scene 'Downstairs / Scene:Staircase Light' Fade Down
       Wait 4 seconds
       Set Scene 'Downstairs / Scene:Staircase Light' Fade Stop

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

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...