Description
The problem
After updating to core-2021.7.0 my ESP32 camera feed stopped displaying in my lovelace view.
Looking into the HA logbook, I found the camera entity was continually toggling between available and unavailable.
This ESP32 camera module is running firmware compiled with ESPHome (1.19.4).
The ESP32 board in question also has a a few sensors connected to its GPIO pins as well as some very generic ESPHome sensors (uptime, wifi signal, reboot switch, etc).
I notice that every time HA tries to poll the ESP32 for an image, the HA API disconnects from the device (which causes all the other sensors/switches/entities associated with the ESP32 to briefly toggle offline too).
If I remove the esp32_camera component from the firmware, the HA API remains connected and the entity state of my sensors/switches remains online as expected.
Rolling back to HA 2021.6.6 fixes the issue - the camera feed works and the HA API remains connected with no problem.
What is version of Home Assistant Core has the issue?
core-2021.7.0
What was the last working version of Home Assistant Core?
core-2021.6.6
What type of installation are you running?
Home Assistant OS
Integration causing the issue
ESPHome
Link to integration documentation on our website
https://www.home-assistant.io/integrations/esphome/
Example YAML snippet
Example config components from ESPHome - these are the sensors, camera, etc
sensor:
- platform: wifi_signal
name: ${devname} WiFi Signal
id: ${devname}_wifi_signal
update_interval: 60s
- platform: uptime
name: ${devname} Uptime
id: ${devname}_uptime
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
max_framerate: 1 fps
resolution: SXGA
jpeg_quality: 20
contrast: 2
saturation: 2
name: ${devname} camera
id: ${devname}_camera
switch:
- platform: restart
name: ${devname} Restart
id: ${devname}_restart
Anything in the logs that might be useful for us?
Every 10 seconds when HA polls the ESP32 for an image, the ESP32 logs the following:
[14:26:05][D][esp32_camera:156]: Got Image: len=38209
[14:26:05][D][api:067]: Disconnecting Home Assistant 2021.7.0 (192.168.6.8)
[14:26:06][D][api.connection:630]: Client 'Home Assistant 2021.7.0 (192.168.6.8)' connected successfully!
[14:26:06][D][time:040]: Synchronized time: Thu Jul 8 14:26:06 2021
... and any entities associated with the ESP32 toggle offline in the logbook:
espcam_1 Restart turned off
2:26:06 PM - 17 minutes ago
espcam_1 Restart became unavailable
Additional information
- Rolling back to HA 2021.6.6 resolves the issue
- Commenting out the esp32_camera settings (which obviously stops HA from polling the camera) also makes the HA API stabilise and the remaining sensors/switches work fine.