dahua icon indicating copy to clipboard operation
dahua copied to clipboard

Trigger for specific CrossLine based on 'dahua_event_received' not working

Open chrisriteco opened this issue 6 months ago • 0 comments

Have a Dahua NVR with two channels. Use the 'automations' based on 'dahua_event_received'. This works fine. However, I want to distinguish per CrossLine (there are 3 per camera). Events come in neatly in HA. If I use the following trigger, it works, but is not specific for a CrossLine:

TRIGGER that works event_type: dahua_event_received event_data: DeviceName: NVR for Code: CrossLineDetection action: Start trigger: event

If I adjust this to specifically extract a certain CrossLine, it no longer works. Below the trigger and the log file:

TRIGGER not working event_type: dahua_event_received event_data: DeviceName: NVR voor Code: CrossLineDetection action: Start data: Name: Brievenbus trigger: event

LOG 2025-04-08 12:32:00.427 DEBUG (MainThread) [custom_components.dahua] Events received from 192.168.28.2 on channel 1: [{'Code': 'CrossLineDetection', 'action': 'Start', 'index': '1', 'data': '{\n "Class" : "Normal",\n "CountInGroup" : 1,\n "DSTEnable" : true,\n "DetectLine" : [\n [ 3458, 2042 ],\n [ 6626, 7340 ]\n ],\n "Direction" : "LeftToRight",\n "EventID" : 17185,\n "GroupID" : 2772,\n "IP" : "192.168.28.2",\n "LocaleTime" : "2025-04-08 12:32:00",\n "Name" : "Brievenbus",\n "Object" : {\n "Action" : "Appear",\n "BelongID" : 0,\n "BoundingBox" : [ 3232, 1720, 4400, 5640 ],\n "Center" : [ 3816, 3680 ],\n "Confidence" : 0,\n "FusionInfo" : {\n "BelongID" : 0,\n "CartPosX" : 0.0,\n "CartPosY" : 0.0,\n "GpsPosValid" : 0,\n "GpsPostion" : {\n "Latitude" : 0.0,\n "Longitude" : 0.0\n },\n "ObjectSource" : 0,\n "RadarCoorXyValid" : 0,\n "Speed" : 0.0,\n "SpeedValid" : 0,\n "SpeedX" : 0.0,\n "SpeedY" : 0.0\n },\n "LowerBodyColor" : [ 0, 0, 0, 0 ],\n "MainColor" : [ 0, 0, 0, 0 ],\n "ObjectID" : 182982,\n "ObjectType" : "Human",\n "RelativeID" : 0,\n "Speed" : 0,\n "humanTripLineDirection" : 0\n },\n "PTS" : 53305042080.0,\n "RealUTC" : 1744108320,\n "RuleID" : 5,\n "StartTime" : "2025-04-08 12:32:01",\n "TimeZone" : 1,\n "TimeZoneDesc" : "Amsterdam",\n "Track" : [],\n "UTC" : 1744115521,\n "UTCMS" : 699,\n "uuid" : "2401'}]

chrisriteco avatar Apr 08 '25 11:04 chrisriteco