############################################# # Variable Substitutions # Give the device a useful name & description here # and change values accordingly. ############################################# substitutions: devicename: "esp-entbtproxy" friendly_name: "Outside Entrance Bluetooth Proxy" description_comment: "D1 Mini ESP32 outside entranceway with BT Proxy" #if NOT using a secrets file, just replace these with the passwords etc (in quotes) api_key: !secret esp-entbyproxy_api_key #unfortunately you can't use substitutions in secrets names ota_pass: !secret esp-entbtproxy_ota_pass #unfortunately you can't use substitutions in secrets names wifi_ssid: !secret wifi_ssid wifi_password: !secret wifi_password fallback_ap_password: !secret fallback_ap_password #Add these if we are giving it a static ip, or remove them in the Wifi section #static_ip_address: !secret esp-entmulti_static_ip #static_ip_gateway: !secret esp-entmulti_gateway #static_ip_subnet: !secret esp-entmulti_subnet mqtt_server: !secret mqtt_server mqtt_username: !secret mqtt_username mqtt_password: !secret mqtt_password mqtt_topic: "esphome" #main topic for the mqtt server, call it what you like #web_server_username: !secret web_server_username #web_server_password: !secret web_server_password update_time: 30s #update time for for general temp sensors etc ############################################# # ESPHome # https://esphome.io/components/esphome.html ############################################# esphome: name: ${devicename} friendly_name: ${friendly_name} comment: ${description_comment} #appears on the esphome page in HA min_version: 2024.6.0 # ############################################# # ESP Platform and Framework # https://esphome.io/components/esp32.html ############################################# esp32: board: esp32dev framework: #type: arduino type: esp-idf #Suggested Use ESP-IDF Framework, or Plug Out the UART Cable Might Cause ESP32 Hang. version: recommended #recommended, latest or dev ############################################# # ESPHome Logging Enable # https://esphome.io/components/logger.html ############################################# logger: level: INFO #INFO Level suggested, or DEBUG for testing baud_rate: 0 #set to 0 for no logging via UART, needed if you are using it for other serial things (eg PZEM) #esp8266_store_log_strings_in_flash: false #tx_buffer_size: 64 ############################################# # Enable the Home Assistant API # https://esphome.io/components/api.html ############################################# api: encryption: key: ${api_key} # on_client_connected: # - esp32_ble_tracker.start_scan: # continuous: true # on_client_disconnected: # - esp32_ble_tracker.stop_scan: ############################################# # Enable Over the Air Update Capability # https://esphome.io/components/ota.html?highlight=ota ############################################# ota: - platform: esphome password: ${ota_pass} ############################################# # Safe Mode # Safe mode will detect boot loops # https://esphome.io/components/safe_mode ############################################# safe_mode: ############################################# # Wifi Settings # https://esphome.io/components/wifi.html # # Power Save mode (can reduce wifi reliability) # NONE (least power saving, Default for ESP8266) # LIGHT (Default for ESP32) # HIGH (most power saving) ############################################# wifi: ssid: ${wifi_ssid} password: ${wifi_password} #power_save_mode: LIGHT #https://esphome.io/components/wifi.html#wifi-power-save-mode #manual_ip: #optional static IP address #static_ip: ${static_ip_address} #gateway: ${static_ip_gateway} #subnet: ${static_ip_subnet} ap: #Details for fallback hotspot in case wifi connection fails https://esphome.io/components/wifi.html#access-point-mode ssid: $devicename fallback AP password: !secret fallback_ap_password ap_timeout: 5min #Time until it brings up fallback AP. default is 1min captive_portal: ############################################# # Web Portal for display and monitoring # Turning this off is probably a good idea to save resources. # https://esphome.io/components/web_server.html ############################################# #web_server: # port: 80 # auth: # username: ${web_server_username} #probably a good idea to secure it # password: ${web_server_password} ############################################# # MQTT Monitoring # https://esphome.io/components/mqtt.html?highlight=mqtt # MUST also have api enabled if you enable MQTT ############################################# mqtt: broker: ${mqtt_server} topic_prefix: ${mqtt_topic}/${devicename} username: ${mqtt_username} password: ${mqtt_password} ############################################# # Bluetooth # https://esphome.io/components/bluetooth_proxy.html # https://esphome.io/components/esp32_ble_tracker.html # Remember that this takes a LOT of processing. On the # ESP32, enable the IDF framework, and disable the # Web server component. Changing to the IDF framework # needs to be via cable not OTA to change the # partition setup. ############################################# bluetooth_proxy: active: true esp32_ble_tracker: scan_parameters: # We currently use the defaults to ensure Bluetooth # can co-exist with WiFi In the future we may be able to # enable the built-in coexistence logic in ESP-IDF active: true button: - platform: safe_mode id: button_safe_mode name: Safe Mode Boot - platform: factory_reset id: factory_reset_btn name: Factory reset sensor: ################################ # WIFI SIGNAL # Quality of Wifi in dBm # https://esphome.io/components/sensor/wifi_signal.html ################################ - platform: wifi_signal name: ${friendly_name} WiFi Signal update_interval: 20s #retain: true #retain useful if sleeping - platform: uptime name: ${friendly_name} Uptime update_interval: 10s