Connect Home Assistant Container to ESPHome LXC

I have home assistant running in a docker container on Proxmox (setup with the fantastic script from tteck) and ESPHome running in a Proxmox LXC. This works fine and I can upload to devices from the ESPHome dashboard, but Home Assistant is no longer connected to the dashboard as it is on a separate host so device update entities don’t work. How can I reconnect Home Assistant to ESPHome dashboard to fix this. In Home Assistant /config/.storage/esphome.dashboard I set the host to the ESPHome Dashboard host:

{
  "version": 1,
  "minor_version": 1,
  "key": "esphome.dashboard",
  "data": {
    "info": {
      "addon_slug": "5c53de3b_esphome",
      "host": "esphome.lan",
      "port": 63787
    }
  }

But this failed with error: Error requesting ESPHome Dashboard data: Cannot connect to host esphome.lan:63787 ssl:default [Connect call failed ('10.2.1.245', 63787)]

I think you are confused.

If you are running ha in a docker container you can’t run add-ons.

You may want to run HAOS in a VM, which @tteck also has a script for, and which there is a thread about here Installing Home Assistant OS using Proxmox 8

Did you add the ESPHome integration in Home Assistant?

I am not running add ons. I run Home Assistant container in a docker container, in a proxmox LXC, as set up by tteck’s Home Assistant Container LXC script. ESPHome runs in a separate proxmox LXC and so is a separate “host” from the home assistant LXC:

Screenshot 2024-02-28 at 7.11.45 pm

It has no connection whatsoever to home assistant other than running on the same Proxmox hardware. And that is exactly my problem, linking home assistant back up to ESPHome so that HA can request firmware builds from ESPHome to update my devices and fix the broken update entities:

I need to tell Home Assistant where to find the ESPHome LXC on my network as it no longer runs on the same host as HA so 127.0.0.1:63787 will not work.

I have an ESPHome integration for each of my ESPHome devices. This links home assistant with the ESPHome device, but not to the ESPHome dashboard which runs separately. Without this connection, Home Assistant cannot request updates from the ESPHome dashboard when I trigger an update from the ESPHome devices update entities.

Why do you refer to addon_slug": "5c53de3b_esphome

This is the configuration from when I previously run ESPHome as an add-on within Home Assistant OS Proxmox VM. Since I move to container I don’t know what this should be.

Did you figure this? Im having the same issue.

What issue? Trying to run an addon on a container install? Not gonna work.

I migrated from bare metal HAOS to running in HAOS on a VM (as apposed to a LXC as OP above) in proxmox. After that my ESPHome add-on would not recognise new devices on the network automatically. So to test this, i spun up a ESPHome LXC which recognised the devices on my network. Something todo with mDNS networking via the add-on running on proxmox HAOS?

Anyway i figured that running ESPHome as an LXC is just as fine, but HAOS does not get the ESPHome updates reported to it.

Many people complain of too many update reports, so it may be a blessing.

1 Like

:crazy_face:

Hi, I was able to get the ESPHome Dashboard data error to disappear by either removing or updating the /config/.storage/esphome.dashboard file. So mine currently looks like this:

{
  "version": 1,
  "minor_version": 1,
  "key": "esphome.dashboard",
  "data": {
    "info": {
      "addon_slug": "",
      "host": "10.1.1.246",
      "port": 6052
    }
  }
}

However I have no idea what will happen :smiley:

An update on this from the ESPHome discord:

Yes, an easy fix, I was using the wrong port. As soon as I changed the port to 6052, which is what I connect to the ESPHome Dashboard Web UI with, all the update entities came through on home assistant.

/homeassistant/.storage/esphome.dashboard should look like:

{
  "version": 1,
  "minor_version": 1,
  "key": "esphome.dashboard",
  "data": {
    "info": {
      "addon_slug": "5c53de3b_esphome",
      "host": "esphome.lan",
      "port": 6052
    }
  }
}

Just change the host to match your deployment and set the port to the default 6052 as long as you haven’t changed it.

Yep - all I did differently was to blank the add on slug. I guess I will see if it works the same as yours once we get an update next month.