Hi folks,
I am new to ESPHome and could not find anything on these boards. They seem pretty cheap and have a relay and opto-isolated input which is what I wanted. Was tricky for a new guy to work i out so thought I’d post here while it was fresh.
(Schematics and discussion about the board Blynking an IoT Yunshan ESP8266 250V 10A AC/DC WIFI Network Relay Module | µC eXperiment)
Hope this is of use to someone. I also have a 4 relay board that I’ll do a similar post on.
I bought mint (HW-622) here ~$4 AUD : [DC 5V-26V ESP8266 ESP-12F Wireless Wifi Relay Module 220V 10A Relay Module ESP12F 802.11b/g/n 2.4GHz 12V 24V]((DC 5V 26V ESP8266 ESP 12F Wireless Wifi Relay Module 220V 10A Relay Module ESP12F 802.11b/g/n 2.4GHz 12V 24V|Relays| - AliExpress)
To flash from HomeESP use this connection:
and it should appear in ESPHome.
Once it was in ESP Home, I then edited the config for it in ESPHome and reflashed it using this config:
esphome:
name: relaysingle2
esp8266:
board: esp12e
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "83x2bxxxxxxxx87xxxxxx8"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.0.142
gateway: 192.168.0.254
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Relaysingle Fallback Hotspot"
password: "4tVxxxxxxxxtSf"
captive_portal:
# Use the blue LED in the device as a status LED, which will blink if there are warnings (slow) or errors (fast)
status_led:
pin:
number: GPIO2
inverted: True
# One relay outputs, exposed as switches in Home Assistant
switch:
- platform: gpio
pin: GPIO4
name: "relaysingle2_relay"
id: relay1
# One sensor input
binary_sensor:
- platform: gpio
pin:
number: GPIO5
mode:
input: true
pullup: true
name: "relaysingle2_switch"
device_class: door
type or paste code here
Then remove the “boot” jumper and serial cable
Add the device IP to ESPHome (I use fixed IP’s)
Next, for me, I connected the external ground to the ESP ground pin and so could see the sensor input working in Home assistant.