Pi zero camera stream as IP for HA/zoneminder

I am seeking recommendations for the best way to configure a pi zero W with camera for integration with HA via zoneminder. I am running zoneminder in Docker on my Synology, and want to be able to browse captured images on the Synology. My reason being that I want to have a library of images for training an openCV classifier for use with HA.

Specifically I would like to know how to setup the pi to stream images. I’ve read of people setting up motion, and also read this blog which uses v4l2rtspserver and this one which uses Onvif. There also appears to be several alternatives using other protocols.

I’m using motion on a pi zero (non-w but with usb wifi module) and a usb camera (instead of the pi camera) and it works with zoneminder very well. I have seen no issues in zoneminder logs over the last year. Once configured it just works, no complaints from me.

1 Like

I don’t know/use zoneminder, but I use http://elinux.org/RPi-Cam-Web-Interface on several Pi’s (including Zeros with and without onboard Wifi), and its excellent. It has its own built in motion sensing which is less resource hungry than motion (but can optionally use motion).

You can easily set up motion detection to trigger image capture (or timelapse) rather than video, if that is what you need for the training, and its easy to save to different locations. It has various macro triggers that you can use (start motion, end motion) etc, if you want to trigger it to do something else with the image before storing it in your image library etc.

I have’t done it yet, but integration into HA should be trivial.

Bob Tidley is the person currently maintaining it, and he is extremely responsive and helpful on the forums (http://www.raspberrypi.org/forums/viewtopic.php?f=43&t=63276) if you need any additional advice for your particular use case.

Alternatively there is PiKrellCam (https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=115583) which does a lot, including object tracking etc. although I have not really tried it myself.

Hope thats of some help!

1 Like

Thanks @davefi PiKrell is just what I am after. Can display the feed in a panel iframe as below, and copy the saved images after setting up the pi with samba share :slight_smile:

Awesome, glad I could be of some help for a change! :+1:

1 Like

Hi, how did you add PiKrellCam as an iframe?

cameraserv:
  title: Kamera
  icon: mdi:cctv
  url: http://xx.xx.xx.xx:8081

this method does not work :frowning:

Sorry can’t remember now, but it’s possible :slight_smile:

I am on latest HA version (0.92) and I can get pikrellcam displayed on lovelace UI. Snapshot gets refreshed every 10 seconds and if clicked on, you’ll get a pop-up with rtsp stream

configuration.yaml
camera:

  • platform: generic
    name: PiCam
    still_image_url: “http://username:password@<pi_ip_address>:8080/mjpeg_read.php”
    stream_source:: “rtsp://<pi_ip_address>:8555/stream.high”

Lovelace card configuration:
entity: camera.picam
title: Camera
type: picture-entity

1 Like

Updated configuration using mjpeg stream, less than a second latency

  • platform: generic
    name: PiCam
    still_image_url: “http://username:password@<pi_ip_address>:8080/mjpeg_read.php”
    mjpeg_url: “http://username:password@<pi_ip_address>:8080/mjpeg_read.php”