Skip to content

Instantly share code, notes, and snippets.

@darnmason
Created February 20, 2025 11:20
Show Gist options
  • Save darnmason/d4a6eb183dd685544d26f58169ff4b78 to your computer and use it in GitHub Desktop.
Save darnmason/d4a6eb183dd685544d26f58169ff4b78 to your computer and use it in GitHub Desktop.
Baby Monitor Notification using Frigate sensors
alias: Baby Monitor Notification
description: >-
Show the notification whenever motion or sound is detected for easy access to
camera stream
triggers:
- trigger: state
id: detection
entity_id:
- binary_sensor.baby_motion
- binary_sensor.baby_cough_sound
- binary_sensor.baby_crying_sound
- binary_sensor.baby_yell_sound
- binary_sensor.baby_groan_sound
- binary_sensor.baby_scream_sound
- binary_sensor.baby_speech_sound
- binary_sensor.baby_fart_sound
to: "on"
from: "off"
- alias: BABY_AWAKE notification action received
trigger: event
id: awake
event_type: mobile_app_notification_action
event_data:
action: BABY_AWAKE
conditions:
- condition: state
entity_id: input_boolean.baby_asleep
state: "on"
actions:
- alias: Choose trigger
choose:
- conditions:
- condition: trigger
id: detection
sequence:
- variables:
detected: "{{ state_attr(trigger.entity_id, 'friendly_name') }}"
is_alert: "{{ trigger.entity_id != 'binary_sensor.baby_motion' }}"
action_awake:
action: BABY_AWAKE
title: Awake
icon: mdi:bed-empty
- action: notify.our_phones
data:
title: Baby Monitor
message: >
{{detected}} detected at {{
as_timestamp(states[trigger.entity_id].last_changed) |
timestamp_custom("%H:%M") }}
data:
tag: single_instance
channel: |
Baby Monitor{{ " Alert" if is_alert }}
importance: |
{{ "high" if is_alert else "low" }}
push:
interruption-level: |
{{ "active" if is_alert else "passive" }}
visibility: public
timeout: 900
notification_icon: mdi:baby-face
url: https://frigate.my.url/#baby
clickAction: https://frigate.my.url/#baby
image: /api/camera_proxy/camera.baby
actions: |
{{ [action_awake] if is_alert else [] }}
- conditions:
- condition: trigger
id: awake
sequence:
- action: input_boolean.turn_off
target:
entity_id: input_boolean.baby_asleep
mode: queued
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment