ESP32 Cam - working!

Hello everyone,

I upgraded to 2021.7.1 and my espcam’s still don’t give any image.

Any clue?

They have found the problem and it will be fixed with the next update :smiley:

2 Likes

was it fixed?

Yes, it´s fixed.
After updating my HA to v2021.7.2 I have, again, image from my ESP32 CAM.

2 Likes

yes. Update 2021.7.2 esp32 cam works again I also confirmed.

1 Like

Hi guys Im trying to record with my esp32 cam on motion and then send the short 10 sec video to my telegram. Photos are working just finde but recording gives me the following error:

Error while executing automation automation.telegram_motion_video: camera.esp32_cam does not support record service

This is the action part of my automation:

  action:
    - delay: 00:00:01
    - service: camera.record
      data:
        entity_id: camera.esp32_cam
        filename: /config/www/snapshots/motionvid.mp4
        duration: 10
    - delay:
        hours: 0
        minutes: 0
        seconds: 2
        milliseconds: 0
    - service: notify.telegram_marc
      data:
        title: MotionVid
        message: Motion detected!
        data:
          video:
            - file: /config/www/snapshots/motionvid.mp4
              caption: MotionVideo
    - service: notify.telegram_kathy
      data:
        title: MotionVid
        message: Motion detected!
        data:
          video:
            - file: /config/www/snapshots/motionvid.mp4
              caption: MotionVideo
  mode: single

Is there a other way to record short videos and send it via telegram?

Yes, for me this code works

  - service: notify.telegram
    data:
      message: 'Movement detected'
      title: Movement during the night detected
      target: 4xxxxxxx (Chat ID)
      data:
        video:
        - caption: Suspicious person on the balcony
          file: /config/www/videos/balcony_latest.mp4
1 Like

I think esp32_cam does not support camera.record service.
At least, mine:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:134
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 13:30:25 (1 occurrences)
Last logged: 13:30:25

[2703354632] Error handling message: camera.camara_cam does not support record service
1 Like

Hi, I own esp32 cam with motion sensor.
After it saw movement, you did an automation that sent pictures to the phone. But he’s taking the picture late. Randomly sometimes 1 sec, sometimes 3 sec.

If anyone uses pir sensors, how did you solve the time problem in automation?

so i’ve recently bought a esp32-cam (Ai-Thinker module) , but looking through this thread, its not clear what the best config to push to it for best functionality with HA.
Can anyone point me in the right direction? I’ve tried to use the esp32-cam stuff template from arduino scratchpad but i couldn’t get it working in HA.

thanks

This thread is primarily about esphome. ESP32 Camera Component — ESPHome

Is there a way to save an image (eg: /config/www/photos/esp32_snapshot.jpg) from within the esphome codes, not HA from automation?

I am starting to see this warnings and am wondering what pins you guys are using?

warning:

WARNING 'security_cam': Using the '_' (underscore) character in the hostname is discouraged as it can cause problems with some DHCP and local name services. For more information, see https://esphome.io/guides/faq.html#why-shouldn-t-i-use-underscores-in-my-device-name
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins

my config:

substitutions:
  name: security_cam
  platform: ESP32
  board: esp-wrover-kit # esp32dev

esphome:
  name: $name
  platform: $platform
  board: $board

wifi:
  ssid: !secret ssid_1
  password: !secret ssid_pass
  fast_connect : true
  power_save_mode: none
  manual_ip:
    static_ip: 192.168.1.94
    subnet: 255.255.255.0
    gateway: 192.168.1.1

# Fallback portal 
captive_portal:
# Logging
logger:
# Uncomment this if you use Home Assistant
api:
  password: !secret ota_pass
ota:
  password: !secret ota_pass

# Sensors
sensor:
   - platform: wifi_signal
     name: 'Security Cam WiFi Signal'

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
  name: security
# Image settings
  max_framerate: 1 fps
  resolution: SXGA
  jpeg_quality: 20
  contrast: 2
  saturation: 2

# Flashlight
output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4

light:
  - platform: binary
    output: gpio_4
    name: $name light


Hi there,
Thanks for sharing all theses details regarding ESP32cam.
My module gets quite hot - any possiblity to read out the temperature ot the onboard sensor and make it visible to Home Assistant?
cheers!

What sensor?

Probably not because there is none (anymore)

That function was deprecated long ago, and the temperature sensor is no longer included in the technical manual (since 06/2018). I’d guess the fact that it always returns 128 indicates that it is obsolete.

wow - thanks for your quick answers!
I have got a CAM32-S AI-Thinker Module as door-camera.

I’ve bought it this year - was not aware that this could have been that old…

I’m using the function temprature_sens_read() in order to read out the internal temperature sensor up to now which gives me various temperatures - in my current setup without ESPhome.
This is why I am asking…
but in addition the update rate (fps) is quite slow with ESPhome - so most probably I’ll stay with my current setup.

sad to hear that this has been dropped :frowning:

But thanks for your info!

That’s interesting to hear! Sounds like the esp32-s module still (sometimes? always?) ships with the internal temperature sensor.

Sounds like you have some programming skills? Might be just a few minutes for you to hack a custom sensor together. If it works reliable you might even want to send it upstream so in the end the whole community can enjoy it with the next stable esphome release :tada:

Do you use the camera over api (ha) or the (new) camera web server? First one can also lag because of the home assistant server :warning:

And did you try to tweak your frame settings?

Fixed. To answer my own question, I am using these pins with no yellow warnings in log.

substitutions:
  name: security-cam
  platform: ESP32
  board: esp-wrover-kit # esp32dev

esphome:
  name: $name
  platform: $platform
  board: $board

wifi:
  ssid: !secret ssid_1
  password: !secret ssid_pass
  fast_connect : true
  power_save_mode: none
  manual_ip:
    static_ip: 192.168.1.94
    subnet: 255.255.255.0
    gateway: 192.168.1.1

# Fallback portal 
captive_portal:
# Logging
logger:
# Uncomment this if you use Home Assistant
api:
  password: !secret ota_pass
ota:
  password: !secret ota_pass

# Sensors
sensor:
   - platform: wifi_signal
     name: '$name WiFi Signal'

esp32_camera:
  external_clock:
    pin: GPIO3 
    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
  name: security
# Image settings
  max_framerate: 1 fps
  resolution: SXGA
  jpeg_quality: 20
  contrast: 2
  saturation: 2

# Flashlight
output:
  - platform: gpio
    pin: GPIO12
    id: gpio_12

light:
  - platform: binary
    output: gpio_12
    name: $name light
1 Like

was that in response to me? if so, i’m not sure what you mean? I’m also talking about esphome (was previously trying to do this via the arduino sketch but couldn’t get that working) .

i’m sitting here after adding it to esphome with the code for the correct module and also for the streaming/snapshot aspects. both work (port 8080/8081) but i’ve no clue how to get either of them to show or be usable within HA.
HA reports it has a camera (idle? does that mean it can handle motion detection?) and i’ve tried to add a picture lovelace card accessing the port 8081, but no dice. Also webrtc custom card using the url for 8080 but no stream. I’m obviously doing something wrong, but can’t find much in terms of documentation on how it is supposed to actually integrate.

any pointers?