Camera generic - Set still_image_url to local file?

Hello. I’ve successfully set up a Yi Camera using the generic platform with a rtsp stream. However, the camera doesn’t provide a still image so I’m thinking about just using a fixed jpg located in my local computer (e.g. /home/hass/img/cam.jpg). Is that possible? If so, how can I set a local file as the still_image_url?

I’ve tried with /home/hass/img/cam.jpg and file:///home/hass/img/cam.jpg with no success

My camera config is just:

camera:
  - platform: generic
    name: yicamera
    still_image_url: [HERE I WANT TO SET A LOCAL FILE]
    stream_source: rtsp://192.168.1.101:554/ch0_0.h264

Thanks for your help!

Put the picture under www then you can use a http url.

in your files in the config folder create a folder called “www” if you havent already. now for still image url just put /local/image.jpg
“local” is the www folder.

Sorry, I forgot to mention that I’m running Home Assistant on a raspberry pi with a virtual environment. I can’t find that “config” folder you mention. Where I should look for it? Thanks again.

It’s the folder where your configuration.yaml and other yaml files are

1 Like

Thanks, it works! Just to wrap everything up for the future if anyone else has the same problem:

  1. Create a folder named www within your config directory, i.e. the directory where your configuration.yaml file is. If you’re running HA on a virtual environment that folder is ~/.homeassistant
  2. Put your image (e.g. camera.jpg) in that www folder
  3. In your configuration.yaml, the still_image_url field should look like this:
camera:
  - platform: generic
    still_image_url: http://127.0.0.1:8123/local/camera.jpg

Thanks to everyone that helped!

4 Likes

what i do because it is simple is i use the Configurator addon so you can access it on other devices.

how can I access the folder through my PC ? is it through filezila ?

Depends on how you installed home assistant (haos, supervised, core or container)

I have core -2022.4.0 installed on raspberry. I can access the folder now and I made a www folder and I put the image there should be like this ?

still_image_url: http://MY_IP:8123/local/camera.jpg