Pancam automation for smart plug activated lamp

Trying to set up an automation between wyze pan cam v3 and wyze smart plug to turn on a garage light when the camera detects motion or a vehicle (have tried both settings). Automation works ok except when the smart plug (and the light) go off after a few minutes, the pan cam detects the lighting change and turns the plug (and the light) back on and then repeats the cycle. Any advice on how to prevent the light going off as a trigger to activate the smart plug, and therefore turn on the light again? Thanks.

Welcome to the Forum, @rpage973! :wave:

If you’re using a single Device & Service Trigger Automation, then I can see how this might be a problem. What can you share about how you have your Automation set so far?

One way to work around this might be to create a couple of additional Device & Service Trigger Automations. For instance, let’s imagine that you currently have one Automation that looks like this:

Turn on Plug with Cam Pan v3 vehicle detection (Automation 1)

  • IF
    • Cam Pan v3
      • Detects a vehicle
  • DO
    • Plug
      • Turn on for 5 minutes

If you’re using something like that, then part of the problem is that lighting change you described (which would be at the 5-minute mark in this example), so you might be able to cheat that by adding two other Automations to temporarily disable the Cam’s motion detection during the time you expect that lighting change:

Turn off Cam Pan v3’s motion detection (Automation 2)

  • IF
    • Plug
      • Has been on for 00:04:30
  • DO
    • Cam Pan v3
      • Turn off motion detection

Turn on Cam Pan v3’s motion detection (Automation 3)

  • IF
    • Plug
      • Has been off for 00:00:30
  • DO
    • Cam Pan v3
      • Turn on motion detection

The idea is to give the Plug “off” event a half-minute buffer on either side so that the lights turning off doesn’t trigger another motion event with the Cam. A problem with something like that is that you could trigger the Cam at the 4-minute mark (e.g., someone could walk in front of the Cam, and the Cam happens to detect a vehicle in its field of view), which would reset the 5-minute “on” timer for the Plug, but then the Cam’s motion detection would turn off at 4:30 (because the Plug has already been on for that long). Then if someone is continuing to move around in the garage for 5 minutes after that, the light will turn off because the Cam is no longer detecting motion to keep the light on. Then the person would be in the dark for half a minute until the Cam can once again detect motion and see the vehicle. That’s what I imagine might happen, anyway, but I haven’t tried this specific scenario.

You could also make the buffer smaller (maybe 5-10 seconds on either side), but I still don’t know if that would accomplish your goal.

Why wouldn’t you just trigger on person detection instead of motion or vehicle detection so that the light is on only when a person who would use the light is in view of the Cam?

There may be a way to do this that hasn’t yet occurred to me, but right now I think I don’t have a clear understanding of the problem and goal.

Thanks for the response. Your suggestion to trigger on a person, instead of motion or the vehicle, looks like it did the trick. To be honest, that is probably the better trigger overall for my purposes, and, it seems to have fixed the problem with the repeat cycle.

Great job by you! Thanks!

Glad to know that works for you, and thank you for taking the time to provide an update. :+1:

In a case like this—or at least what I imagine the goal to be if I was trying to do something like this—triggering on person detection makes a lot more sense to me, because I’m thinking that the only reason I’d want a light on in the garage is if a person was there who would need the light to see. A parked vehicle certainly doesn’t need it, and if I’m using Auto for my Night Vision Mode setting (which is what I do for the Cam OG I have in the garage here), then the Cam is going to be able to see well enough with its IR even at night, so it doesn’t need the external visible light source.

If you were just triggering on generic motion, then getting this to work without responding to the light changes would be more challenging, but since you were already trying to trigger based on vehicle detection, then that tells me you’re already paying for a subscription, and triggering on the person who’d be there to use the light seems like the easiest thing to do.