61 lines
987 B
YAML
61 lines
987 B
YAML
esphome:
|
|
name: distance
|
|
platform: ESP8266
|
|
board: d1_mini
|
|
|
|
# Enable logging
|
|
logger:
|
|
# baud_rate: 0
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
reboot_timeout: 0s
|
|
|
|
ota:
|
|
password: !secret otaPassword
|
|
|
|
wifi:
|
|
networks:
|
|
- ssid: !secret wifi_ssid
|
|
password: !secret wifi_password
|
|
- ssid: !secret wifi_ssid2
|
|
password: !secret wifi_password2
|
|
domain: .lan
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
ap:
|
|
ssid: "D1 Fallback Hotspot"
|
|
password: !secret apPassword
|
|
|
|
web_server:
|
|
port: 80
|
|
|
|
captive_portal:
|
|
|
|
time:
|
|
- platform: sntp
|
|
id: time1
|
|
timezone: Europe/Amsterdam
|
|
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO2
|
|
inverted: True
|
|
|
|
mqtt:
|
|
broker: mqtt.lan
|
|
discovery: true
|
|
|
|
# Distance sensor
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "WiFi Signal Sensor"
|
|
update_interval: 60s #to display WiFi signal strength
|
|
|
|
- platform: ultrasonic
|
|
trigger_pin: D5
|
|
echo_pin: D6
|
|
name: "distance1"
|
|
update_interval: 5s
|
|
|