mirror of
https://github.com/randybb/esphome-configs.git
synced 2026-01-02 11:37:28 +01:00
have fun
This commit is contained in:
52
mcu-waterproof-socket.yaml
Normal file
52
mcu-waterproof-socket.yaml
Normal file
@@ -0,0 +1,52 @@
|
||||
substitutions:
|
||||
device: waterproof-socket
|
||||
name: Waterproof Socket
|
||||
comment: "Hardened remote controlled socket"
|
||||
|
||||
esphome:
|
||||
name: mcu-${device}
|
||||
comment: ${comment}
|
||||
platform: ESP8266
|
||||
board: esp01_1m
|
||||
|
||||
packages:
|
||||
common: !include common/common.yaml
|
||||
|
||||
# Sonoff Basic R2
|
||||
# GPIO00 - BUTTON
|
||||
# GPIO12 - RELAY
|
||||
# GPIO13 - LED1
|
||||
# GPIO03 - RX PIN
|
||||
# GPIO01 - TX PIN
|
||||
|
||||
binary_sensor:
|
||||
- platform: gpio
|
||||
pin:
|
||||
number: GPIO0
|
||||
mode: INPUT
|
||||
inverted: True
|
||||
name: "${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: "${name} Relay"
|
||||
pin: GPIO12
|
||||
id: relay
|
||||
on_turn_on:
|
||||
- output.turn_on: led
|
||||
on_turn_off:
|
||||
- output.turn_off: led
|
||||
Reference in New Issue
Block a user