RPi Zero Camera + Motion + HA -- can't get it to work

I’m trying to add a new RPi Zero Camera to my HA setup. But I can’t get any image to appear in the HA WebUI for the camera.

Here’s my full setup:

HA – Running 0.77 on a RPi. The camera is on a separate RPi Zero and uses motion to pull in the video and analyse it.

Camera.yaml

- platform: mjpeg # camera setup with motioneye
  name: "Pi Zero Camera"
  mjpeg_url: http://IP:8081/
  still_image_url: http://IP:8081/0/snapshot.jpg 
  username: !secret pi_zero_camera_user
  password: !secret pi_zero_camera_pass
  authentication: basic

I’m able to access the cameras stream and snapshot URLs by typing them directly into Chrome. And I have a different camera setup in HA via ffmpeg. Which works and has no issues.

I’ve checked the log and can’t see anything to imply there’s an issue fetching the mjpg stream. However when I try to use the direct token URL for the camera, the one generated by HA, it gives me a 500: Internal Error.

In addition, when I click the picture-thumbnail of the camera in the Lovelace UI, I then see an error in the log saying components/camera/mjpeg.py (ERROR): Timeout getting camera image.