ESPHome addon caches yaml depndency from Github

tldr; I’m losing my mind at this point. Can someone point me at folder where addon caches the Github dependencies, please?

I have a Tasmota switch that I wanted to flash with ESPHome
After drafting a default configuration and pushing it to Github I flashed the switch and everything worked perfectly. I was able to adopt the switch into my HA via EPSHome addon

Then I wanted to add two number sensor to configure humidity thresholds from UI
So I modified the YAML, pushed updates to Github and tried to “refresh” the switch I already adopted (assuming that it supposed to dowload the most recent version from Github when I use menu Install in ESPHome addon)
Nothing changed

Then I tried to re-flash it with a binary via Web interface. It worked and I saw the new number sensors on the page after update.

But as soon as I hit Adopt button in HA’s ESPHome addon - the new firmware is being compiled and installed, and it is based on the previous (original version of the yaml from the Github).

Two threshold number sensors dissapeared after adoption, since during adoption ESPHome used the outdated (cached?) version of the yaml from the Github

Feels like ESPHome caches that damned yaml somewhere and I can’t find where.
I already tried cleaning build files - no effect.

My last resort would be renaming the yaml on a github and re-flashing the switch. Hopefully that will break this cycle, since ESPHome addon doesn’t have the new file cached yet.

May be worth asking on Discord - the devs hang out there more than the forums:

Thanks!
Posted my question in # general-support. No replies yet.

If you want to force it to re-download from github, set refresh to 0d.

I don’t recall what the default is, but you can use the refresh parameter to tell it how long to keep the cached package for, or set refresh to 0 days to force it to re-download each time.

packages:
  # Git repo examples
  remote_package:
    url: https://github.com/esphome/non-existant-repo
    ref: main # optional
    files: [file1.yml, file2.yml]
    refresh: 1d # optional
1 Like

I looked at it too. The only problem is that I’m trying to follow Sharing ESPHome devices — ESPHome

So I’m using a YAML that looks like this:

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  name_add_mac_suffix: ${name_add_mac_suffix}
  platform: ESP8266
  board: esp8285
  project:
    name: "xyz.foo-bar"
    version: "1.0"

dashboard_import:
  package_import_url: github://xyz/esphome-configs/foo-bar.yaml

# all sensors defined below

After adoption of the device its yaml looks like this:

substitutions:
  name: foo-bar-12902a
  friendly_name: Foo Bar 12902a
packages:
  xyz.foo-bar: github://xyz/esphome-configs/foo-bar.yaml
esphome:
  name: ${name}
  name_add_mac_suffix: false
  friendly_name: ${friendly_name}
api:
  encryption:
    key: <....>


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

It’s a bit different than remote project and does not support configurable refresh.
Ideally I’d prefer to keep post-adopted YAML as is and just find the way to purge cached github://xyz/esphome-configs/foo-bar.yaml instead of tweaking in manually.

Otherwise I’ll have to do this for every single adoption of devices of that type, which is not user friendly and makes adoption/setup twice slower.

Information from Discord:

By default, single line package imports/adoptions are only re-downloaded once every 24 hours

The adopted single-line package can be replaced with a full schema package with custom refresh period
See Configuration Types — ESPHome

Build files and cached templates are stored in the addon’s folders in docker container.
Those files can be accessed if connected directly via ssh in /mnt/data/supervisor/addons/data/5c53de3b_esphome

1 Like