63 lines
931 B
YAML
63 lines
931 B
YAML
esphome:
|
|
name: smart_plug_2
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
networks:
|
|
- ssid: !secret "wifi_ssid"
|
|
password: !secret "wifi_pass"
|
|
- ssid: "Jen B"
|
|
password: "shae1234"
|
|
|
|
ap:
|
|
ssid: "smart_plug_2_fallback"
|
|
password: "Fallback@!"
|
|
|
|
captive_portal:
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
|
|
# mqtt:
|
|
# broker: 192.168.0.30
|
|
# port: 1884
|
|
|
|
ota:
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO13
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "smart_plug_2"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "smart_plug_2_relay"
|
|
pin: GPIO12
|
|
id: relay
|
|
restore_mode: ALWAYS_ON
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO5
|
|
inverted: yes
|
|
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "smart_plug_2 WiFi signal"
|
|
update_interval: 60s
|
|
|
|
- platform: uptime
|
|
name: "Smart_plug_2_uptime" |