mydocker/esphome/sonoff-mini-kitchen-led.yaml

70 lines
1.4 KiB
YAML

esphome:
name: iot-kitchen-led-sonoff-mini
friendly_name: Kitchen LED
esp8266:
board: esp01_1m
wifi:
# --- SRE ANCHOR ---
# Set this to the reserved IP in your MikroTik VLAN 20 pool
use_address: 192.168.20.51 # Keeping .22 suffix for consistency
min_auth_mode: WPA2
networks:
# 1. Primary: IoT Network (VLAN 20)
- ssid: !secret wifi_ssid_iot
password: !secret wifi_pw_iot
# Fallback AP
ap:
ssid: "kitchen-led-fallback"
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: "kitchen.led" # word1.word2 for Siri/STT
output: relay_1
restore_mode: RESTORE_DEFAULT_OFF
binary_sensor:
# Physical button on the Sonoff Mini casing
- platform: gpio
pin: GPIO00
id: button_config
internal: true
filters:
- invert:
- delayed_off: 10ms
on_press:
- light.toggle: light_1
# External Wall Switch (S1/S2)
- platform: gpio
name: "kitchen.led.switch"
pin: GPIO04
id: wall_switch
# Toggle logic for standard rocker switches
on_press:
then:
- light.toggle: light_1
on_release:
then:
- light.toggle: light_1