67 lines
1.4 KiB
YAML
67 lines
1.4 KiB
YAML
esphome:
|
|
name: sonoff-office
|
|
friendly_name: Office Light
|
|
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
# --- KLUCZ DO SUKCESU (KOTWICA) ---
|
|
# To mówi Home Assistantowi: "Nie używaj mDNS, urządzenie na 100% jest tutaj".
|
|
# Upewnij się, że masz rezerwację DHCP na routerze na ten IP!
|
|
use_address: 192.168.20.253
|
|
|
|
min_auth_mode: WPA2
|
|
|
|
networks:
|
|
# 1. Priorytet: Nowa sieć IoT (VLAN 20)
|
|
- ssid: !secret wifi_ssid_iot
|
|
password: !secret wifi_pw_iot
|
|
|
|
# --- USUNIĘTO SEKCJĘ MANUAL_IP ---
|
|
# Dlaczego? Bo sztywne ustawienie 192.168.1.7 uniemożliwi działanie w sieci 192.168.20.x
|
|
# Teraz polegamy na DHCP z routera (MikroTik/UniFi).
|
|
|
|
ap:
|
|
ssid: 'sonoff-office'
|
|
password: !secret fallback_ap_password
|
|
|
|
packages:
|
|
common_core: !include packages/common_core.yaml
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
api:
|
|
# Opcjonalnie: Jeśli masz problemy z kluczami szyfrowania,
|
|
# na czas migracji można to zostawić puste lub dodać encryption key.
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: true
|
|
|
|
output:
|
|
- platform: gpio
|
|
id: relay_1
|
|
pin: GPIO12
|
|
|
|
light:
|
|
- platform: binary
|
|
id: light_1
|
|
name: 'office_light'
|
|
output: relay_1
|
|
restore_mode: RESTORE_DEFAULT_OFF
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
name: 'switch_office_light'
|
|
pin: GPIO04
|
|
id: switch_1
|
|
filters:
|
|
- delayed_on: 50ms
|
|
- delayed_off: 50ms
|
|
on_state:
|
|
then:
|
|
- light.toggle: light_1 |