Jump to content

Logic question


jasonl99

Recommended Posts

I am working with motion sensors and still trying to find the best combination of flexibility and keeping traffic low.

 

One of the things I am struggling with is what happens in this case. I have a program called "Upstairs Motion" which is used in a lot of other areas. it's simply this:

if 
 Status Kitchen Motion Detector is On
Or Status Living Room Motion Detector is On

then

else

 

I use this as a variable.

 

However, here's the problem I seem to be running into:

 

when the living room detector is already on, and someone walks into the kitchen, it re-runs the program and triggers all the dependencies even though the True/False state didn't change.

 

This behavior seems to be causing all sorts of additional traffic.

 

Any suggestions?

 

On an unrelated note, any word on when alpha people can get a hold of the 2.7.7/2?

Link to comment

Maybe you can create 1 variable (program) for each sensor, then another to determine the logic. I am just getting started my motion sensor/door sensor programming but haven't come up with a complete plan yet, still pondering ideas.

 

So you would have 2 variable programs, then another one to test conditions:

 

If motion A is on and motion B is off THEN...

 

If Motion B is off and motion B is on THEN...

 

If Motion A is on and motion B is on Then...

 

Etc....

 

Variables would make programming much easier, I may wait until they are available, i think i read somewhere they are in the works. I would hate to do all of this programming using program variable, then have to go though it all again to replace with real variables.

Link to comment

I am definitely excited about getting variables. That will largely solve this admittedly-minor problem.

 

But I did confirm the behavior. Consider this:

 

1) You have to programs: ConditionA and ConditionB. They are used as true/false variables.

 

2) You have another program ConditionStatus which says If ConditionA is true or conditionB is true. So if either condition is true, ConditionStatus is true.

 

3) You have a third program which "does stuff." Let's say if ConditionStatus is True Turn On Lights Else Turn Off Lights.

 

Here's the problem. Condition A goes true setting ConditionStatus True. The lights are turned on. Then ConditionB goes true. ConditionStatus is still true (the state never changed), but the lights get turned on again.

Link to comment

Archived

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


×
×
  • Create New...