ESPhome cmd line for different devices

Hi,

I recently posted about esp device programming and thanks to the very helpful replies I managed to use esphome on a windows laptop to configure my device , which is now working very well to control an alarm key fob.

However there now presents a second problem.

How do I use ESPhome cmd line to configure other devices .

I read about a substitution file but that didn’t make sense.

So could anyone please tell me (in easy steps as my brain isn’t as powerful as the esp device) how to do this.

I do have a yaml file I want to use for the new device , which this time is a sunshade (awning) remote control I’d like to control via HA.

Many thanks in advance for any help

Kind regards Andy

You should have a separate YAML file for each device. Then, use the following commands:

esphome compile filename.yaml - Validates and compiles the YAML file.

esphome run filename.yaml - Compile and install <filename.yaml> to an ESP device.

Thank you but how do I tell it which esp device to configure

I’ve only ever run the command with a single device on the network, but I now want to add a second esp board , so not sure how it will disguise which one to setup and I don’t want to trash the one I’ve already got working .

I’m sure it’s easy but I’m a little confused.

Thank you

You give every device individual name, you can’t accidentally upload yaml of device B to device A.

Set a bookmark for this page:

Get familiar with the following commands:
compile - Validates and compiles the YAML
run - Validates, compiles and uploads the YAML
upload - Validates and uploads the most recently compiled binary

Note that run and upload can both take a parameter –device, which indicates which device to send the firmware to.

You can also specify the IP address in the YAML, and leave off the --device parameter. This is what I recommend. Reserve an address for each device in your router’s DHCP settings, and then include it in every ESPHome YAML configuration file. This self-documents everything and avoids any confusion or mistakes later.