In case anyone struggles with the ESP-01 based relays like I did, here’s the configuration I found to be successful.
Here’s the item:
First, if you have a problem flashing these, check out my other post about that:
Flashing ESP-01 - Permission Error 13
I decided to post this final form as I feel like even though there’s a lot of information out there, for me it was very hard to find since I didn’t know what to look for (i.e. baud rate).
Here’s the working configuration:
esphome:
name: boiler
platform: ESP8266
board: esp01_1m
wifi:
ssid: "xxxxx"
password: "xxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "xxxxx"
password: "xxxxx"
captive_portal:
# Enable logging
logger:
hardware_uart: UART1
# Enable Home Assistant API
api:
password: "password"
ota:
password: "password"
web_server:
port: 80
uart:
baud_rate: 9600
tx_pin: GPIO1
rx_pin: GPIO3
switch:
- platform: gpio
name: "Boiler relay"
id: "relay"
pin: GPIO4 # using ESP module LED
inverted: false
on_turn_on:
- uart.write: [0x0a0, 0x01, 0x01,0x0a2]
on_turn_off:
- uart.write: [0x0a0, 0x01, 0x00,0x0a1]