Generic Camera not working


I have a RPi B+ serving a picture from the Pi Cam.
I can access the picture via web browser easily and as expected under the following url:

I have configured the generic ip camera integration as follows:

  - platform: generic
    verify_ssl: false

All I can see in the overview is the name of the camera with the status “idle” next to it. When I click on the camera, a frame with the camera name is shown but nothing else.

If I add a name attribute to the camera, it is not recognized.

What am I doing wrong?




type: picture-entity
entity: light.bed_light

you mean as an action?

If you open the browser console, do you see any errors there? To open the console, in most browsers, just press F12.

Accessing the picture on the web server directly with chromium gives:

Resource interpreted as Document but transferred with MIME type image/jpeg: "".

But that’s all.

Accessing it via HassIO UI gives:

WebSocket connection to 'ws://' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
e @ socket.ts:53
camera.generic_camera:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Any idea?

The websocket error is a bit strange. Is everything else displaying as expected in the UI except for the camera?

And any camera related errors in the HA log in developer tools?

  1. Yes.
  2. No.

This is a bit strange. Maybe you should rule out the possibility that there is something with the image encoding from the PI Cam that HA does not like. You could do this by copying the image to the www folder of your config folder and changing the url of the still image to


I am assuming that your HA url is
If this does not work, there is something wrong with the image encoding.

The picture is shown in the UI when I copy it to local www.
But how can I solve the problem? What would I need to change? Something in the HTTP Response?

I tried a different web server on the RPi with the same result.
Browser shows picture “interpreted as document”.
HassIO cannot access it with the following error in the browser console:

app-header-layout.js:191 GET 500 (Internal Server Error)

The HassIO logs show two errors now:

Connection to tcp:// failed: Operation timed out
10:24:07 PM – components/stream/ (ERROR) - message first occurred at 10:16:37 PM and shows up 3 times

Timeout getting image from: Generic Camera
10:23:58 PM – generic (ERROR) - message first occurred at 10:16:38 PM and shows up 3 times

Any idea how to solve this?

Looks like a route issue. Can you ping the ip from your HA server, i.e. attach to the hassio container and try to ping the ip of the camera server.

1 Like

or just ssh into the hassio server (if you have setup ssh) and try to ping the camera RPI ip.

Thank you!!!

Last week I implemented a new firewall roule and I totally forgot about it.
I put the RPi in the correct subnet and now I have a connection.

I can see the still image as icon.
But when I try to access the stream it keeps loading.

Ok, good! I don’t see that you have configured a stream_source in your camera config.

Now its working. I had to use the mjpeg camera for the stream. Everything is working now.

Thank you!

1 Like