I hope this helps you and anyone else looking at this, the rtmp address that you set running the docker container should be the IP address of that docker container and not the nanit camera, I don’t think this is very clear in the instructions.
I would recommend to just have the Nanit and HA docker in the same config to avoid IP things…
It took me forever to get the rtmp cameras to work in HA. Every time I went to add a generic camera, HA would restart! So I had to add this into my configuration.yaml
file:
camera:
- platform: ffmpeg
name: Nanit Live - First Kid
input: "rtmp://nanit.docker.ip:1935/local/firstkiduid"
extra_arguments: "-pred 1"
- platform: ffmpeg
name: Nanit Live - Second Kid
input: "rtmp://nanit.docker.ip:1935/local/secondkiduid"
extra_arguments: "-pred 1"
- platform: ffmpeg
name: Nanit Live - Third Kid
input: "rtmp://nanit.docker.ip:1935/local/thirdkiduid"
extra_arguments: "-pred 1"
Then I restarted HA container. And added my 3 cameras to a Vertical Stack and Picture Entity Card.
Oops! Just saw this. Merged and published a new release.
Any way we can get an update on how to do this?
like a step by step using your repo?
Has anyone tried running the Docker image on an ARM64 device? On a RPi 3B+ (ARM64) with Docker, I get the error exec format error
when trying to run the init script. I’m wondering if there’s something wrong with my setup, or if there’s something wrong in the image/script.
Option 1: Local by restreaming through RTMP
What does the program/service do?
Basically, regarding what the project does; as the original repo reads:
This is sleepless night induced pet project to restream Nanit Baby Monitor live stream for local viewing.
And:
- Restreaming of live feed to local RTMP server
- […]
- Works as a companion for your Home-assistant / Homebridge setup […]
So, the program asks/sets up the Nanit camera to be the publisher to a new live stream, and enables local devices to subscribe to the new live stream by reading the RTMP stream (for example via VLC, or via HomeAssistant integrations,…).
How do we set it up?
The readme in Indiefan’s home_assistant_nanit repo actually has most of the steps detailed.
So, first you set up Docker on a machine that will do the actual re-streaming. Then, you follow the steps in Indiefan’s repo to run the service and to add the camera to your Home Assistant configuration. The original repo contains more info, such as how to run it through docker-compose instead.
Option 2: Scrypted plugin
I have not tried this route, so I would refer to the following posts to get you started:
P.S.
Is there a way to pin certain posts inside this topic, or change the original question to contain helpful info from answers so far? It’s a shame new visitors need to first go through a lot of posts before being able to get started.
Tobias, the Scripted plugin works a dream! Thank you for that plugin. I wanted to ask if you have had any luck trying to get a Scripted camera feed into Unifi Protect? Now that Unifi allows ONVIF support on third party devices I just need an IP address and login credentials.
I have the IP as I can see on my scripted LOG when I try to adopt the camera in Unifi that the attempt is recorded but it returns an invalid credentials - not sure if there is a way within Scrypted to set a dedicated re-broadcast output IP?
A little new to all this, but we have 9 unifi cameras around the home with multiple multi view screens set-up and would like to get the Nanit Cot camera to be a part of that multi view.
Any suggestions?
I’m trying to run the script myself, did you have to purchase a license? Or, am I just dense?
Sorry for the very late reply, and thanks a lot for your feedback. However, just to understand better, isn’t it what I did? Or am missing something? The IP I set is the one of the docker host (192.168.42.143) not the camera IP. That’s what you mean by Nanit container IP right?
@iamdoubz
Unfortunately HA is running on its own VM and not as a container inside the docker host, so I cannot put them in the same machine
I’m still trying to understand what I did wrong
Thanks again for any support
Anyone figured out if it’s possible to restream the Nanit stream ONVIF compatible? I’d love to use UniFi protect (that allows 3rd party ONVIF cameras)? Reduce the number of apps/hops
In the docker configuration, the IP address you set isn’t supposed to be the IP of the camera, but the actual docker container IP.
For example my nanit camera is 10.0.11.64
My docker container is 10.0.11.210
So in your docker configuration, the NANIT_RTMP_ADDR should be that of your docker container. IE
NANIT_RTMP_ADDR=10.0.11.210:1935
The other thing you might want to do is check to see if you can ping your docker instance from HA.
Hey feels like I’m very close but can’t get over the last hurdle. Have the indiefan/nanit image running alongside HA in docker (compose). Got the token stuff sorted and the nanit container is logging the baby_id on startup. Have updated the HA configuration file to add the below and it’s showing up as an entity. No doubt missing something obvious @indiefan
EDIT: got it working. Changed the IP for NANIT_RTMP_ADDR to the server hosting docker like it says in the readme and like 10 posts on this thread.
camera:
- platform: ffmpeg
name: Nanit Live - First Kid
input: "rtmp://172.19.0.4:1935/local/xxxxx"
extra_arguments: "-pred 1"
nanit:
container_name: nanit
image: 'indiefan/nanit'
environment:
- TZ=Europe/London
- NANIT_RTMP_ADDR=172.19.0.4:1935
- NANIT_LOG_LEVEL=trace
volumes:
- /path/to/data:/data
ports:
- 1935:1935
restart: unless-stopped
nanit | 21 Jan 25 01:12 UTC DBG Received message data="type:REQUEST request:{id:2715 type:PUT_SENSOR_DATA sensorData:{sensorType:HUMIDITY isAlert:false timestamp:3040990 valueMilli:48385 value:48 7:1737421950630}}"
homeassistant | 2025-01-21 01:12:36.211 ERROR (stream_worker) [homeassistant.components.stream.stream.camera.nanit_live_first_kid] Error from stream worker: Error opening stream (ERRORTYPE_111, Connection refused, rtmp://172.19.0.4:1935/local/xxxxx)
This thread has saved me so much time! I’ve done this with my proxmox setup in case anyone is curious. I’ll give a high-level overview of the steps since I did this about 5 minutes ago in one run…
- I assume you’ve set up Home Assistant on proxmox. If not, I can link this, which helped me: [GUIDE] Install Home Assistant OS in a VM | Proxmox Support Forum
- Set up a new VM - I used Ubuntu because I’m familiar with Linux distros already. To learn how you can follow this: How to Create a VM in Proxmox
- Bonus: this allows you to install any Linux distro of your choice.
- Finally, you should have Home Assistant OS running in one VM and Ubuntu running in another VM. Now it’s time to make sure
docker
is installed. You can usesnap install docker
or whatever package manager you have. - Since you’re on Linux, you can run
hostname -I
, giving you the IP address you’re currently using. This is the notoriousNANIT_RTMP_ADDR
IP that everyone seems to trip up on. - Follow the steps from the Github repo by @indiefan – BTW, this does create two total containers if you’re not aware:
- One container for Nanit refresh token
- One container running the Nanit camera stream
That’s it! This whole setup took me around 1 hour from HAOS + Nanit integration. I figured I’d help with proxmox since when I did CTRL+F
I didn’t find much on that setup.
Cheers, and thanks to everyone for their contributions!
Disclaimer: I am a full-time SWE, so please do not get discouraged if this feels frustrating. This thread does have all the information you need.