Jump to content

Logic question


jasonl99

Recommended Posts

Posted

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?

Posted

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.

Posted

Hello again,

 

Variables as well as some means of control vs. status for programs are in the works. This said, however, I cannot give you a firm date since - currently - we are adding so many features into the next release that it might take a little while.

 

With kind regards,

Michel

Posted

Hi slopdog,

 

They are surely on our plate for the release after next. I just cannot be firm on the date. Thanks so very much for your patience.

 

With kind regards,

Michel

Guess they won't be available anytime soon then, guess ill make due with what is available now, will be good practice on getting to know programs anyway. Thanks.
Posted

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.

Posted

Hi jason|99,

 

Yes indeed you are correct. You should consider programs as Control variables. This means that every time the program is set to true (even if it was true before), all other programs that are evaluated based on this program are re-evaluated. Just like using Control Switch On in programs.

 

With kind regards,

Michel

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

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