mydocker/esphome/sonoff_mini_bedroom.yaml

78 lines
1.4 KiB
YAML

substitutions:
dev_name: "sonoff-mini-bedroom"
friendly_name: "Bedroom Light"
esphome:
name: ${dev_name}
friendly_name: ${friendly_name}
esp8266:
board: esp01_1m
wifi:
# --- KOTWICA MIGRACYJNA ---
# Podaj tutaj nowe IP z sieci IoT (VLAN 20) zarezerwowane na routerze.
use_address: 192.168.20.60
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: "Bedroom Top" # Zachowałem nazwę zbliżoną do oryginału, by nie psuć encji w HA
output: relay_1
restore_mode: RESTORE_DEFAULT_OFF
binary_sensor:
# On-board button (GPIO0)
- platform: gpio
pin: GPIO00
id: reset
internal: true
filters:
- invert:
- delayed_off: 10ms
on_press:
- light.toggle:
id: light_1
# Wall Switch (S1/S2) - Logic: Toggle on every state change
- platform: gpio
name: "Switch Bedroom"
pin: GPIO04
id: switch_1
on_press:
then:
- light.toggle:
id: light_1
on_release:
then:
- light.toggle:
id: light_1