72 lines
1.5 KiB
YAML
72 lines
1.5 KiB
YAML
esphome:
|
|
name: dining-light
|
|
friendly_name: Dining Light
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
# --- SRE ANCHOR ---
|
|
# Zarezerwuj ten adres w MikroTiku (IP -> DHCP Server -> Leases -> Make Static)
|
|
use_address: 192.168.20.46 # <--- Wpisz docelowe IP w VLAN 20
|
|
|
|
min_auth_mode: WPA2
|
|
|
|
networks:
|
|
# 1. Priorytet: Nowa sieć IoT (VLAN 20)
|
|
- ssid: !secret wifi_ssid_iot
|
|
password: !secret wifi_pw_iot
|
|
|
|
# Usunięto manual_ip - polegamy na DHCP + use_address
|
|
|
|
ap:
|
|
ssid: "dining-light-fallback"
|
|
password: "guilermo3"
|
|
|
|
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: GPIO15 # Zostawiam zgodnie z Twoim oryginałem
|
|
|
|
light:
|
|
- platform: binary
|
|
id: light_1
|
|
name: "dining.light" # Format word1.word2 dla integracji
|
|
output: relay_1
|
|
restore_mode: RESTORE_DEFAULT_OFF
|
|
|
|
binary_sensor:
|
|
# Przycisk fizyczny na obudowie (Reset/Toggle)
|
|
- platform: gpio
|
|
pin: GPIO00
|
|
id: button_internal
|
|
internal: true
|
|
filters:
|
|
- invert:
|
|
- delayed_off: 10ms
|
|
on_press:
|
|
- light.toggle: light_1
|
|
|
|
# Przełącznik ścienny (S1/S2)
|
|
- platform: gpio
|
|
name: "dining.light.switch"
|
|
pin: GPIO04
|
|
id: switch_wall
|
|
# Obsługa przełącznika bistabilnego (kołyskowego)
|
|
on_press:
|
|
then:
|
|
- light.toggle: light_1
|
|
on_release:
|
|
then:
|
|
- light.toggle: light_1 |