pdf-icon

Unit INA226 10A/1A Home Assistant Integration

This guide shows how to use the Unit INA226 10A/1A DC measurement unit with an AtomS3R controller and integrate it into Home Assistant to monitor DC voltage, current and power in real time.

1. Preparation

  1. Hardware
  1. Software & versions

2. Create Device

  1. Open ESPHome Dashboard. If the initial wizard appears, click CONTINUE.

  1. Click the green + button in the bottom right to create a new device.

  1. Click New Device Setup to enter the device creation wizard.

  1. Enter a device name and click NEXT.

  1. Select the device type and click ESP32S3.

  1. Click SKIP to skip the encryption key setup.

  1. Click EDIT to open the YAML editor and customize the device configuration.

3. Device Configuration

3.1 I2C bus configuration

Add the I2C component to configure the communication pins between Unit INA226 and AtomS3R.

i2c:
  sda: GPIO2
  scl: GPIO1
  scan: true
Info
PORT.A on AtomS3R corresponds to SDA: GPIO2 and SCL: GPIO1. Adjust pins if you use a different port.

3.2 Sensor configuration

Add the Sensor component to enable INA226 sensor entities.

sensor:
  - platform: ina226
    address: 0x41
    # 10A
    shunt_resistance: 0.08 ohm
    # 1A
    # shunt_resistance: 0.005 ohm
    adc_time:
      voltage: 140us
      current: 332us
    adc_averaging: 4
    update_interval: 2s
    current:
      name: "Current"
      accuracy_decimals: 4
    shunt_voltage:
      name: "Shunt_Voltage"
      accuracy_decimals: 5
    bus_voltage:
      name: "Bus_Voltage"
      accuracy_decimals: 4
    power:
      name: "Power"
      accuracy_decimals: 4

Main parameter descriptions:

Parameter Value Description
address 0x41 I2C address of Unit INA226 10A/1A.
shunt_resistance 0.08 ohm / 0.005 ohm Use 0.08 for 10A and 0.005 for 1A shunt resistor.
adc_time 140us / 332us ADC conversion time; voltage and current can be set separately.
update_interval 2s How often measurements are updated to Home Assistant.
current Current Reports DC current in amperes (A).
shunt_voltage Shunt Voltage Reports shunt voltage in volts (V).
bus_voltage Bus Voltage Reports bus voltage in volts (V).
power Power Reports power in watts (W).

4. Download and Flash Firmware

4.1 Build firmware

  1. After editing the YAML, click SAVE, then click INSTALL.

  1. In the popup select Manual Download.

  1. Wait for compilation to finish, click Download and choose Factory format (Previously Modern) to save the firmware locally.

4.2 Flash firmware

  1. Connect AtomS3R to your computer using a USB Type-C cable. Open ESPHome Web and click CONNECT.

  1. In the serial port selection dialog, select the correct port.

  1. Click INSTALL.

  1. Select the firmware file downloaded in step 3 and start flashing.

Warning
After flashing is complete, you must reset the device; otherwise the firmware may not start correctly.

5. Start Using in Home Assistant

  1. In Home Assistant go to Settings > Devices & Services to open the integrations page.

  1. In the Discovered section find Unit INA226 10A/1A, click CONFIGURE and follow the wizard to complete setup.

  1. After the device is added, the device page will list multiple sensor entities such as Bus_Voltage, Shunt_Voltage, Current and Power with their real-time values.

  1. Finally, add these sensor entities to your dashboard to monitor DC power parameters in real time.

On This Page