Jump to content

Enabling/Disabling Motion Sensor with Togglelinc Program


geogecko

Recommended Posts

Had an interesting request from my wife, when I installed a Togglelinc dimmer in our master closet with a motion sensor to turn the light on and off. Sometimes, she will put our son (infant) in there when she is in the bathroom, so that she can keep an eye on him. Well, he is too small, and doesn't move enough, to keep the light from going off.

 

To try and fix this issue, I created a program that disables/enables the programs that use the motion sensor to control that Togglelinc. The motion sensor is not directly linked to anything, I solely use programs to do what I want.

 

So basically, I did this:

 

Disable Motion program looks for a "Control Master Closet Lights is Fast On" and then disables my motion control programs, so the Togglelinc operates on it's own.

 

Enable Motion program looks for a "Control Master Closet Lights is Fast Off" and enables the motion control programs.

 

When I first tested this, it seemed to work, except then I was not able to enable the motion programs from the switch. I checked the admin console, and both enable/disable programs are true, and the motion programs are disabled...no matter what I do, I can't get the Enable Motion program to work.

 

Any idea what is going on here?

Link to comment

Hi Jason,

 

Perhaps the Fast Off is not being executed. I found this when my family members were using a switch. Sometimes they would only use Off, sometimes they held the switch to dim it to near off.

 

So I added Conditions to watch for those events.

 

If
       Status  'Basement / Main / Stairs' < 30%
    Or Control 'Basement / Main / Stairs' is switched Off
    Or Control 'Basement / Main / Stairs' is switched Fast Off

Then
       ...


 

When you view the Program Summary is the Last Run Time what you expect?

 

Rand

Link to comment

Hi Rand,

 

Interesting point, I will have to look into that. But this was with my own testing. I went in there, and double toggled the switch multiple times "off" and could never get the motion reactivated.

 

Secondly, since this is an IF statement, looking for a CONTROL function, shouldn't it only be true for that split second when the togglelinc sends the fast off command? Both of my programs are in the true state...seems confusing to me.

Link to comment
Secondly, since this is an IF statement, looking for a CONTROL function, shouldn't it only be true for that split second when the togglelinc sends the fast off command? Both of my programs are in the true state...seems confusing to me.

 

It is apparently confusing to many.

 

The "Program" state is the state when last evaluated. If evaluated 20 hours ago and was true at that point, and has not been evaluated since, then the "program" state remains true.

 

However, don't confuse "program" state with the execution of the programs. Just because a program condition is true does not mean that the program is continuously executed. Execution of a program happens only when the "if" condition is evaluated.

 

For controls, evaluation is at the momentary time when the control condition is seen. For status, evaluation is when there is a change of state of that status. In SubRoutine's example, it would be evaluated when there is a change of state of the stairs light, or when a the stairs lights is switched off or when it is switched fast off. At the point of the evaluation, if the "if" condition is true, then the "then" condition will run.

 

If, at the momentary time of evaluation the "if" is determined as true, the program state will remain true indefinitely, or until another evaluation occurs where the "if" condition is evaluated as false. However, the "then" loop will execute only one time per evaluation.

Link to comment

Okay, I think I understand how they are evaluated now...

 

Actually feel stupid for posting this, but I copied the disable program for the enable program, and forgot to switch Fast On for Fast Off on the enable, so I could never enable the programs again...

 

Everything works now.

Link to comment

Archived

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


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...