Merge branch 'main' into drafts

This commit is contained in:
John Bowdre 2023-12-18 14:43:57 -06:00
commit b0820a4fba
10 changed files with 26 additions and 7 deletions

View file

@ -135,7 +135,12 @@ url = "https://runtimeterror.dev/simplex"
[[socialLinks]] [[socialLinks]]
icon = "fa-solid fa-envelope" icon = "fa-solid fa-envelope"
title = "Email" title = "Email"
url = "mailto:ops@runtimeterror.dev" url = "mailto:jbowdre@omg.lol"
[[socialLinks]]
icon = "fa-solid fa-heart"
title = "omg.lol"
url = "https://jbowdre.omg.lol"
[[powerLinks]] [[powerLinks]]
title = "hugo" title = "hugo"

View file

@ -24,9 +24,14 @@ And in the free time I have left, I game on my Steam Deck.
See what I've been up to on: See what I've been up to on:
- [GitHub](https://github.com/jbowdre) - [GitHub](https://github.com/jbowdre)
- [CounterSocial](https://counter.social/@john_b) - [CounterSocial](https://counter.social/@john_b)
- [status.lol](https://status.lol/jbowdre)
- [/now page](https://jbowdre.omg.lol/now)
Securely chat with me via: Connect with me via:
- [SimpleX Chat](/simplex/) - [SimpleX Chat](/simplex/)
- [Matrix](https://matrix.to/#/@jbowdre:omg.lol)
- [Electronic Mail](mailto:jbowdre@omg.lol)
- [PGP: 613F B70C 4FA7 A077](https://home.omg.lol/keychain/jbowdre/pgp)
[^1]: Congrats? And also, *thank you.* [^1]: Congrats? And also, *thank you.*

View file

@ -1,9 +1,10 @@
--- ---
title: "Automating Security Camera Notifications With Home Assistant and Ntfy" title: "Automating Security Camera Notifications With Home Assistant and Ntfy"
date: 2023-11-25 date: 2023-11-25
# lastmod: 2023-11-23 lastmod: 2023-11-27
description: "Using the power of Home Assistant automations and Ntfy push notifications to level-up security camera motion detections." description: "Using the power of Home Assistant automations and Ntfy push notifications to level-up security camera motion detections."
featured: true featured: true
alias: automating-security-camera-notifications-with-home-assistant-and-ntfy
toc: true toc: true
comment: true comment: true
thumbnail: thumbnail.png thumbnail: thumbnail.png
@ -47,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. 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 ```yaml
# torchlight! {"lineNumbers": true} # torchlight! {"lineNumbers": true}
# exterior_motion.yaml # exterior_motion.yaml
@ -72,6 +73,8 @@ action:
message: "{{ trigger.to_state.attributes.friendly_name }}" 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" %}} {{% 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. 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 %}} {{% /notice %}}
@ -407,7 +410,7 @@ variables: # [tl! collapse:start]
binary_sensor.garage_vehicle: timer.garage_vehicle # [tl! collapse:end] binary_sensor.garage_vehicle: timer.garage_vehicle # [tl! collapse:end]
``` ```
I'd also like to ensure that the interior motion alerts are also activated whenever our [Abode](https://goabode.com/) security system is set to "Away", regardless of what time that may be. That will make the condition a little bit trickier: alerts should be pushed if the timer isn't running AND the schedule is active OR the security system is armed. So here's what that will look like: I'd also like to ensure that the interior motion alerts are also activated whenever our [Abode](https://goabode.com/) security system is armed, regardless of what time that may be. That will make the condition a little bit trickier: alerts should be pushed if the timer isn't running AND the schedule is active OR the security system is armed (in either "Home" or "Away" mode). So here's what that will look like:
```yaml ```yaml
# torchlight! {"lineNumbers": true} # torchlight! {"lineNumbers": true}
@ -440,6 +443,9 @@ condition: # [tl! focus:start]
state: "on" state: "on"
- condition: state - condition: state
state: armed_away state: armed_away
entity_id: alarm_control_panel.abode_alarm
- condition: state
state: armed_home
entity_id: alarm_control_panel.abode_alarm # [tl! ++:end focus:end] entity_id: alarm_control_panel.abode_alarm # [tl! ++:end focus:end]
action: # [tl! collapse:start] action: # [tl! collapse:start]
- service: camera.snapshot - service: camera.snapshot

View file

@ -59,3 +59,6 @@
{{- end }} {{- end }}
</ul> </ul>
{{- end }} {{- end }}
<hr>
<h3>status.lol</h3>
<script src="https://status.lol/jbowdre.js?time&link&no-emoji"></script>

View file

@ -11,7 +11,7 @@ module.exports = {
// Which theme you want to use. You can find all of the themes at // Which theme you want to use. You can find all of the themes at
// https://torchlight.dev/docs/themes. // https://torchlight.dev/docs/themes.
theme: 'one-dark-pro', theme: 'synthwave-84',
// The Host of the API. // The Host of the API.
host: 'https://api.torchlight.dev', host: 'https://api.torchlight.dev',
@ -34,7 +34,7 @@ module.exports = {
// When lines are collapsed, this is the text that will // When lines are collapsed, this is the text that will
// be shown to indicate that they can be expanded. // be shown to indicate that they can be expanded.
summaryCollapsedIndicator: 'Click to expand...', summaryCollapsedIndicator: '{ ... }',
}, },
// Options for the highlight command. // Options for the highlight command.