The Unit 4Relay component independently controls four relay outputs over I2C.
| Item | Information |
|---|---|
| Product Name | Unit 4Relay |
| SKU | U097 |
| Main Function | Independent control of four relays |
| Communication Interface | I2C |
| Default I2C Address | 0x26 |
| ESPHome Component | unit4relay (external component) |
| ESPHome Version Requirement | / |
Add the External Components configuration to the YAML file to load the Unit 4Relay component.
external_components:
- source: github://m5stack/esphome-yaml/components
components: [unit4relay]
refresh: 0s Because Unit 4Relay is controlled by an onboard STM32, load the driver through external_components for I2C control.
unit4relay:
switch:
- platform: unit4relay
relay_1:
name: "Relay Channel 1"
restore_mode: RESTORE_DEFAULT_OFF
relay_2:
name: "Relay Channel 2"
restore_mode: RESTORE_DEFAULT_OFF
relay_3:
name: "Relay Channel 3"
restore_mode: RESTORE_DEFAULT_OFF
relay_4:
name: "Relay Channel 4"
restore_mode: RESTORE_DEFAULT_OFF
The default light control is used: when a channel switch is turned on, its corresponding LED lights up.
unit4relay: false (off), plus all other Switch options.false (off), plus all other Switch options.false (off), plus all other Switch options.false (off), plus all other Switch options.After adding the device to the Dashboard, you can control the relays in Home Assistant.