I am working on a project where my ESP32 CAM needs to automatically capture an image every 10 seconds. The goal is to send these captured images to an AI model for further processing. Manual image capture works fine.
I set up an automation to capture images every 10 seconds using the camera.snapshot
service.
)
I see confirmation in the logs (under “Dogs”) that the images are being captured successfully every 10 seconds.
However,I cannot access these images.
I attempted to save the images to the /www
folder within the File Editor
in Home Assistant, but I cannot see the images in the folder or access them via the URL
esphome:
name: esp32-cam
platform: ESP32
board: esp32dev
Enable logging
logger:
Enable Home Assistant API
api:
reboot_timeout: 0s
ota:
- platform: esphome
web_server:
port: 80
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: “Esp32-Cam Fallback Hotspot”
password: “C3FOhAPFtouw”
captive_portal:
Example configuration entry
esp32_camera:
external_clock:
pin: GPIO0
frequency: 20MHz
i2c_pins:
sda: GPIO26
scl: GPIO27
data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
vsync_pin: GPIO25
href_pin: GPIO23
pixel_clock_pin: GPIO22
power_down_pin: GPIO32
Image settings
name: My ESP32-CAM
Flashlight
output:
- platform: gpio
pin: GPIO4
id: gpio_4
GPIO_4 is the flash light pin
light:
- platform: binary
output: gpio_4
name: flashlight
interval:
- interval: 10s
then:- homeassistant.service:
service: camera.snapshot
data:
entity_id: camera.my_esp32_cam
filename: “/homeassistant/www/capture_{{ now().strftime(‘%Y%m%d%H%M%S’) }}.jpg”
- homeassistant.service: