|

8 Relays Expander. ESPHome/Home Assistant firmware Guide.

Guide for hardware connection for 8 Relays expansion.

The 8 Relays Expansion module is based on IC PCF8574. ESPHome component allows you to use PCF8574 or PCF8575 I/O expanders. It uses I²C Bus for communication.

Once configured, you can use any of the 8 relays for your projects.

YAML
# Example configuration entry
pcf8574:
  - id: 'pcf8574_hub_1'
    address: 0x21

# Relays outputs
switch:
  - platform: gpio
    name: "ESP32R4 EXP#1"
    pin:
      pcf8574: pcf8574_hub_1
      number: 0
      mode:
      output: true
      inverted: false
  - platform: gpio
    name: "ESP32R4 EXP#2"
    pin:
      pcf8574: pcf8574_hub_1
      number: 1
      mode:
      output: true
      inverted: false
  - platform: gpio
    name: "ESP32R4 EXP#3"
    pin:
      pcf8574: pcf8574_hub_1
      number: 2
      mode:
      output: true
      inverted: false	  
  - platform: gpio
    name: "ESP32R4 EXP#4"
    pin:
      pcf8574: pcf8574_hub_1
      number: 3
      mode:
      output: true
      inverted: false	  
  - platform: gpio
    name: "ESP32R4 EXP#5"
    pin:
      pcf8574: pcf8574_hub_1
      number: 4
      mode:
      output: true
      inverted: false
  - platform: gpio
    name: "ESP32R4 EXP#6"
    pin:
      pcf8574: pcf8574_hub_1
      number: 5
      mode:
      output: true
      inverted: false	  
  - platform: gpio
    name: "ESP32R4 EXP#7"
    pin:
      pcf8574: pcf8574_hub_1
      number: 6
      mode:
      output: true
      inverted: false	  	  
  - platform: gpio
    name: "ESP32R4 EXP#7"
    pin:
      pcf8574: pcf8574_hub_1
      number: 6
      mode:
      output: true
      inverted: false	 
   - platform: gpio
    name: "ESP32R4 EXP#8"
    pin:
      pcf8574: pcf8574_hub_1
      number: 7
      mode:
      output: true
      inverted: false  	  

Configuration variables:

  • id (RequiredID): The id to use for this PCF8574 component.
  • address (Optional, int): The I²C address of the driver. Defaults to 0x21.

Pin configuration variables:

  • pcf8574 (RequiredID): The id of the PCF8574 component of the pin.
  • number (Required, int): The pin number connected to the relay. Pin numbers start from 0.
  • inverted (Optional, boolean): If all read and written values should be treated as inverted. Defaults to false.
  • mode (Optional, string): A pin mode to set for the pin at. One of INPUT or OUTPUT. Must be OUTPUT

Similar Posts