Streaming an ESP32-CAM

I was following this site to stream from an ESP32-CAM.

everything works, fine I only can not get it to stream it inside my home assistant.

when checking my configuration.yaml, I get following error :

Configuration invalid
Component not found: image
Component not found: tap_action
Component not found: hold_action
Component not found: type

my code :

type: picture
tap_action:
  action: none
hold_action:
  action: none
image: 'http://192.168.0.156/'

added on the bottom of my configuration.yaml

The terms are a little confusing but the code should go into your card configuration instead of the file ‘configuration.yaml’ (see the " Adding ESP32-CAM to Home Assistant" section of the instructions you posted), assuming you’re still in the default UI Mode. If you’re in YAML Mode instead, you’ll need to move the code to the ‘ui-lovelace.yaml’ file.

1 Like

But if I press “configure UI”, I will lose the default UI (letting HA doing the automatic UI)?

1 Like

No, not at all.

Here’s a demo you can play around with to get a better idea of how it works…

1 Like

You’ll only lose the automatic configuration feature if you switch to YAML (a.k.a. advanced) Mode.

The instructions in the article you’re following are a little unclear: Where it says, “If you’re using the configuration file, this is what you need to add.”, it’s referring to the alternate (advanced) method: YAML Mode. You need to do either the previous steps, or the last step.
Also the wording, “configuration file”, is very misleading because the file named configuration (.yaml) is not the file you place the code into. Instead, ui-lovelace.yaml is the correct “configuration file” for adding cards to your dashboard (but again, only if you’re using YAML Mode).

1 Like

Try this:

  • title: Test
    background: radial-gradient(black, skyblue)
    theme: dark-mode
    cards:
    - type: picture
    tap_action:
    action: none
    hold_action:
    action: none
    image: ‘http://192.168.1.251’

Your comments have helped me so much. I was also struggling with this. :slightly_smiling_face:

1 Like

Glad to help, I know how confusing this can be.

I’ve followed all the instruction written in the article ,still can’t see image in HA.
I’ve Home assistant installed in the ‘traditional way’ ,and is updated to the current
version 0.94 (using lovelace).Running on RPI.HA identify presence of IP camera but shows only image small icon. Appreciate any idea of the reason prevents showing camera streaming.

Can you see the video stream in a browser using the camera’s IP address?

Yes. No problem with that. I’ve more 5 cameras connected 3 Foscam and two Amcrest,
working well.

Are you using a picture card with any of your other cameras? If not, you might want to try setting one up that way to have a comparison. Also, if you’re accessing HA securely (https://…) your browser probably won’t display content from an unsecured source (http://…).

Do you have any errors in the HA log?

No. The other cameras being set before switching to lovelace are in the format of
type: picture-entity
entity: camera.front_yard
Neither of the cameras show image if I try to set using picture card.
All are set using http:// .
No error in HA log relates to these devices.

Having the camera configured as an entity in HA is generally the preferable method as it provides more features and flexibility, but it’s a little more difficult to get set up. To configure the ESP32-CAM like your other cameras you’d need to edit the configuration.yaml file and add…

camera:
  - platform: generic
    name: ESP32-cam
    still_image_url: http://192.168.1.91/

…then reboot HA…
…then you should be able to add the new ESP32-cam entity as a picture-entity card…

Or if you want to stick to a simpler method, you could try the iframe card (without adding an entity):

First I appreciated your trying to help.
I did all you wrote but all I can see is the card with camera name and ‘Idle’ on
the right corner . No image.
I can see using Arduino COM monitor that camera is ready but no client request
has arrived ( according to information only one client at a time on this cam webserver)

I wrote two different methods, which one did you try?

The last one

Hi,
I still can’t get picture from the esp32-cam.
To try and eliminate hidden causes for this, I’ve
installed (clean install) of HA on my Ubuntu laptop.
Nothing else is installed on this copy. Still the same results.

At last found my mistake. I’ve used the full code from Arduino example. This little
cheap camera gives really good picture.

@ronw what is the correct code to get a working esp-32 cam in HA? Thanks