ESPHome Add-On: CLI compile and browser compile don't see each others work
- Dominant language
- No language data
- Stars
- 313
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
### The problem
I use two ways to compile my ESPHome YAML nodes:
1. through the web frontend of the ESPHome add-on for HA and
1. through CLI
**The problem:**
If I switch between both methods the compile goes through all files again. It does not seem to find any existing compile results and repeats all the work which takes a lot of time. I think this is because both methods store their compiled files in different folders.
I tried to compare the output of both compiles and upload runs. Here are the important lines from both versions.
They differ mainly in the leading /data/smoke-eg-flur/ of the web version. But the final "INFO Uploading" line differs only in a leading /data/.
Hint: My node YAML contains `build_path: "smoke-eg-flur"` for these examples.
Output of install OTA through **HA add-on web frontend**:
```
INFO Reading configuration /config/esphome/smoke-eg-flur.yaml...
...
INFO Deleting /data/smoke-eg-flur/.pioenvs
...
Compiling /data/smoke-eg-flur/.pioenvs/smoke-eg-flur/src/esphome/components/adc/adc_sensor.cpp.o
Compiling /data/smoke-eg-flur/.pioenvs/smoke-eg-flur/src/esphome/components/api/api_connection.cpp.o
Compiling /data/smoke-eg-flur/.pioenvs/smoke-eg-flur/src/esphome/components/api/api_frame_helper.cpp.o
...
Linking /data/smoke-eg-flur/.pioenvs/smoke-eg-flur/firmware.elf
RAM: [==== ] 43.2% (used 35420 bytes from 81920 bytes)
Flash: [==== ] 44.7% (used 466485 bytes from 1044464 bytes)
Building /data/smoke-eg-flur/.pioenvs/smoke-eg-flur/firmware.bin
...
esp8266_copy_factory_bin(["/data/smoke-eg-flur/.pioenvs/smoke-eg-flur/firmware.bin"], ["/data/smoke-eg-flur/.pioenvs/smoke-eg-flur/firmware.elf"])
...
INFO Uploading /data/smoke-eg-flur/.pioenvs/smoke-eg-flur/firmware.bin (470640 bytes)
```
Output of compile and upload OTA through **CLI**:
```
INFO Reading configuration smoke-eg-flur.yaml...
...
INFO Deleting smoke-eg-flur/.pioenvs
...
Compiling .pioenvs/smoke-eg-flur/src/esphome/components/adc/adc_sensor.cpp.o
Compiling .pioenvs/smoke-eg-flur/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/smoke-eg-flur/src/esphome/components/api/api_frame_helper.cpp.o
...
Linking .pioenvs/smoke-eg-flur/firmware.elf
RAM: [==== ] 43.2% (used 35420 bytes from 81920 bytes)
Flash: [==== ] 44.7% (used 466485 bytes from 1044464 bytes)
Building .pioenvs/smoke-eg-flur/firmware.bin
...
esp8266_copy_factory_bin([".pioenvs/smoke-eg-flur/firmware.bin"], [".pioenvs/smoke-eg-flur/firmware.elf"])
...
INFO Uploading smoke-eg-flur/.pioenvs/smoke-eg-flur/firmware.bin (470640 bytes)
```
### Which version of ESPHome has the issue?
2022.3.1
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
2022.3.7
### What platform are you using?
ESP8266
### Board
Wemos D1-mini
### Component causing the issue
_No response_
### Example YAML snippet
```yaml
# Doesn't depend on concrete YAML content.
# Might be relevant that I use:
build_path: "smoke-eg-flur"
```
### Anything in the logs that might be useful for us?
_No response_
### Additional information
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing the ESPHome add-on web frontend and CLI compile entry points, using the reported build_path value as the reproduction case. Compare where each method places its .pioenvs and firmware outputs, then verify that switching methods reuses the existing compile results instead of rebuilding all files.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- yaml
- Domain
- build-system, cli, embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100