79 lines
1.4 KiB
YAML
79 lines
1.4 KiB
YAML
substitutions:
|
|
dev_name: "sonoff-mini-hall"
|
|
friendly_name: "Hall Top Light"
|
|
|
|
esphome:
|
|
name: ${dev_name}
|
|
friendly_name: ${friendly_name}
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
# --- MIGRATION ANCHOR ---
|
|
# Enter the new reserved IP from your IoT network (VLAN 20) here.
|
|
use_address: 192.168.20.62
|
|
|
|
min_auth_mode: WPA2
|
|
|
|
networks:
|
|
- ssid: !secret wifi_ssid_iot
|
|
password: !secret wifi_pw_iot
|
|
|
|
# Fallback AP
|
|
ap:
|
|
ssid: ${dev_name}
|
|
password: !secret fallback_ap_password
|
|
|
|
packages:
|
|
common_core: !include packages/common_core.yaml
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
# --- HARDWARE CONFIGURATION (SONOFF MINI) ---
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: true
|
|
|
|
output:
|
|
- platform: gpio
|
|
id: relay_1
|
|
pin: GPIO12
|
|
|
|
light:
|
|
- platform: binary
|
|
id: light_1
|
|
name: "Hall Top"
|
|
output: relay_1
|
|
restore_mode: RESTORE_DEFAULT_OFF
|
|
|
|
binary_sensor:
|
|
# On-board button
|
|
- platform: gpio
|
|
pin: GPIO00
|
|
id: reset
|
|
internal: true
|
|
filters:
|
|
- invert:
|
|
- delayed_off: 10ms
|
|
on_press:
|
|
- light.toggle:
|
|
id: light_1
|
|
|
|
# Wall Switch (S1/S2)
|
|
- platform: gpio
|
|
name: "Switch Hall"
|
|
pin: GPIO04
|
|
id: switch_1
|
|
# Logic: Toggle light on ANY change of the physical switch
|
|
on_press:
|
|
then:
|
|
- light.toggle:
|
|
id: light_1
|
|
on_release:
|
|
then:
|
|
- light.toggle:
|
|
id: light_1 |