Strange question

I have a drawer of ESP boards and a few Arduinos which are programmed using the Arduino IDE. My practice is to start the Serial object then do a Serial.print of the sketch name. This way I can open Termite and determine which sketch was on the board.

As I move more of my projects to ESPHome, I am wondering if there’s something similar in ESPHome?

When you open logging, either serial or online, the log starts

INFO Reading configuration /config/esphome/hallwaylight2.yaml...
INFO Starting log output from 192.168.20.143 using esphome API
INFO Connecting to 192.168.20.143:6053 (192.168.20.143)
INFO Successfully connected to 192.168.20.143
[17:37:30][I][app:105]: ESPHome version 1.20.0-dev compiled on Jun 18 2021, 12:33:56

The first line is unique to the device.

Thanks. I was wondering if there is a way to get the name over a serial port monitor?

Your solution works if the YAML file hasn’t been deleted from the config/esphome folder. I may do some experiments on a breadboard, then decide to archive the project for later experimenting, then delete the code from config/esphome and toss the breadboard into my projects box.

Maybe I just need to organize my project box a bit better.

Why would you delete the yaml?

And I did give you the answer, but you have ignored it.

To delete the clutter.

This assumes that the YAML file is in /config/esphome.

The ESP could be on a breadboard from an experiment months prior and the YAML file is either gone or morphed into a permanent project with a different name.

I guess the answer is to get my breadboard drawer better organized.

I believe what nickrout is referring to is the logger component. By default it outputs the log through the serial port. I assume that any serial port monitor would be able to read the output.

Yes, I discovered that, but it requires the YAML file to be in config/esphome. I do some experiments, and when finished I toss the ESP into my projects drawer and delete the file.

As I said to Nick- I just need a better storage system for my projects that I am not finished with.

Just don’t delete the files. They are tiny anyway. I have heaps of them which I don’t currently have installed on a device, but who cares when they are such small files. You can always move them to a separate folder so they don’t come up in the ESPhome dashboard, then move them back when you want one.

Perfect solution.
There’s now an archive folder in my config/esphome folder for just that purpose.
As a bonus, I think that the archive folder will get backed up with my daily snapshots.

It’s the way you asked the question. You asked to identify the sketch, which can be done by it’s unique identifier seen in the log.

What you were actually asking is, can you download the sketch from a node. That answer is no.

I don’t want to download anything- just identify what is loaded on the device. As I said above, the obvious solution is a more organized storage of project breadboards.

And you can through the logs it will show what components are being loaded

As I said in #7, this requires the YAML file to be in config/esphome.
As I told Nick in #5, I remove the YAML files to reduce the clutter. I don’t need a dozen “testN.YAML” files in my working ESPHome. It’s already cluttered with more than a dozen nodes.

No it doesn’t, you just need to connect it via usb to a computer and listen to the serial port. No yaml no esp home needed.

If you use the stand alone flasher tool, connect the node and choose view logs.

without esphome flasher

I surrender. This works.

1 Like