I set this up with Frigate and the indiefan proxy container. Iām not using Scrypted. I have a simple HA automation change the color of a Hue bulb when my little one cries or when motion is detected. Frigateās audio detectors are super solid as others have said and they roughly match the Nanit app notifications, but often faster.
It took a bit to get set up, so hereās my setup for anyone curious:
Home Assistant - running on Proxmox but that part doesnāt matter as much. Mosquitto MQTT add-on running there too. I used the Home Aassistant OS script from Proxmox Scripts.
Docker: Frigate and indiefan/home_assistant_nanit docker container both running in the same docker-compose stack (created from Proxmox Docker LXC script). I mapped the GPU device here and as a passthrough in Proxmox. (Iām running on an Intel N150 Beelink box so I mapped /dev/dri/renderD128.) I ran Nanit auth process on my laptop and copied the session.json contents.
docker-compose.yml
Heads up that this docker compose uses a few volumes to partition storage, so definitely adjust as needed.
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
stop_grace_period: 30s # allow enough time to shut down the various services
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "512mb" # update for your cameras based on calculation above
devices:
# - /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
# - /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://github.com/jnicolson/gasket-builder
# - /dev/video11:/dev/video11 # For Raspberry Pi 4B
- /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- /mnt/frigate-config:/config
- /mnt/frigate-storage:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "8971:8971"
- "5000:5000" # Internal unauthenticated access. Expose carefully.
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: "A_PASSWORD"
cap_add:
- CAP_PERFMON
nanit-proxy:
# This name must match the RTSP frigate config.yml
container_name: nanit-proxy
image: indiefan/nanit
restart: unless-stopped
stop_grace_period: 10s # allow enough time to shut down the various services
volumes:
- /mnt/nanit:/data
ports:
- "1935:1935"
environment:
NANIT_RTMP_ADDR: 192.168.50.4:1935 # LAN IP address of this Docker container. Yes, weird.
NANIT_LOG_LEVEL: trace
NANIT_MQTT_ENABLED: true
NANIT_MQTT_BROKER_URL: mqtt://192.168.50.5:1883 # In this case, my HA IP because HA Add-on.
NANIT_MQTT_USERNAME: AN_MQTT_USERNAME
NANIT_MQTT_PASSWORD: AN_MQTT_PASSWORD
Frigate config: This part took some tinkering but has been super solid once set up
Frigate YAML config
version: 0.16-0
go2rtc:
streams:
nanit:
# The hostname nanit-proxy refers to the name in your docker-compose.yml
- rtmp://nanit-proxy:1935/local/aab19b5c
mqtt:
enabled: true
host: 192.168.50.5 # IP address of HA if running Mosquitto add-on
user: AN_MQTT_USERNAME
password: AN_MQTT_PASSWORD
cameras:
nanit:
ffmpeg:
inputs:
- path: rtmp://nanit-proxy:1935/local/aab19b5c
# The hostname nanit-proxy refers to the name in your docker-compose.yml
input_args: preset-rtmp-generic
roles:
- detect
- audio
detect:
enabled: true
audio:
enabled: true
# test_crying_detection:
# ffmpeg:
# inputs:
# - path: /media/frigate/crying2_25_31_783.120_327.mp4
# input_args: -re -stream_loop -1 -fflags +genpts
# roles:
# - detect
# - audio
# detect:
# enabled: false
# audio:
# enabled: false
motion:
threshold: 50
contour_area: 40
improve_contrast: true
detectors:
ov:
type: openvino
device: GPU
# TODO TODO TODO Edit this section
# See https://docs.frigate.video/configuration/object_detectors/ for the correct model for your hardware.
# You might also need to copy model files depending on your choice.
# This is for Intel N150 and most other Intel hardware. Note that you'll need to pass through /dev/dri/renderD128 for this.
model:
width: 300
height: 300
input_tensor: nhwc
input_pixel_format: bgr
path: /openvino-model/ssdlite_mobilenet_v2.xml
labelmap_path: /openvino-model/coco_91cl_bkgr.txt
audio:
enabled: true
max_not_heard: 15
listen:
- crying
- babbling
- scream
- yell
- smoke_detector # Bonus!
- fire_alarm # Bonus!
filters:
crying:
threshold: 0.6
face_recognition:
enabled: true # Frankly this is unnecessary. It's only ever seen my baby's face.
model_size: large
objects:
track:
- person
Inside Home Assistant, Iām using the Frigate HACS integration. I also created MQTT sensors with for temp and humidity for the topics nanit/babies/{babyId}/temperature and nanit/babies/{babyId}/humidity.
One bonus, you can add Frigate detectors for smoke_detector / fire_alarm and HA now knows about your fire alarm with just a couple lines of config.
I hope this helps! - sorry for so few links, new user.