pdf-icon

Unit CamS3-5MP Home Assistant Integration

This tutorial guides you on how to connect the Unit CamS3-5MP camera module to Home Assistant.

Preparation

Note

  • This tutorial uses ESPHome 2025.12.5 to compile and upload firmware. If you encounter compilation/upload issues, please consider switching the ESPHome version.

Create Device

  1. Click the green button in the lower-right corner to create the device.
  1. Click CONTINUE.
  1. Click New Device Setup.
  1. Enter the device name, then click NEXT.
  1. Click ESP32-S3.
  1. Click SKIP.
  1. Click EDIT. We can customize device functions through the YAML file.

Modify Configuration

The following is the core part of the code. Related references and instructions are provided below.

PSRAM Configuration

Add PSRAM component:

psram:
  mode: octal
  speed: 80MHz

Switch Configuration

Add Switch component:

switch:
  - platform: gpio
    name: "Active LED"
    pin:
      number: GPIO14
      inverted: true
    restore_mode: ALWAYS_ON

I2C Bus Configuration

Add I2C component:

i2c:
  - id: camera_i2c
    sda: GPIO17
    scl: GPIO41
    scan: true

Camera Configuration

Add ESP32 Camera component:

esp32_camera:
  name: "PY260 camera"
  external_clock:
    pin: GPIO11
    frequency: 20MHz
  i2c_id: camera_i2c
  data_pins: [GPIO6, GPIO15, GPIO16, GPIO7, GPIO5, GPIO10, GPIO4, GPIO13]
  vsync_pin: GPIO42
  href_pin: GPIO18
  pixel_clock_pin: GPIO12
  reset_pin: GPIO21
  resolution: 1024x768
  jpeg_quality: 12

Download and Flash Firmware

  1. After making changes, click SAVE and INSTALL in the upper-right corner, then select Manual Download in the pop-up window.
  1. Once the firmware compilation is complete, click Download and select Factory format(Previously Modern).
Tip
Click Unit CamS3-5MP to view the complete example configuration. The first build may take some time, depending on the performance of the Home Assistant host and the network quality.
  1. Upload the firmware using one of the following two methods:
  • Hardware connection guide: Connect the camera module to the 4-pin cable → plug the other end of the cable into the USB adapter → connect to the computer or power supply using a USB-C data cable → after powering on, the device is ready for firmware flashing or data transmission.
  • Connect the device to the host via a USB Type-C data cable. Open ESPHome Web and click CONNECT to connect to the device.
  1. Locate the corresponding serial port number.
  1. Click INSTALL.
  1. Select the previously compiled firmware to upload.
  1. After the flashing is complete, restart the device.

Quick Start

  1. Click Settings -> Device & services to check the device.
  1. We can find the corresponding device in the Discover section.
  1. After adding the device, the data will be displayed correctly.
  1. Finally, we add these entities to the Dashboard; the following are the display results.

Video

On This Page