English
English
简体中文
日本語

Unit CamS3-5MP Home Assistant Integration

This tutorial describes how to integrate the Unit CamS3-5MP camera module with Home Assistant.

1. Preparation

Environment Setup

  1. Install Home Assistant by following the official Home Assistant documentation.
  2. Install the ESPHome Device Builder add-on by following the official ESPHome documentation. (Note: This tutorial is based on ESPHome 2025.12.5. If you encounter compilation errors, switch to this version for verification.)

Hardware

2. Online Flashing

Click the Online Flashing button below and follow the prompts to flash the firmware and configure Wi-Fi. You can then quickly experience Unit CamS3-5MP integration with Home Assistant.

For detailed flashing and configuration steps, refer to the Online ESPHome Firmware Flashing and Configuration Guide.

After completing online flashing, you do not need to perform the "Firmware Compilation & Flashing" steps. Proceed directly to 4. Getting Started.

3. Firmware Compilation & Flashing

This section explains how to recompile the project from the yaml configuration file for secondary development, feature modifications, or adding new features.

Compilation Time
Compiling firmware through HA is resource-intensive. The first compilation may take a long time to download resources, depending on the device running the HA service and network quality.

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.

Modify Configuration

  1. Click EDIT to customize device functions through the YAML file.

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

Compile 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).
Configuration Example
Click Unit CamS3-5MP to view the complete example configuration.

Flash Firmware

  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, and then connect it to a computer or power supply using a USB Type-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 flashing is complete, restart the device.

4. Getting Started

  1. Click Settings > Devices & Services to check the device.
  1. We can find the corresponding device in the Discovered 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.

5. Video

Page Tools
PDF
On This Page