73 lines
1.3 KiB
YAML
73 lines
1.3 KiB
YAML
substitutions:
|
|
plug_name: "bathroom-shelly-1l-01"
|
|
|
|
esphome:
|
|
name: ${plug_name}
|
|
friendly_name: "Bathroom light shelly"
|
|
|
|
esp8266:
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
# --- KOTWICA MIGRACYJNA ---
|
|
# Wpisz tu IP, które zarezerwowałeś w nowej sieci IoT (VLAN 20)
|
|
use_address: 192.168.20.17
|
|
|
|
min_auth_mode: WPA2
|
|
|
|
networks:
|
|
- ssid: !secret wifi_ssid_iot
|
|
password: !secret wifi_pw_iot
|
|
|
|
ap:
|
|
ssid: ${plug_name}
|
|
password: !secret fallback_ap_password
|
|
|
|
packages:
|
|
common_core: !include packages/common_core.yaml
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
time:
|
|
platform: homeassistant
|
|
id: homeassistant_time
|
|
|
|
# --- SHELLY 1L HARDWARE ---
|
|
|
|
output:
|
|
- platform: gpio
|
|
pin: GPIO5
|
|
id: shelly_1l_relay
|
|
|
|
light:
|
|
- platform: binary
|
|
name: 'Bathroom Light' # Też zmieniłem na ładniejszą nazwę encji
|
|
output: shelly_1l_relay
|
|
id: bathroom_light
|
|
restore_mode: RESTORE_DEFAULT_OFF
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO4
|
|
name: 'Switch 1'
|
|
on_state:
|
|
then:
|
|
- light.toggle: bathroom_light
|
|
id: switchid1
|
|
filters:
|
|
- delayed_on_off: 100ms
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO14
|
|
name: 'Switch 2'
|
|
|
|
sensor:
|
|
- platform: adc
|
|
pin: GPIO17
|
|
name: 'Voltage'
|
|
update_interval: 60s
|
|
|
|
status_led:
|
|
pin: GPIO0 |