ESPhome fails to recognize board and kills domain name access

So I’ve been trying to get home assistant to work for days now on my Raspberry Pi4 running debian. Trying to run supervised always needed to overwrite the /etc/network folder which kill all network access. So I’ve been running in the docker container. Managed to get MQTT working so I moved on to esphome. I configured the esp8266 (d1 mini) through the windows command line and the log there shows it did connect to the internet. I went over to HA and attempted the esphome integration.

At this point, 2 things happen: when it attempted to connect the integration I lost all ability to access HA through “xxxx.ddns.net:8123” (although I can still ssh into the pi with the domain) and it failed to recognize the esp device. I’ve tried uploading an unedited yaml output by the wizard, and with additional stuff in it. Esphome on the command line says the config checks out, and it has the api line, but HA still prompts me with “Can’t connect to ESP. Please make sure your YAML file contains an ‘api:’ line.” I attempted a static ip on the esp as suggested in other similar topics I’ve found, but that also did not work. I also turned off wifi power saving as I saw that could cause bad connections as well. I tried different board names as well, which is why the code below says nodemcu. But, none worked.

I’d appreciate anyone explaining how I can fix the one or both problems. I’m losing my mind over here. I really don’t want to run HA as an os because I want to play with some other linux stuff on the pi too. But that’s looking more and more like I need to.

Here is the ESPhome code:

esphome:
  name: attempt
  platform: ESP8266
  board: nodemcu

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  ssid: "ssid"
  password: "password"
  manual_ip:
    static_ip: 10.0.0.42
    gateway: 192.168.1.254
    subnet: 255.255.255.0
  power_save_mode: none   
  # Enable fallback hotspot (captive portal) in case wifi connection fails

This does not check out. The gateway is not in the same subnet as the static IP. You have to select values that actually match your local network.

With regards to your other issue: It’s hard to tell from the information given, but if you decide to run HA in Docker then you will need to work out how you want to set up your network or containers. Docker itself can be configured in various different modes which have their own pros and cons. You can attach containers to the LAN or to private subnets, or simply run them in host mode.
I am running HA in Docker in host mode and that works very well in my particular network and with my particular needs.