Using Unifi's AI detection to trigger floodlights

Hey guys, so this is my basic automation that I’m having troubles with. It seems straightforward, but I’


m sure I’m doing something wrong.

In short I just want this one floodlight to turn on when this one camera detects a person. Any help? Ideally it would also turn off after a set amount of seconds.

I can’t use the built in motion detection features because this isn’t a motion detection, it’s a human detection.

Thanks!

!id: ‘1733676523023’
alias: Floodlight G5 flex
description: ‘’
triggers:

  • trigger: state
    entity_id:
    • switch.g5_flex_detections_person_2
      conditions:
      actions:
  • action: light.toggle
    metadata: {}
    data: {}
    target:
    entity_id: light.floodlight_cars_outlet
  • delay:
    hours: 0
    minutes: 0
    seconds: 10
    milliseconds: 0
  • action: light.turn_off
    metadata: {}
    data: {}
    target:
    entity_id: light.floodlight_cars_outlet
    mode: single

Here’s the image of the sensors exposed from the camera

1 Like

It would be more helpful to see the actual YAML rather than a screenshot of the GUI. I can’t remember off hand exactly what sensors the UniFi cameras expose, so it also might be helpful to list those (in that case, a screenshot of the device page with all the entities would probably be enough).

1 Like

I updated the post to include the YAML configuration as well as the sensors exposed from the camera, thanks so much for your time!

The one labeled Person detected is the one you want to use. That will only be ON if an actual person is detected. If that isn’t changing to ON when a person is in the camera’s field of view, then there is something off with your setup.

One other request. Please format your YAML correctly so it’s more readable.