Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Logic question

Featured Replies

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?

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.

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.

  • Author

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.

How about:

 

If

 

(Motion1 is On and Motion2 is NOT on)

 

or

 

(motion2 is On and Motion1 is NOT on)

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.