Got it (Google Vision) working. It’s damn fast and recognizes not only people. I got “person”, “shorts”, “pants” for detection. Had to implement it as “image_processing.google_vision_person_<entity_id>” (person as target).
!Note!: Add “version” to custom_components’ manifest.json and enable payment in Google Console, otherwise component won’t work!
I implemented it in a two step recognition. motionEye recognizes movement first and sends a webhook to Home Assistant, that starts Google Vision object detection.
Configuration: Image processing
image_processing:
- platform: google_vision
api_key_file: /config/google_vision_api_key.json
save_file_folder: /config/www/tmp_google_vision
source:
- entity_id: camera.<entity_id>
Automation: Webhook from MotionEye
alias: "MotionEye movement detected"
description: Start image processing if motionEye detects movement
trigger:
- platform: webhook
webhook_id: <entity_id>-motion-detected
action:
- service: image_processing.scan
data: {}
target:
entity_id: image_processing.google_vision_person_<entity_id>
mode: single
Automation: Mobile phone notification
alias: "Mobile phone movement notification"
description: "Notify mobile phone if Google Vision detects an object"
trigger:
- platform: event
event_type: image_processing.object_detected
event_data: {}
condition:
- condition: template
value_template: >-
{{ trigger.event.data.entity_id ==
'image_processing.google_vision_person_<entity_id>' }}
action:
- service: notify.mobile_phone
data:
title: "Movement detected"
message: "{{ trigger.event.data.object }} with confidence {{ trigger.event.data.confidence }}"
mode: parallel