Camect Triggers

Hi

I’m trying use the detection in Camect to trigger lights, or send me notifications through Home Assistant.

There is a custom integration, but it relies on an event bus rather than a sensor. Has anyone got this working successfully? I’ve seen a few posts about it, but not a full explanation - I’m not massively experienced with coding but I get the principles.

Thanks

Create an automation triggered by the camect_event event. Use template condition to filter which objects you want like {{ "person" in trigger.event.data.detected_obj }}

I cant get this to work
im useing the
When camect_event event is fired

Template condition

Value template *

1 “person” in trigger.event.data.detected_obj

2

i have tried this too
“Side Door just saw a person” in camect_event.data

here is the data

event_type: camect_event
data:
device_id: camera.camect_5f5
type: alert
raw_data: >-
{‘type’: ‘alert’, ‘desc’: ‘Side Door just saw a person.’, ‘url’:
Camect’,
‘cam_id’: ‘2b817378d3af3e3d752b’, ‘cam_name’: ‘Side Door’, ‘detected_obj’:
[‘person’], ‘roi’: {‘contour’: [{‘point’: [{‘x’: 0.2375, ‘y’: 0}, {‘x’:
0.2375, ‘y’: 0.53333336}, {‘x’: 0.4125, ‘y’: 0.51111114}, {‘x’: 0.4125, ‘y’:
0}]}], ‘object’: [{‘name’: ‘person’, ‘min_size’: 0.034899354, ‘max_size’:
0.07909248, ‘contour’: [{‘point’: [{‘x’: 0.2375, ‘y’: 0}, {‘x’: 0.2375, ‘y’:
0.53333336}, {‘x’: 0.4125, ‘y’: 0.51111114}, {‘x’: 0.4125, ‘y’: 0}]}],
‘movement_trace’: {‘point’: [{‘x’: 0.3076482, ‘y’: 0.21135524}, {‘x’:
0.31138512, ‘y’: 0.19331792}, {‘x’: 0.31777573, ‘y’: 0.21104303}, {‘x’:
0.30945665, ‘y’: 0.22797905}, {‘x’: 0.33446985, ‘y’: 0.22949821}, {‘x’:
0.32112664, ‘y’: 0.26462772}, {‘x’: 0.3138296, ‘y’: 0.26877564}, {‘x’:
0.31674272, ‘y’: 0.26344457}, {‘x’: 0.3476174, ‘y’: 0.2664235}, {‘x’:
0.34987032, ‘y’: 0.2688015}, {‘x’: 0.34834647, ‘y’: 0.26507357}, {‘x’:
0.35948697, ‘y’: 0.26261866}, {‘x’: 0.35871056, ‘y’: 0.26328072}, {‘x’:
0.35777068, ‘y’: 0.26720345}]}}]}}
origin: LOCAL
time_fired: “2023-01-24T01:55:10.289103+00:00”
context:
id: 01GQGQRZAHWEZAP2C9C1AGJ3HH
parent_id: null
user_id: null

The filter needs to be “person” in trigger.event.data.raw_data.detected_obj.

Here’s an example of sending a critical iPhone notification when person has been detected

alias: Notify iPhone when person is detected
description: ""
trigger:
  - platform: event
    event_type: camect_event
condition:
  - condition: template
    value_template: "{{ 'person' in trigger.event.data.raw_data.detected_obj }}"
action:
  - service: notify.mobile_app_iphone_mini2
    data:
      message: Motion has been detected
      data:
        push:
          sound:
            name: US-EN-Alexa-Motion-Detected-Generic.wav
            critical: 1
            volume: 1.0
mode: single