Skip to content

ONVIF motion detection not working with Tapo C545D (and likely other Tapo cameras) #333

@origin2000

Description

@origin2000

First of all, thank you for this great project! I’m relatively new to this topic and have spent the last few days learning how to isolate this specific issue. While I am not an ONVIF expert, I’ve documented my findings below and included a suggested fix. As I don't know the ins and outs of the ONVIF specification, I can't judge if the Tapo firmware is violating the standard here. Please evaluate if changing this endpoint globally would cause regressions for other devices

Camera: TP-Link Tapo C545D, Firmware 1.1.15
LightNVR version: 0.31.3 (docker on Rockpi 4C+ running Armbian Linux 6.18.19-current-rockchip64)

Problem 1: Wrong ONVIF service endpoint
The camera exposes all ONVIF services on a single endpoint:
http://camera_ip:2020/onvif/service

LightNVR sends CreatePullPointSubscription to:
http://camera_ip:2020/onvif/events_service ← does not exist

Fix: change "events_service" to "service" in get_subscription()
in src/video/onvif_detection.c

Problem 2: Missing motion event topics
has_motion_event() does not check for Tapo-specific topics.

Camera sends:
tns1:RuleEngine/CellMotionDetector/Motion (IsMotion: true/false)
tns1:RuleEngine/PeopleDetector/People (IsPeople: true/false)

LightNVR checks for:
RuleEngine/MotionDetector ← not sent by Tapo
VideoAnalytics/Motion ← not sent by Tapo
MotionAlarm ← not sent by Tapo

Fix: add "CellMotionDetector", "PeopleDetector",
"IsMotion", "IsPeople" to has_motion_event()

Verified ONVIF Topics via GetEventProperties:
(full XML output available on request)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions