mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-10-14 08:35:12 +02:00
59 lines
1.1 KiB
YAML
59 lines
1.1 KiB
YAML
---
|
|
# Hardware: Sonoff Basic R2
|
|
# Pinout:
|
|
# GPIO0 BUTTON -> Button (binary_sensor gpio) (inverted)
|
|
# GPIO1 TX PIN
|
|
# GPIO3 RX PIN
|
|
# GPIO12 RELAY -> Relay (switch gpio)
|
|
# GPIO13 LED1 -> led (output gpio)
|
|
substitutions:
|
|
device: waterproof-socket
|
|
name: Waterproof Socket
|
|
area: Basement
|
|
comment: Hardened remote controlled socket
|
|
|
|
esphome:
|
|
name: mcu-${device}
|
|
friendly_name: ${name}
|
|
area: ${area}
|
|
comment: ${comment}
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
toolchain: arduino
|
|
|
|
packages:
|
|
common: !include common/common_esp8266.yaml
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT
|
|
inverted: True
|
|
name: Button
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
output:
|
|
- platform: gpio
|
|
pin: GPIO13
|
|
id: led
|
|
inverted: True
|
|
|
|
|
|
# status_led:
|
|
# pin:
|
|
# number: GPIO13
|
|
# inverted: yes
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: Relay
|
|
pin: GPIO12
|
|
id: relay
|
|
on_turn_on:
|
|
- output.turn_on: led
|
|
on_turn_off:
|
|
- output.turn_off: led
|