Jump to content

Program help, please


mikek

Recommended Posts

Posted

I'm looking for some ideas on the simplest and cleanest and most reliable way to do the following:

I have a motion sensor on my porch (https://www.getzooz.com/zse70-outdoor-motion-sensor/). When motion is detected, I have a program that turns on the porch lights (fast on, night only) and also sends me a notification.

I have the dimmer switch for those lights right near the porch door (https://www.getzooz.com/zooz-zen77-s2-dimmer/).

I want to utilize the double-tap feature of the switch to enable/disable the motion sensor programmatically (via parameter 1) when I am going in and out of the porch door so it ignores my presence. 

I'm not an expert programmer by any means, and I don't know how to specify the double-tap. I don't even know if that's the best approach, but I would like to somehow utilize that switch because of its convenience.

Any and all advice would be appreciated.  

Posted

If you can detect the double tap as an event in a program, then you could have two programs, something like this:

 

If switch double-tap on event

    Then set motion detector parameter 1 to <enable>

 

 

If switch double-tap off event

    Then set motion detector parameter 1 to <disable>

 

I don't know these devices, so I can't tell you what is settable or not by program statements.

Posted (edited)

Another approach would be using a variable. Add a second program:

If control switch fast on and not fast off

   Then set variable to 1

   Else set variable to 0

And then in your current motion program, you would add one line:

And if variable is 1

Just make sure that if you want the motion to always be on unless you toggle it off, that you set the starting value for the variable to 1.

Edited by gregkinney
Posted

I configured the switch to enable the paddle to be used as a scene button and I confirmed via the button status that a double-tap is indeed recognized as "Fast On" (and that the light doesn't actually turn on). However, when I insert that into my program, either directly or as a variable, the program doesn't work (motion is not detected). I'm attaching a simplified version of the program that I'm using to test. 

Screenshot 2025-06-16 144940.png

Posted

So before you added the "And $State_5 is 1" line, this program did correctly work each time that motion was sensed, correct? The only change you made was adding the line "And $State_5 is 1"? 

And if the answer to the above question is yes, can you confim that the current value of $State_5 is 1?

Posted

Answer to your first question is yes. It did/does work without this line. In fact, this is a copy of the program with a lot of the bloat removed just to facilitate testing.

Yes, value is 1.

 

Screenshot 2025-06-16 152546.png

Posted (edited)

For the motion sensor it should probably use control instead of status so when motion is switched on.

Edited by tazman
Posted

Thanks, everyone, for your help. I finally figured out the problem - a conflict with another program. 

Regarding control vs. status, both work fine. Why/when would you choose one over the other, in this case, why did you recommend control?

On 6/16/2025 at 3:38 PM, tazman said:

For the motion sensor it should probably use control instead of status so when motion is switched on.

  • Like 1
Posted (edited)

Control is an event caused by actuation of a device only (not from a program or the AC).  It may not necessarily cause a status change (switch is already on and you turn it on again).

So it really depends do you want the program fired on an actuation event or only when status changes. 

So in this case the motion actuation is a control event and you want the program firing on the motion control is appropriate. 

Edited by BamBamF16
  • Like 1
Posted

"Control on" is triggered any time on is received, but not triggered on off/dim/bright/etc.  If a device (motion sensor in this case) is already on, a control condition will still trigger a program evaluation even though no change in status occurred. An off command will not trigger a program execution.  A control condition is true only during that point when the expected condition is received.  "Control on" is false at all other times.  

"Status on" is triggered by ANY change in status, and is true at all times when the status is on.  If the device is currently on and it transmits another "on" command, a status condition will not trigger since it is not a change in status.

Use of control versus status is based upon the desired logical result.

 

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.


×
×
  • Create New...