English
English
简体中文
日本語
pdf-icon

Unit Step16 Home Assistant Integration

This tutorial will introduce how to use the Unit Step16 16-bit rotary encoder control unit integrated into Home Assistant to achieve knob value and light control.

Preparation

Note

In this tutorial, the firmware is compiled and uploaded using ESPHome 2026.1.2. If you encounter compilation/upload issues, please consider switching ESPHome to this version.

Create Device

  1. Create a new device. Click the green button in the lower-right corner to create the device.
  1. Create device name.
  • Click CONTINUE.
  • Click New Device Setup.
  • Enter the device name and click NEXT.
  1. Select device type.
  • Click ESP32.
  • Click SKIP.
  1. Start editing the YAML file.
  • Click EDIT. We can customize device functions through the YAML file.

Device Configuration

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

External Components Configuration

Add External component:

external_components:
  - source: github://m5stack/esphome-yaml/components
    components: unit_step16
    refresh: 0s

unit_step16:
  id: my_step16
  i2c_id: bsp_iic
  address: 0x48

I2C Configuration

i2c:
  - id: bsp_iic
    scl: GPIO32
    sda: GPIO26
    scan: True

Sensor Configuration

Add Sensor component:

sensor:
  - platform: unit_step16
    unit_step16_id: my_step16
    name: "Encoder Value"
    update_interval: 100ms
    on_value:
      then:
        - logger.log:
            format: "Encoder value changed to: %.0f"
            args: ["x"]

Output Configuration

Add Output component:

output:
  - platform: unit_step16
    id: led_brightness_output
    unit_step16_id: my_step16
    channel: led_brightness

  - platform: unit_step16
    id: rgb_brightness_output
    unit_step16_id: my_step16
    channel: rgb_brightness

  - platform: unit_step16
    id: rgb_red_output
    unit_step16_id: my_step16
    channel: rgb_red

  - platform: unit_step16
    id: rgb_green_output
    unit_step16_id: my_step16
    channel: rgb_green

  - platform: unit_step16
    id: rgb_blue_output
    unit_step16_id: my_step16
    channel: rgb_blue

Light Configuration

Add Light component:

light:
  - platform: rgb
    id: step16_rgb_light
    name: "Step16 RGB Light"
    red: rgb_red_output
    green: rgb_green_output
    blue: rgb_blue_output
    restore_mode: ALWAYS_ON
    default_transition_length: 0s

  - platform: monochromatic
    id: step16_led_display
    name: "Step16 LED Display"
    output: led_brightness_output
    restore_mode: ALWAYS_ON
    default_transition_length: 0s

Number Configuration

Add Number component:

number:
  - platform: template
    name: "RGB Brightness"
    min_value: 0
    max_value: 100
    step: 1
    optimistic: true
    initial_value: 50
    on_value:
      then:
        - output.set_level:
            id: rgb_brightness_output
            level: !lambda "return x / 100.0;"

Download and Flash Firmware

  1. After modification, click SAVE and INSTALL in the top 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).
Note
Click Unit Step16 to view the complete example configuration. The first build may take some time, depending on the performance of the Home Assistant host and network quality.
  1. Connect the device to the host via a USB Type-C cable. Open ESPHome Web and click CONNECT to connect the device.
  1. Find the corresponding serial port number.
  1. Click INSTALL.
  1. Select the previously compiled firmware, then click INSTALL to upload.
  1. Restart the device after the flashing is complete.

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 shows their display effects.

Video

On This Page