Missing on_image trigger from ESP32_camera

HI,

I have an ESP32 camera integrated in HA 2024.9.2.
The ESPHome documentation mentions the existence of an on_image automation : ESP32 Camera Component — ESPHome

No way to find it in HA…

Any idea ? Thanks, Bernard.

I think it is for Esphome

Not too sure : the documentation mentions automations which not part of esphome…

I was more thinking about some configuration in the yaml related to the device. Maybe…

Automations are part of esphome, and that documentation refers to esphome.

That is 100% only ESPHome. You can of course call upon HA from the code of that automation in your chip.

Ok thanks.
Can you please elaborate with a concrete usage ?
Or implementation example

What do you want to do when an image is taken?

Launch a post-processing on the image.

Please can you give me some guidelines on how to implement this mechanism ?
Thanks.

You mean processing on device?

I would not advise that.

What I would advise is instead capturing the image on home assistant using the corresponding service call. Then, when you have captured the image in your script or automation, you can then post-process the image using whatever software you want, or you can upload it to a processing server; you can do anything you want.

Either way, if you get the image using the own image event that the camera component provides, you will get a type camera image data that then you can use in C++ to process. Remember that the image data is going to be a JPEG image. It’s not going to be a decoded image with raw RGB data.

https://esphome.io/api/structesphome_1_1esp32__camera_1_1_camera_image_data

I think the fundamental question that we are all asking here is what are you trying to accomplish? “I want to process the image” is too vague to give you a useful answer that was going to give you a solution to your problem.

So you see an entity camera.xxx that esphome created? If so, what are it’s attributes?

Here is what I can see from HA device perspective about my camera :
image

How can I invoke a service/action on ESPhome side to capture an image and receive it back on HA side for post-processing ?

Attributes are found in the states panel of dev tools.