Skip to content

feat: add send_push_on_no_match option for direct push when detection finds nothing #26

@pliablepixels

Description

@pliablepixels

Problem

When using direct mode (Path 1 / ZM EventStartCommand), zm_detect.py exits early with no push notification if ML detection finds no matches. This is a problem for users with external sensor triggers (e.g. PIR, door sensors) who want a push notification regardless of whether YOLO detects anything.

In the ES path, event_start_notify_on_hook_fail: all handles this, but in direct mode there is no ES — zm_detect.py is the only thing running.

Solution

Add push.send_push_on_no_match (default: no) to objectconfig.yml. When set to yes, zm_detect.py sends a push notification using the original event cause/reason even when detection returns no matches.

Also refactored push sending into a _try_push() helper to eliminate code duplication.

Changes

  • hook/zm_detect.py — extract _try_push() helper, add no-match push path
  • hook/objectconfig.example.yml — add send_push_on_no_match: "no"
  • docs/guides/config.rst — document new key in reference table and setup section

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions