Secrets File "Component not found"

I’m trying to use the secrets file and included this in my ESPHome yaml configuration

esphome:
  name: water_softener_weight
  platform: ESP8266
  board: d1_mini_pro

<<: !include ../secrets.yaml

mqtt:
  discovery: true
  broker: 192.168.1.42
  port: 1883
  username: !secret mqtt_user

my secrets file includes:

mqtt_user: "mqttuser"

The ESPHome UI contains 5 errors, one for every line in my secrets file with the message shown below where the “component” refers to the variable specified in my secrets file (so clearly it can find the file as it finds all 5 lines in the file). Any ideas why this doesn’t work?

secrets

I don’t see anywhere in the ESPHome docs where it says that you need to include secrets.yaml to use them in your ESPHome config. It looks like you just use them and it knows to look in secrets.yaml in your config directory to resolve them, as with all HA YAML files. Examples are here.

When your on the Esphome device page, click the three dot menu in the upper right of the page, the click secrets editor. This bit go’s in there: <<: !include ../secrets.yaml

And in you device .yaml’s just add:

wifi:
  ssid: !secret wifissid
  password: !secret wifipassword

Now this all assumes that you in fact are using secret.yaml in HA configuration as well.

Thank you @Akriss - that was the missing link!
@rccoleman - See above. It is actually listed on this page but it wasn’t clear to me where to enter that and I thought it was in the esphome.yaml file. Kris clarified it wasn’t.