mydocker/esphome/sonoff_mini_stefi.yaml

74 lines
1.4 KiB
YAML

esphome:
name: sonoff-mini-stefi
friendly_name: Stefi Light
esp8266:
board: esp01_1m
wifi:
# --- KOTWICA ---
# To mówi Home Assistantowi, gdzie szukać urządzenia po zmianie sieci.
# WAŻNE: Upewnij się, że w routerze ustawiłeś Static Lease dla tego urządzenia na ten IP!
use_address: 192.168.20.14
min_auth_mode: WPA2
networks:
# 1. Priorytet: Nowa sieć IoT
- ssid: !secret wifi_ssid_iot
password: !secret wifi_pw_iot
# Sekcja manual_ip USUNIĘTA - polegamy na DHCP
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: 'sff-mni-stef'
password: !secret fallback_ap_password
packages:
common_core: !include packages/common_core.yaml
web_server:
port: 80
status_led:
pin:
number: GPIO13
inverted: true
output:
- platform: gpio
id: relay_1
pin: GPIO12
light:
- platform: binary
id: light_1
name: 'Stefi top'
output: relay_1
binary_sensor:
- platform: gpio
pin: GPIO00
id: reset
internal: true
filters:
- invert:
- delayed_off: 10ms
on_press:
- light.toggle:
id: light_1
- platform: gpio
name: 'Switch Stefi'
pin: GPIO04
id: switch_1
on_press:
then:
- light.toggle:
id: light_1
on_release:
then:
- light.toggle:
id: light_1