06 Dec 2020
Our aim here is to deploy the Motioneye OS to a Raspberry Pi Zero and add the stream into our Home Assistant dashboard.
Download the MotionEye OS image
Burn the image file onto your microSD
Add Wi-Fi configuration
Create a file called wpa_supplicant.conf
in the root folder on the microSD
Add the following configuration
ctrl_interface=/var/run/wpa_supplicant
update_config=1
country=GB
network={
scan_ssid=1
ssid="MyNetwork"
psk="Mypassword"
}
Enable SSH
ssh
in the root folder on the microSDAssemble the Raspberry Pi Zero
First Boot - Be patient, first boot can take a few minutes
Find the device’s IP address
Using your preferred browser navigate to the IP address
That is it, next we can change the default configuration to fit our requirements and add the stream into our Home Assistant.
Once logged in make sure you secure the device using a good admin password from the General Settings tab.
Also make sure you give the camera a static IP address or reserve the address on your DHCP server.
I also configured the time zone and set a hostname to match my other cameras
Other settings I changed include:
Expert Settings
GPU Memory: 304
I looked at the used and available RAM on my RPI Zero using SSH and top and tweaked the values.
Video Device
Text Overlay
Video Streaming
Still Images: Off
Movies: Off
Motion Detection
Working Schedule
Editing your configuration.yml
file you can add the stream service and a camera entity
stream:
camera:
- platform: mjpeg
name: Motioneye
still_image_url: "http://192.168.1.99/picture/1/current/"
mjpeg_url: "http://192.168.1.99:8081"
Save, check configuration and restart your Home Assistant
By default you’ll have a new entity in your ‘Overview’ dashboard because it is automatically controlled but you can add the camera into your own dashboards by using either the picture-entity, picture-glance or picture-elements cards
I decided to turn on the Fast Network Camera option, this uses a different backend which offers better performance but removes features such as motion detection, but in case this was fine as I can make my home assistant instance perform the motion detection.
You can find the Fast Network Camera option within Expert Settings.
I also changed to the Pigeon: An Open source Raspberry PI Zero W Cloud Camera by Geraldoramos which was a dream to print and mount compared to retrofitting the Offical RPI Zero Case, I added my own 3D printed supports as my Raspberry Pi Zero moved a little left and right when connecting power.
The Pigeon case
The added supports
Mounting