Jump to content

Program help, please


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

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.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.8k
    • Total Posts
      377.8k
×
×
  • Create New...