Display Motion camera in HA

HI all
Apologies if this has been answered elsewhere, but I can only find references to adding MotioneyeOS cameras, which this question is NOT about (I don’t want to dedicate a whole pi to this task).

I have am running the Motion daemon on a Pi, and have configured it to allow viewing over the local network. I see the stream on the ip:port and there is a frame at the /frame extension. I have tried various configs for generic camera etc with the url http://192.168.1.100:8081/ and http://192.168.1.100:8081/frame but none have worked. Can anyone recommend correct config?
Thanks!

I’ve been wondering the exact same thing. I’ve tried disabling the SSL verification, using the path the 192.168.X.X:8081/stream form with and without trailing slash and tried using MJPEG camera component instead of generic camera, but so far I can’t seem to make it work either.

At least when running without ssl you need to set it to false (default = true). This is what I use with motion:

camera:
  - platform: mjpeg
    name: testcamera
    mjpeg_url: http://192.168.2.122:8081
    verify_ssl: false

I can paste the motion conf also if needed. It is too large to be handled with a phone so left out from this :smile:

2 Likes

Thanks @taikapanu that is the correct config, making a mental note to add that example to the docs. How do you display on lovelace? The pop- out window displays the live feed but the main page shows the following:

Snip20190510_4

Thanks!

@robmarkcole
This is my lovelace.

entity: camera.testcamera
show_state: false
type: picture-entity

I think you have some other problem with displaying the frame. I couldn’t identify any setting in the motion.conf that could affect to this.
Maybe you need to specify “still_image_url” as well?

1 Like

@taikapanu I have read the Motion guide but don’t see any info on the still image url, any ideas?

Now that you mention it I’m not even sure if there is a still image url available :thinking:

Do you have remote control enabled? Maybe that affects this?
http://picam1:8080/0/action/snapshot

@taikapanu I now recall (from my experience with the Hassio addon) that snapshot creates a .jpeg which can be displayed using a file_camera

This works fine on Hassio but is more complicated in my use case as Motion is running on another machine. I think I will need to SCP the file locally using an automation, bit of a hassle

UPDATE: I setup Kerberos.io using a RPi cam and this correctly displays the Kerberos stream on the HA front end, so it must be an issue related to the way Motion does mjpg. One really nice thing about kerberos is that if you configure the image save directory to /var/www/web/public/images then images can be access from the browser at pi_ip/images