No description
  • Go 99.3%
  • Dockerfile 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Adam Staněk ea154f969b Merge branch 'shbatm-master-patch-30810' into 'master'
Home Assistant MQTT Sensor Updates

See merge request adam.stanek/nanit!7
2022-01-05 16:46:38 +00:00
cmd/nanit NANIT_RTMP_ENABLED true by default 2021-02-03 22:08:52 +01:00
docs Update home-assistant.md 2022-01-04 19:54:17 +00:00
pkg fixed baby dereference 2021-02-03 22:09:49 +01:00
.dockerignore updated Dockerfile for new layout 2020-12-24 10:42:05 +01:00
.env.sample removed hls stream and watchdog 2021-01-12 19:35:06 +01:00
.gitignore watchdog 2020-12-21 17:34:52 +01:00
.gitlab-ci.yml ci: fixed platform for tags 2021-01-27 21:07:02 +01:00
Dockerfile Dockerfile: default base image tag 2021-01-12 19:19:21 +01:00
Dockerfile.base ci: base image 2020-12-07 20:28:31 +01:00
go.mod rtmp server init 2021-01-04 22:15:31 +01:00
go.sum rtmp server init 2021-01-04 22:15:31 +01:00
README.md README: updated image tag [skip ci] 2021-02-04 09:31:48 +01:00

Nanit Stream Proxy

This is sleepless night induced pet project to restream Nanit Baby Monitor live stream for local viewing.

Features

  • Restreaming of live feed to local RTMP server
  • Retrieving sensors data from cam (temperature and humidity) and publishing them over MQTT
  • Graceful authentication session handling
  • Works as a companion for your Home-assistant / Homebridge setup (see guides below)

TL;DR

# Note: use your local IP, reachable from Cam (not 127.0.0.1)

docker run --rm \
  -e NANIT_EMAIL=[email protected] \
  -e NANIT_PASSWORD=XXXXXXXXXXXXX \
  -e NANIT_RTMP_ADDR=xxx.xxx.xxx.xxx:1935 \
  -p 1935:1935 \
  registry.gitlab.com/adam.stanek/nanit:v0-7

Open rtmp://127.0.0.1:1935/local/[your_baby_uid] in VLC. You will find your baby UID in the log of running application.

Setup guides

Further usage

Application is ready to be used in Docker. You can use environment variables for configuration. For more info see .env.sample.

Why?

  • I wanted to learn something new on paternity leave (first project in Go!)
  • Nanit iOS application is nice, but I was really disappointed that it cannot properly stream to TV through AirPlay. As anxious parents of our first child we wanted to have it playing in the background on TV when we are in the kitchen, etc. When AirPlaying it from the phone it was really hard to see the little one in portrait mode + the sound was crazy quiet. This helps us around the issue and we don't have to drain our phone batteries.

How to develop

go run cmd/nanit/*.go

# On proto file change
protoc --go_out . --go_opt=paths=source_relative pkg/client/websocket.proto

# Run tests
go test ./pkg/...

For some insights see Developer notes.

Disclaimer

I made this program solely for learning purposes. Please use it at your own risk and always follow any terms and conditions which might be applied when communicating to Nanit servers.

This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details.