Skip to content

How to use Home Assistant Relay 8 Channel

Use Home Assistant Relay 8 Channel, we need to install the ESPhome environment in Python3 and configure HomeAssistant.

1. Install Python3

Go to Python website to dowmload Python3. python Download.png

Click Install after successful download. install python3.png

Click "close" after install successful. close.png

Press "Win+R" and enter "cmd" to open cmd. open cmd.png

Enter "python --version" to check whether python is installed successfully. python version.png

2. Install esphome

Enter "pip install esphome" in cmd to install esphome. pip install esphome.png

If the following log is displayed, upgrade pip as prompted. if.png update pip.png

Enter "esphome version" to check whether esphome is installed successfully. esphome install success.png

3. Register a new ESPHome device

Open Visual Studio Code, select "Terminal->New Terminal" from the menu bar to create a new terminal window. terminal.png

We need to create a test device, and type in the terminal:

esphome wizard test.yaml

The terminal will then display the ESPHome device registration boot, follow the prompts to register. Enter respectively:

  • name: test
  • ESP32/ESP8266/BK72XX/RTL87XX/RP2040: esp32
  • board: esp32dev
  • ssid: You ssid
  • PSK: You password
  • password: press enter(not fill)

Thus, we create a new configuration file. vcok.png

Open the file to modify the code. open file.png

You need to specify the communication API manually.This is a base64-encoded key, which varies from device to device.ESPHome generates a password by default. Base64 keys can be generated using ESPHome's website

# Enable Home Assistant API
api:
  password: ""

You need to change it to:

# Enable Home Assistant API
api:
  encryption:
    key: "2yVJIMxZNj10z/15oKscAIzt630iP3Yky7ck6QeXqIc="

copy the code 8relay.yaml to the end of the file. 8relay copy code.png

Use Type-C USB cable to connect the 8 channel Relay for Home Assistant and PC. Enter the following instructions in the terminal to compile:

esphome run test.yaml

After compiling, it will be prompted to select the download method, here we choose 1 serial port. 1.png

After compilation, you can access Home Assistant at homeassistant:8123

  • select "Configuration-->devices and services" configuration.png

Make sure your computer is connected to the wifi you configured, you will be able to see the new ESPHome device in HA.

  • Click "configuration-->submit".

configuration1.png submit.png

Enter the encryption key of test and click "Finished". enter key.png FINISH.png

Click "ESPhome-->CONFIGURATION-->Submit-->Finish". click esphome.png congiguration test.png option submit.png FINISH.png

4. Result

video_20240201_173020 1.gif

5. FAQ

You can list your question here or contact techsupport@makerfabs.com for technology support. Detailed descriptions of your question will be helped to solve your question.

Q: How should I wire an external device to be added to a relay?

A: You can refer to the following hardware wiring diagram.

8_channel_relay_for_home_assistant4.jpg

6. Resource