I control lighting in warehouse area with TP-Link/Kasa switch driving a 30A contactor.
I want lights to come on when Wyze cams detect motion. That’s easy using IFTTT and turning the lights ON is easy.
Now I want the lights to turn OFF 20 minutes after motion is detected. So the lights will stay on as long as the cams detected motion less than 20 minutes ago.
I thought I could do this by simply telling Kasa to turn off after 20 minutes.
BUT nothing is easy. There are two problems here. The most important is that Wyze sees a change in lighting (either on to off, or from off to on) as motion. Thus, when the lights are switched off, the cams see this as motion and dutifully turn the lights ON!
The other problem is that although it’s easy to tell Kasa to turn lights off after 20 minutes, that only seems to work if I turn the lights on with Kasa. If Kasa is told to switch in the lights via Wyze/IFTTT, it’s own 20 minute timer does not work.
I’m hoping there’s some way for the cams to trigger lights on AND send a lights OFF command through IFTTT,
Because Wyze Cams use a Light Pixelation Algorythm to ‘Detect Motion’ in adjacent pixels, the Wyze Cam may not be the best trigger for the lights. You may want to look into installing a PIR sensor for that task that will not be sensitive to lighting changes. Just be aware that if the cam has IRNV and it is on, it will affect the sensitivity of the PIR.
Beyond that, reducing the Detection Sensitivity of the cam should make it less susceptible to drastic lighting changes. How far you have to pull it down will depend on the intensity of your lights. It may have to be reduced down so far that it makes the cam ineffective at detecting motion though. Only real time application testing will reveal this.
I have had the necessity to introduce on\off timers on fans that could be turned on by my Wyze device, but not turned off. This may be an option: I used a static Wyze Plug, which has its own timer option, as an intermediate IoT relay between ecosystems. The plug has nothing plugged into it. It is just a WiFi relay switch. It might look like this:
Wyze Rule #1: Cam Motion = Wyze Plug On
IFTTT Applet #1: Wyze Plug On = Casa Switch On
Wyze Rule #2: If Wyze Plug On for 20 min = Wyze Plug Off
IFTTT Applet #2: Wyze Plug Off = Casa Switch Off
Great suggestion to use Wyze plug for a timer. That’s perfect.
Mistaking changes in lighting for motion is the big challenge. As you say, reducing the motion sensitivity on the cams such that they don’t trigger for changes in lighting makes them useless for detecting motion.
I’m considering a Rube Goldberg solution using four devices
A. Wyze cam for motion detection
B. Kasa light switch
C. Wyze plug #1 (for use as a timer)
D. Wyze plug #2 (also for use as a timer)
Wyze Rule: Cam motion = Wyze plug #1 on (timer set for 20 minutes)
Wyze Rule: Cam motion = Wyze plug #2 on (timer set for 1 minute)
IFTTT Applet: Cam motion = Kasa switch ON
Wyze Rule: Wyze plug #1 on for 20 minutes =
…Turn off motion detection on cams
…Wyze plug #1 off
…Wyze plug #2 on
IFTTT Rule: Wyze plug #2 on = Kasa switch OFF
Wyze Rule: Wyze plug #2 on for 1 minute =
…Turn on motion detection on cams
…Wyze plug #2 off
The idea being that motion detection is turned off, then lights are turned off, then one minute later motion detection is turned back on.
The big problem is the cams’ confusion between lights-coming-on-or-going-off and motion. If I reduce the motion sensitivity so the cams don’t notice the lights coming on or going off, they don’t detect and other kind of motion and are basically useless.
But your suggestion about plugs suggests a different approach. How about this…
Wyze rule: Cam motion =
…Wyze plug #1 on
IFTTT rule: Cam motion =
…Kasa lights on
Wyze rule: Wyze plug#1 on for 20 minutes =
…Wyze plug #2 on
…Cam motion detection off
…Wyze plug #1 off
IFTTT rule: Wyze plug #2 on =
…Kasa lights off
Wyze rule: Wyze plug #2 on for 1 minute =
…Cam motion detection on
…Wyze plug #2 off
The idea being that 20 minutes after motion has been detected, motion detection goes off, lights go off, then one minute later motion detection goes back on.
Have you thought of using and actual motion sensor? I have sensors from another company used in conjunction with Alexa and, sorry to say, SmartThings to turn on my outside lights, leave them on for 10 minutes then shut them off.
As for your workflow, at a glance that looks like it would work. Brilliant idea to incorporate the Cam Motion Detection off for the Lighting off event so that it doesn’t trigger a motion event again. The only issue is the order of execution for the Motion Detection Off and the Lighting off to insure there is enough delay so that the Motion detection goes off before the lights go off.
However, test the cam motion detection ON in the lights OFF state before you buy stuff to implement.
I have one cam that I turn on in low light conditions with IR NV set to auto. When the cam initializes and the IR night vision automatically kicks in, and the IR emitters come on, the cam regularly records a full screen motion event because it gets an initial blast of IR lighting. Don’t want this to be the case for you after you already have the pieces in place. Since you aren’t powering the cam and only changing the Motion Detection, it probably won’t be a factor. But better safe than sorry.