From 3bd9a979c7bd2993c6e58a87f9e6f86c89847f59 Mon Sep 17 00:00:00 2001 From: kifort Date: Sun, 27 Jun 2021 18:00:10 +0200 Subject: [PATCH] Extend Sighthound documentation. (#17932) * Extend Sighthound documentation. * Address review comments * Update source/_integrations/sighthound.markdown Co-authored-by: Franck Nijhof * Apply yaml style guide * Apply suggestions from code review Co-authored-by: Klaas Schoute * Tweaks Co-authored-by: Franck Nijhof Co-authored-by: Klaas Schoute --- source/_integrations/sighthound.markdown | 44 +++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/source/_integrations/sighthound.markdown b/source/_integrations/sighthound.markdown index 550c37dc25d..e383098bac1 100644 --- a/source/_integrations/sighthound.markdown +++ b/source/_integrations/sighthound.markdown @@ -16,7 +16,7 @@ This integration adds an image processing entity where the state of the entity i If `save_file_folder` is configured, on each new detection of a person, an annotated image with the name `sighthound_{camera_name}_latest.jpg` is saved in the configured folder if it doesn't already exist, and overwritten if it does exist. The saved image shows the bounding box around detected people and can be displayed on the Home Assistant front end using a [Local File](/integrations/local_file/) camera, and used in notifications. If `save_timestamped_file` is configured as `true`, then the annotated image is saved with a file name that includes the time of detection. -**Note** that by default the component will not automatically scan images, but requires you to call the `image_processing.scan` service, e.g., using an automation triggered by motion. +**Note** that by default the component will not automatically scan images, but requires you to call the `image_processing.scan` service, e.g., using an automation triggered by motion. ## Configuration @@ -63,3 +63,45 @@ source: required: false type: string {% endconfiguration %} + +To verify the integration, check if a new entity is appeared as `image_processing.sighthound_my_cam` + +## Process an Image + +When you want to process an image, you have to call `image_processing.scan` service and listen to the `sighthound.person_detected` and/or `sighthound.vehicle_detected` events. + +An example using two automations: + +- The first automation is triggered, when a motion is detected. It calls the `image_processing.scan` service to send the camera image to the sighthound server for processing. + +- The second automation is triggered by a `sighthound.vehicle_detected` event. It sends a notification to a phone. + +```yaml +# Example automations.yaml entry +- id: "SOME_UNIQUE_ID" + alias: "Entrance Motion Image Processing" + description: "Send a camera image to sighthound, when motion is detected at the entrance" + trigger: + - type: motion + platform: device + device_id: YOUR_DEVICE_ID + entity_id: binary_sensor.my_motion_sensor + domain: binary_sensor + action: + - service: image_processing.scan + target: + entity_id: image_processing.sighthound_my_cam + mode: single + +- id: "ANOTHER_UNIQUE_ID" + alias: "Arriving Vehicle Notification" + description: "Send a notification to a phone, when a vehicle is detected at the entrance" + trigger: + - platform: event + event_type: sighthound.vehicle_detected + action: + - service: notify.mobile_app_my_iphone + data: + message: "Somebody has just arrived by car." + mode: single +```