From 2fe2d81979d8c5251662725a64ff819c49c35424 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 27 Nov 2023 12:42:01 -0600 Subject: [PATCH] update post --- .../index.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md b/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md index 5b32e9a..73e39e5 100644 --- a/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md +++ b/content/posts/automating-camera-notifications-home-assistant-ntfy/index.md @@ -48,7 +48,7 @@ notify: The Reolink integration exposes a number of entities for each camera. For triggering a notification on motion detection, I'll be interested in the [binary sensor](https://www.home-assistant.io/integrations/binary_sensor/) entities named like `binary_sensor.$location_$type` (like `binary_sensor.backyard_person` and `binary_sensor.driveway_vehicle`), the state of which will transition from `off` to `on` when the selected motion type is detected. -So I'll craft start with a simple automation which will push out a notification whenever any of the listed cameras detect a person (or vehicle): +So I'll begin by crafting a simple automation which will push out a notification whenever any of the listed cameras detect a person or vehicle[^vehicle]: ```yaml # torchlight! {"lineNumbers": true} # exterior_motion.yaml @@ -73,6 +73,8 @@ action: message: "{{ trigger.to_state.attributes.friendly_name }}" ``` +[^vehicle]: Hopefully I only need to worry about vehicles in the driveway. _Please don't drive through my backyard, thanks._ + {{% notice tip "Templating" %}} That last line is taking advantage of Jinja templating and [trigger variables](https://www.home-assistant.io/docs/automation/templating/#state) so that the resulting notification displays the friendly name of whichever `binary_sensor` triggered the automation run. This way, I'll see something like "Backyard Person" instead of the entity ID listed earlier. {{% /notice %}}