Problem- I have not been using packages correctly?
Since 99% of my ESPHome projects use the Wemods D1 Mini development board, I put all of the yaml parts that were common to every board into a package:
Example:
Below that simple header is the yaml unique to this project.
This made my project files very clean. Those seven lines replaced 40 lines that were identical in every one of my projects.
What broke?
I had used packages like a substitution.
Now, packages may not be the only source of blocks, like esphome:
Before 2025.12.7 I could use the package as an include file.
Since there is no “include” in ESPHome, am I stuck with expanding my package content into the main project file?
UPDATE, fixed the platform error but a new one shows up. Next post
Thanks for the tip, but it’s still not working for me.
substitutions:
device_name: server-fan-controller
friendly_name: Server Fan Controller
project_version: "1.0"
my_ssid: !secret iot_ssid
my_pass: !secret iot_password
packages:
- !include common/wemos.yaml
And wemos.yaml:
# ==========================================================
# Wemos Base Package
# Shared configuration for ESP8266 devices
#
# Useage
# substitutions:
# device_name: server-fan-controller
# friendly_name: Server Fan Controller
# project_version: "1.0"
# my_ssid: !secret iot_ssid
# my_pass: !secret iot_password
# packages:
# !include common/wemos.yaml
#
# ==========================================================
esphome:
name: ${device_name}
friendly_name: ${friendly_name}
project:
name: ${device_name}
version: ${project_version}
# Enable API for Home Assistant
# Disable the watchdog timeout
api:
reboot_timeout: 0s
# Logging
logger:
level: DEBUG
# WiFi configuration
wifi:
ssid: ${my_ssid}
password: ${my_pass}
power_save_mode: none
# mDNS
mdns:
disabled: false
# WiFi security
# min_auth_mode:
# WPA2
# OTA updates
ota:
platform: esphome
# Web server
web_server:
port: 80
# ==========================================================
# End of package
# ==========================================================
This gives the following compile error:
esphome: [source /config/esphome/common/wemos.yaml:18]
Platform missing. You must include one of the available platform keys: bk72xx, esp8266, esp32, ln882x, nrf52, libretiny, rp2040, rtl87xx, host.
name: server-fan-controller
friendly_name: Server Fan Controller
project:
name: server-fan-controller
version: 1.0
If I include platform, I get another error that says to remove platform?
esphome: [source /config/esphome/common/wemos.yaml:18]
name: server-fan-controller
friendly_name: Server Fan Controller
Please remove the `platform` key from the [esphome] block and use the correct platform component. This style of configuration has now been removed.
platform: esp8266
project:
name: server-fan-controller
version: 1.0
I have the firmware entity turned off on all but two of my devices. These two are on my desktop and easily accessible if I need to plug in the USB to flash it again. They are my canaries in the coal mine.