Skip to content

Commit

Permalink
update post
Browse files Browse the repository at this point in the history
  • Loading branch information
jbowdre committed Nov 27, 2023
1 parent 12f4859 commit 2fe2d81
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 %}}
Expand Down

0 comments on commit 2fe2d81

Please sign in to comment.