Hi, thanks for the awesome work @snowzach.
My first post, however been using Home Assistant since the first few days of January this year and I’m impressed (came from Domoticz). I’ve struggled with all kinds of issues and these forums helped me a lot (w/ trial and error) and allowed me to get very far.
My setup is an HA OVA w/ the hass.io addon added through supervisor.
My current issue is that I am trying to see if I can adjust the automation trigger to work with the motion detector AND (this a condition?) if it’s a person defined by doods. I get way too many motion detections (I’ve adjust the sensitvity in Hikvision to try and lower the amount to no avail).
configuration.yaml
image_processing:
- platform: doods
scan_interval: 10000
url: "http://IP:8080"
auth_key: !secret doodskey
detector: tensorflow
file_out:
- "/config/www/pictures/{{ camera_entity.split('.')[1] }}_latest_doods.jpg"
# - "/config/www/pictures/{{ camera_entity.split('.')[1] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}_doods.jpg"
source:
- entity_id: camera.ds_2cd2112_i_mainstream
confidence: 40
labels:
- name: person
confidence: 40
- name: car
confidence: 60
- name: truck
confidence: 40
automation.yaml
# DOODs w/ camera (front)
- alias: Camera - Person detected
trigger:
- platform: state
entity_id:
- binary_sensor.videosource_1_motion_alarm
# - binary_sensor.mymotiondetectorrule_cell_motion_detection disabled due to the above working better.
to: "on"
condition: []
action:
- service: image_processing.scan
entity_id: image_processing.doods_ds_2cd2112_i_mainstream
- service: notify.mobile_app_step
data:
title: Motion detected!
message: Someone in front of your house. Prepare for battle!
data:
attachment:
url: https://myIP:8123/local/pictures/ds_2cd2112_i_mainstream_latest_doods.jpg
mode: single
The automation.yaml above spams me with messages (everything seems to works fine). However the following code added silences the message but doesn’t send me a message if I stand in front of the camera:
condition:
- condition: template
value_template: "{{ 'person' in state_attr('image_processing.doods_ds_2cd2112_i_mainstream','summary') }}"
I’m trying to create an “if-then-else” situation where the trigger and the condition are checked (is motion detected and is it a person scanned by doods) before performing the action. However I think I’ll need to start this somewhere before the action-sequence otherwise doods will not have scanned a person:
- service: image_processing.scan
entity_id: image_processing.doods_ds_2cd2112_i_mainstream
On the 30th of January: apparently sometimes it seems to detect someone in front of my house (w/ the extra condition) however there was no person in sight (doods didn’t see a person either):
matches:
car:
- score: 93.24881
box:
- 0.14872093
- 0.061141133
- 0.2969224
- 0.18527538
- score: 89.866615
box:
- 0.21446973
- 0.055247918
- 0.95497346
- 0.6572731
- score: 81.25439
box:
- 0.17098683
- 0.0012004471
- 0.28035635
- 0.056980252
truck:
- score: 40.161026
box:
- 0.04752839
- 0.30466023
- 0.17807434
- 0.49091586
summary:
car: 3
truck: 1
total_matches: 4
process_time: 1.4891642459988361
friendly_name: Doods ds_2cd2112_i_mainstream
Can anyone point me in the right direction?
My second question is:
I know that I can add my back camera in the config.yaml by adding another entity_id to the source. However how can I remove the car label from my backyard (there will never be a car there unless it falls from the sky) while keeping the car label in the front camera.
Third question (while I am at it, this will be my last and least necessary):
Is it possible to rename labels in the txt file or does that mess up the system?