I have 8 Sonoff S31 plugs used for more than a year around the house and they are great.
To flash those I created a the YAML file in ESPHome Addon, with API key, secrets and include common config for all S31:
I got 8 more plugs and want to flash them with ESPHome, but I don’t want to create and store 8 more yaml files on my HA. But rather to be able to adopt them in HA later, when I need them.
Another option is to create a ‘base’ yaml, and include it in each device.
<<: !include esp-base.yaml
In that base I put things like my wifi credentials, ota, webserver, logger, time etc. All generic info I use on all my devices. When included in another yaml, all data from the base will be used in the device.
Only downside; I have one base device in my esphome dashboard that remains offline
Ofc I could move it to some other folder, but I like it like this, because I can edit it from the dashboard
You can create a subfolder under config/esphome and move your esp-base.yaml there and it will not be visible in the ESPHome extension any more. If you check the code I posted originally - it includes a common config for all Sonoff S31 devices: <<: !include common/sonoff-s31.yaml
Regardless - it’s not what I was asking about. Including data shared by all devices is no brainer. It’s more tricky to flash a new device without having to store in the extension its yaml with api key and all specifics unique to each device