DOODS2 sending notification when object detected with multiple conditions

Hi everyone,

I simply can‘t get my head around how to build this logic.

I have currently two automations.

A) Notifies me with a picture when movement is detected and no one is home.

B) Notifies me with a picture when someone is home and time is between 22:00 and 06:15

Both a working fine. I have had a lot of false positives with bugs, spiders and rain. So I have set up DOODS2 and only want to get notified when a person is detected. I am not running the service permanently as I “only” have a Pi4 and want to save resources. Therefore object detection should only take place when the binary sensor of motion has been activated on the camera. If a person is detected, I will be notified, if not, nothing happens.

I’ve tried it with an automation that triggers a Skript of image processing for doods. But that does not give me a condition which I can check in the automation before triggering the image processing.

So I would be looking for an automation that triggers when motion is detected, the conditions are matched (see A and B) and a person is detected by doods and only then sends me a notification, ideally all in one go.

I hope you can help me :slight_smile:

1 Like
alias: "Doods Process Scanned Image "
description: ""
trigger:
  - platform: state
    entity_id:
      - image_processing.doods2_processing
    id: image_detect
condition:
  - condition: or
    conditions:
      - condition: template
        value_template: >-
          {{ "person" in
          state_attr("image_processing.doods2_processing","summary")
          }}
      - condition: template
        value_template: >-
          {{ "cat" in
          state_attr("image_processing.doods2_processing","summary")
          }}
      - condition: template
        value_template: >-
          {{ "dog" in
          state_attr("image_processing.doods2_processing","summary")
          }}
      - condition: template
        value_template: >-
          {{ "bicycle" in
          state_attr("image_processing.doods2_processing","summary")
          }}
      - condition: template
        value_template: >-
          {{ "book" in
          state_attr("image_processing.doods2_processing","summary")
          }}
      - condition: template
        value_template: >-
          {{ "car" in
          state_attr("image_processing.doods2_processing","summary")
          }}
action:
  - service: notification.send_notification
    ...

Try this. I have this running right now and I get a notification whenever doods2 detects something (and only then) based on the rules I set for it in the image_processing config