Unifi Protect Person detection

Thanks, @AngellusMortis!

I figured this out at some point after posting here before. I didn’t realize the logbook didn’t show all updates. It seems counterintuitive that the Logbook, which is a list, doesn’t show all changes, but the History, which only shows a bar graph, does show everything.

I do have another issue I wasn’t able to resolve:

If I set up an automation trigger as a Device looking for the Trigger “Doorbell Detections: Vehicle turned on or off”, it never triggers. But if I do it as a State trigger for the entity “Doorbell Detected Object” from nothing to “vehicle”, it works.

Update:
Now, having written this out. I’m wondering if the Device trigger triggers when you turn the detection on or off though.

Oy… Yes that is exactly what it does :man_facepalming:t3:

2 Likes

I’ve got a similar issue. Trying to setup person detection on a G4 doorbell and G4 dome. Home Assistant offers the entity, but doesn’t seem to register the person trigger even though the UniFi Protect app does. I’ve tried using device trigger and state trigger, but no joy. Any ideas?

Thank you so much for this, was having trouble since it listed all the sensors but this was the only one that actually is changed when a person is detected.

@Jon123 Just figured out the same thing. thanks for your post

Hello, does anyone have an automation that works? But I use this but nothing happens while HA detects person and vehicles well
here my automatisation

- id: '1643898100671'
  alias: 'Personne détecte dans le passage '
  description: Allume les lumières du passage et jardin pendant 1 minutes après avoir
    detecté une personne
  trigger:
  - platform: state
    entity_id:
    - sensor.passage_detected_object
    to: person
  condition:
  - condition: sun
    after: sunset
    before: sunrise
  action:
  - service: light.turn_on
    data: {}
    target:
      entity_id:
      - light.passage
      - light.jardin_2
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      entity_id:
      - light.passage
      - light.jardin_2
  mode: single
- id: '1643898445496'
  alias: Personne détecte sur le Parking
  description: Allume les lumières du parking des qu'une personne est détectée par
    la caméra Maison
  trigger:
  - platform: state
    entity_id:
    - sensor.g4_maison_detected_object
    to: person
  condition:
  - condition: sun
    before: sunrise
    after: sunset
  action:
  - service: light.turn_on
    data: {}
    target:
      entity_id:
      - light.parking
      - light.video_entree
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      entity_id: light.parking
  mode: single
- id: '1645533289223'
  alias: Personne détecté dans le jardin
  description: Allume les lumières du passage et jardin pendant 1 minutes après avoir
    detecté une personne
  trigger:
  - platform: state
    entity_id:
    - sensor.g4_jardin_detected_object
    to: person
  condition:
  - condition: sun
    before: sunrise
    after: sunset
  action:
  - service: light.turn_on
    data: {}
    target:
      device_id:
      - 907287a30bb811ebaba045a191efd9cd
      - 8afa9b7e0c9e11ebbb9dcfb3c6bf2204
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      entity_id:
      - light.passage
      - light.jardin_2
  mode: single
- id: '1661944219113'
  alias: Véhicule entrant ou sortant sur le parking
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.g4_maison_detected_object
    to: vehicle
  condition:
  - condition: sun
    before: sunrise
    after: sunset
  action:
  - service: light.turn_on
    data: {}
    target:
      entity_id:
      - light.parking
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - service: light.turn_off
    data: {}
    target:
      entity_id: light.parking

And here the history of one sensor : sensor.g4_parking_detected_object

in purple it is a person in light blue a car

Ok It’s the day but i tested it yesterday night and it does’nt work, light don’t turn on but person are detected but sensor in ha !

There isn’t any mention of sensor.g4_parking_detected_object in your automations ?

yes it’s just to show that the sensor detect person or vehicule i show also g4 maison detected object :slight_smile:

Have you tried removing the condition ?

I just tried disabling the condition and it works!!!
But suddenly how to do it so that it only works at night

Not sure, try this instead:

condition:
  - condition: state  # from sunset until sunrise
    entity_id: sun.sun
    state: "below_horizon"

It’s work fine :slight_smile:
Thanks you