Files
devices/standard/wifi.yaml
2026-04-27 13:34:09 +02:00

51 lines
1.2 KiB
YAML

# NOTE: This file is not a stand-alone package. It is part of
# a 'root' device template and expects the substitutions that
# are hereby referenced to be defined by its parent.
substitutions:
# WiFi Substitutions
api_key: !secret api_key
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
ota_password: !secret ota_password
# Enable Home Assistant API
api:
# Disable reboot if no client connected (defaults to 15min)
reboot_timeout: 0s
encryption:
key: "${api_key}"
sensor:
- platform: wifi_signal
name: "RSSI"
id: sensor_rssi
icon: 'mdi:signal'
update_interval: 60s
entity_category: "diagnostic"
# Enable OTA
ota:
- platform: esphome
password: "${ota_password}"
# Enable Safe Mode
safe_mode:
# Enable WiFi and AP for captive portal
wifi:
fast_connect: false
power_save_mode: light
ssid: "${wifi_ssid}"
password: "${wifi_password}"
use_address: "${device_ip}"
# Enable fallback hotspot (captive portal) in case wifi connection fails
# password for hostspot is the same as password for net AP (needs captive_portal)
ap:
ssid: "${device_code}-setup"
password: "${wifi_password}"
ap_timeout: 5min
captive_portal: