Multiple identical devices questions

I’m new to EspHome, but not Arduino, so a bit of a learning curve here. Please forgive me.

Let’s say that I want to build multiple D1 Mini devices for environmental sensors, like a BME-280, in each.

Is it possible to use a single YAML file to flash all of them, using the “name_add_mac_suffix” option, and having each with unique names for the device AP and device name, such as “environment-” + MAC?

I know how to do that in Arduino, just not EH. Like in Arduino, the name isn’t flashed in, but rather “created” at powerup. I don’t need to have a name that’s flashed to show it’s location or anything. I can sort that out in HA itself.

The other thing is the ability to do a mass OTA update on every device of the same type, using the single YAML file. It’s just to make things less complicated. Besides, manufacturers of IOT devices don’t upload firmware for a single device - they do it to all devices of the same hardware build.

1 Like

I just had a look at my yaml files.
I got more but 6 ESP8266 devices with a bme280.
Making intensive use of “!include” files
In the end all differ by 2 lines.
the name and the ip …
But because I want to ensure the name given (used as a prefix for sensors and mqtt topic) makes some sense to me and the ip because I do prefer static ips within a section excluded to be taken by te DHCP server so that get a raw estimation about what type of device it might be.

it might likely work without that, but then you must find a way to divert at a later stage which doesn’t make things easier. Since if something fails you must look at that stage and retranslate until you get the correct device from it’s mac.

First of all you should prevent yourself from code duplication whenever possible, since this causes overhead when improving code and also leads to slightly differnt coding with unexpeced behaviour and endless minutes of digging the cause of the issue.