Skip to content

Instantly share code, notes, and snippets.

@vladyspavlov
Last active August 29, 2024 10:56
Show Gist options
  • Save vladyspavlov/08595cece2968f9e3f9e666c620323e0 to your computer and use it in GitHub Desktop.
Save vladyspavlov/08595cece2968f9e3f9e666c620323e0 to your computer and use it in GitHub Desktop.
ESPHome configuration for 1-channel ESP32 relay from AliExpress with a 90-250VAC power supply. SZHJW ESP32_Relay_AC X1_V1.1 (303E32AC111)
# https://www.aliexpress.com/item/1005005848983315.html
# Pinout:
# GPIO0 - Button
# GPIO16 - Relay
# GPIO23 - LED
# ESP: ESP32-WROOM-32E (ESP32-D0WD V3, rev. 3.1)
substitutions:
name: 1ch-relay
friendly_name: 1CH Relay
description: ESP32-D0WD V3, Bluetooth Proxy
ota_password: !secret 1ch_relay_ota_password
api_key: !secret 1ch_relay_api_key
esphome:
name: ${name}
friendly_name: ${friendly_name}
comment: ${description}
project:
name: "SZHJW.ESP32_Relay_AC"
version: "1.1"
esp32:
board: esp32dev
framework:
type: esp-idf
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: "${friendly_name} Hotspot"
password: !secret wifi_ap_password
api:
encryption:
key: ${api_key}
reboot_timeout: 30min
captive_portal:
logger:
baud_rate: 0
ota:
password: ${ota_password}
button:
- platform: restart
id: button_restart
name: "Restart"
output:
- platform: gpio
pin: GPIO16
id: relay1
switch:
- platform: output
name: None
output: relay1
id: switch1
status_led:
pin:
number: GPIO23
inverted: true
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: true
name: Button
on_press:
- switch.toggle: switch1
# Optional
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment