Skip to content

[Bug]: using packages key can/will leave valid config files marked as errant by code analysis #111

@axa88

Description

@axa88

No evidence to suggest this bug is either invalid as a duplicate of #105.
Linking to an already closed bug with no solution other than "i dont know, it works for me" is less than a solution.

Operating System

Windows

ESPHome VSCode Extension Version

2025.7.0

ESPHome Backend

Local ESPHome

ESPHome Version

2025.7.5

What happened?

It appears having a "main" yaml that contains the esphome key, then including additional yaml files using packages key, will issue an error in the code analysis, asking to include the esphome key in the additional yaml.

'esphome' section missing from configuration. Please make sure your configuration has an 'esphome:' line in it.

Image

But if you do so, it will be a compilation error.

Its of course expected that the code is not marked in error.

packages:
  fan_light: !include LivingFanLight.yaml

esphome:
  name: living-rf-bridge
  friendly_name: Living RF Bridge

Then any code in the LivingFanLight.yaml will trigger the errant analysis in package file

Relevant logs or output

Relevant logs or output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions