ESPHOME ip and wifi and secret change. Debug not reflecting new ip - device sensors broke, logs work

High level: Existing esp device working for a year. I changed the secrets file because I added a new wifi and I also changed the ip address in the esp device config.

  • Nothing seems to work anymore inside of Home Assistant when it comes to communicating with the device (sort of)
  • Esphome Builder sees the device fine
  • From Esphome Builder, clicking the device(s), “logs”, then “wirelessly” works just fine and the output is fine as well.
  • And YES I have hard cold rebooted the entire server

Secrets file:

# Your Wi-Fi SSID and password
wifi_ssid: "Portal Of Infinite Distractions"
wifi_password: "I mean come on, I am not going to put the real one here"

v20internal: "v20internal"
v20internal_password: "I mean come on, I am not going to put the real one here"

Original Yaml:

esphome:
  name: office-d1minilite
  friendly_name: office-d1minilite

esp8266:
  board: d1_mini_lite

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "gdt2gNJBax9OA9/VTfNqbTpWcSkMgfhRtq7VPYdnTxo="

ota:
  - platform: esphome
    password: "a6a620718d6dc44e406e9d4165589b1b"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
   static_ip: 192.168.10.133
   subnet: 255.255.255.0
   gateway: 192.168.10.1
   dns1: 192.168.10.1
  
# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Office-D1Minilite"
    password: "pM1C4RPM3EwC"

captive_portal:

# DHT22 Temp sensor
sensor:
- platform: dht
  pin: D7
  model: DHT22
  temperature:
   name: "Office Temp"
  humidity:
   name: "Office RH"
   accuracy_decimals: 1

New Yaml:

esphome:
  name: office-d1minilite
  friendly_name: office-d1minilite

esp8266:
  board: d1_mini_lite

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "gdt2gNJBax9OA9/VTfNqbTpWcSkMgfhRtq7VPYdnTxo="

ota:
  - platform: esphome
    password: "a6a620718d6dc44e406e9d4165589b1b"

wifi:
  ssid: !secret v20internal
  password: !secret v20internal_password
  manual_ip:
   static_ip: 192.168.20.30
   subnet: 255.255.255.0
   gateway: 192.168.20.1
   dns1: 192.168.20.1
  
# Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Office-D1Minilite"
    password: "pM1C4RPM3EwC"

captive_portal:

# DHT22 Temp sensor
sensor:
- platform: dht
  pin: D7
  model: DHT22
  temperature:
   name: "Office Temp"
  humidity:
   name: "Office RH"
   accuracy_decimals: 1

When I went to the device and clicked “download diagnostics” I noticed it still retains the old ip…HUH?
config_entry-esphome-d77de10257f8e28d80db2380a9be01ec.txt

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2025.4.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.13.2",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/New_York",
    "os_name": "Linux",
    "os_version": "6.12.23-haos",
    "supervisor": "2025.04.0",
    "host_os": "Home Assistant OS 15.2",
    "docker_version": "28.0.4",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "thermal_comfort": {
      "documentation": "https://github.com/dolezsa/thermal_comfort/blob/d7a81bbcd38110742124d46e7c0d2a7e5d011831/README.md",
      "version": "2.2.2",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "esphome",
    "name": "ESPHome",
    "after_dependencies": [
      "zeroconf",
      "tag"
    ],
    "codeowners": [
      "OttoWinter",
      "jesserockz",
      "kbx81",
      "bdraco"
    ],
    "config_flow": true,
    "dependencies": [
      "assist_pipeline",
      "bluetooth",
      "intent",
      "ffmpeg",
      "http"
    ],
    "dhcp": [
      {
        "registered_devices": true
      }
    ],
    "documentation": "https://www.home-assistant.io/integrations/esphome",
    "integration_type": "device",
    "iot_class": "local_push",
    "loggers": [
      "aioesphomeapi",
      "noiseprotocol",
      "bleak_esphome"
    ],
    "mqtt": [
      "esphome/discover/#"
    ],
    "requirements": [
      "aioesphomeapi==29.9.0",
      "esphome-dashboard-api==1.2.3",
      "bleak-esphome==2.12.0"
    ],
    "zeroconf": [
      "_esphomelib._tcp.local."
    ],
    "is_built_in": true,
    "overwrites_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 0.008488419999999053
    },
    "e3819bc71d5a06c0e4c2f295d7672564": {
      "wait_import_platforms": -0.16798100999999832,
      "config_entry_setup": 0.17299937700000356
    },
    "2ffaed7ed987f3458c72ae170545f44c": {
      "wait_import_platforms": -0.16850696000000198,
      "config_entry_setup": 0.17475125400000024
    },
    "d77de10257f8e28d80db2380a9be01ec": {
      "wait_import_platforms": -0.16970431200000036,
      "config_entry_setup": 0.1757452099999952
    },
    "01JBSK39HMD13CXYWMB902Q4W3": {
      "wait_import_platforms": -0.1748421849999957,
      "config_entry_setup": 0.1814305549999986
    }
  },
  "data": {
    "config": {
      "created_at": "1970-01-01T00:00:00+00:00",
      "data": {
        "device_name": "office-d1minilite",
        "host": "192.168.10.133",
        "noise_psk": "**REDACTED**",
        "password": "",
        "port": 6053
      },
      "discovery_keys": {
        "dhcp": [
          {
            "__type": "<class 'homeassistant.helpers.discovery_flow.DiscoveryKey'>",
            "repr": "DiscoveryKey(domain='dhcp', key='bcff4dcf4a3c', version=1)"
          }
        ],
        "zeroconf": [
          {
            "__type": "<class 'homeassistant.helpers.discovery_flow.DiscoveryKey'>",
            "repr": "DiscoveryKey(domain='zeroconf', key=('_esphomelib._tcp.local.', 'office-d1minilite._esphomelib._tcp.local.'), version=1)"
          }
        ]
      },
      "disabled_by": null,
      "domain": "esphome",
      "entry_id": "d77de10257f8e28d80db2380a9be01ec",
      "minor_version": 1,
      "modified_at": "2024-10-02T21:26:18.796906+00:00",
      "options": {
        "allow_service_calls": false
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "zeroconf",
      "subentries": [],
      "title": "office-d1minilite",
      "unique_id": "bc:ff:4d:cf:4a:3c",
      "version": 1
    },
    "storage_data": {
      "device_info": {
        "uses_password": false,
        "name": "office-d1minilite",
        "friendly_name": "office-d1minilite",
        "mac_address": "**REDACTED**",
        "compilation_time": "Apr 17 2025, 16:03:51",
        "model": "d1_mini_lite",
        "manufacturer": "Espressif",
        "has_deep_sleep": false,
        "esphome_version": "2025.4.0",
        "project_name": "",
        "project_version": "",
        "webserver_port": 0,
        "legacy_voice_assistant_version": 0,
        "voice_assistant_feature_flags": 0,
        "legacy_bluetooth_proxy_version": 0,
        "bluetooth_proxy_feature_flags": 0,
        "suggested_area": "",
        "bluetooth_mac_address": ""
      },
      "services": [],
      "api_version": {
        "major": 1,
        "minor": 10
      },
      "update": [],
      "sensor": [
        {
          "object_id": "office_temp",
          "key": 1799074950,
          "name": "Office Temp",
          "unique_id": "office-d1minilitesensoroffice_temp",
          "disabled_by_default": false,
          "icon": "",
          "entity_category": 0,
          "device_class": "temperature",
          "unit_of_measurement": "\u00b0C",
          "accuracy_decimals": 1,
          "force_update": false,
          "state_class": 1,
          "last_reset_type": 0
        },
        {
          "object_id": "office_rh",
          "key": 1845501434,
          "name": "Office RH",
          "unique_id": "office-d1minilitesensoroffice_rh",
          "disabled_by_default": false,
          "icon": "",
          "entity_category": 0,
          "device_class": "humidity",
          "unit_of_measurement": "%",
          "accuracy_decimals": 1,
          "force_update": false,
          "state_class": 1,
          "last_reset_type": 0
        }
      ],
      "text_sensor": []
    },
    "dashboard": "5c53de3b_esphome"
  }
}


Try selecting clean build from the 3 dots in bottom right corner in esphome
If that don’t work

  use_address: old IP address i.e. 192.168......

you can remove the use address from esphome yaml after you get it working on new address

As @spiro stated, use_address. Your revised yaml uses ip .30 and that is where the ota update will be sent. Problem is your 1st yaml used ip .133 and that is what the device will be using. The use_address option specifies where to send via ota update but on boot the device will use the static_ip.

I think I did a craptastic job of explaining. There is nothing wrong with communication to the device on the new ip of 192.168.20.30, I can read logs wirelessly, push updates wirelessly, etc etc. For whatever reason, all the sensors and the entity fail to “see it” Either way I tried both suggestions.

  • Clean build files / install…did nothing for the issue.
  • Using “use_address: 192.168.10.133” …did nothing for the issue.
  • Using “use_address: 192.168.20.30” …did nothing for the issue.

Did you remove and re-add device in HA? (no history will be lost if sensor’s names remain the same).

Wow this has rapidly turned into a nightmare. So I went into esphome builder, simply clicked “delete” on this device and now after powering off and on the HA server and the device (yes multiple times) nothing gets discovered. It gets worse…thankfully I saved the bin install file so I tried to manually (by usb wire) install the bin file through esphome builder and it’s saying nothing is connected even though it’s clearly on com6. OOOOO K went the brute force method with this d1 mini lite and simply used the exe file “ESPHome-Flasher-1.4.0-Windows-x64” guess what…same issue! The internet said the ch340/341 driver is corrupt (no, no it’s not) but for giggles I uninstalled the driver and reinstalled a fresh copy from the OEM China site, same results. Also the same results on a completely different computer. I even tried shorting gpio 0 to gnd just in case of a bootloader issue…nope

I have several of these units all around the house, no issues for years with HA
device D1 Mini Lite specs

Not sure what’s going on here with Home Assistant / ESPHOME…maybe recent updates? However, I plugged in the d1 mini lite with the same usb cable, spun up the arduino ide and uploaded the blink sketch just fine. serial monitor works as expected, bootloader is fine, etc etc. Yet close down the arduino ide and use ANYTHING through ESPHOME (web browser, exe file) nothing works anymore.

If you delete a device in ESPHome builder then you only have deleted your yaml file, which is the base file for the compilation process to create the firmware and I don’t think that was your intention. Hopefully you can restore the yaml file from a backup, otherwise you have to start over.

The suggestion Protoncek made was to remove the device from the ESPHome integration, only then it will be rediscovered.

Correct. Not delete yaml from builder, but delete DEVICE from esphome integration!

I understand what you are all saying…way too late for that. I deleted this device from the esphome builder and devices, etc. Everywhere I know of (in the gui) it’s gone (and I am ok with that). The issue now is adding it back in…this is just insanity. Remember this post started off with me changing the wifi name and ip…then I lost all connectivity to the sensors and esphome devices (sort of). Everything worked wirelessly with the new ip, logs, sensors reporting in the logs, etc. I have no clue what happened and it should not have done this in the first place, however putting this aside for the moment the issue is trying to get this device discovered again by esphome builder. Yes I have a copy the the yaml and .bin files. So here is where I am; as you can clearly tell from the above screenshots, this device just is not being seen anymore by esphome products, end of story. So I rigged the below TTL device to force it to listen to me by flashing the bin, and yeah, that worked…the device is not fried or bricked and it flashed fine. It’s something to do with esphome and how this is setup now because even through the manual flash worked, I am still in the same boat of esphome (anything) just not seeing it.

I have no solution right now

OK - for the community, I have my own solution. For whatever reason, the wemos d1 mini lite can not be flashed directly anymore :frowning: You need to connect a ttl device as above with pin d3 shorted to ground. This will allow you to flash the device. I also had to go into ESPHome Builder and create a new device with the same old name (since I completely deleted it)…then USE ALL THE NEW CODE created with the exception of your custom additions. Everything is acting the way it used to years ago.

Now the question is…how do I change the wifi and ip address without this happening again? What is the best suggestion and course of action? below is what I have and want I want

What is currently being used:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
   static_ip: 192.168.10.133
   subnet: 255.255.255.0
   gateway: 192.168.10.1
   dns1: 192.168.10.1

What I want it to be that bricked it in the first place:

wifi:
  ssid: !secret v20internal
  password: !secret v20internal_password
  manual_ip:
   static_ip: 192.168.20.30
   subnet: 255.255.255.0
   gateway: 192.168.20.1
   dns1: 192.168.20.1

Ok again, for the community I found the solution. What I said earlier stands - with a fresh d1 or even a d1 currently running esphome, the only way to flash this with a wire/usb is to connect a ttl device as above with pin d3 shorted to ground.

Below is a step by step tutorial on how to wirelessly change the ip address of an [already running] wemos d1 mini lite esphome device.

Click EspHome Builder, then choose the device you want to change and click “edit” Today I will change the ip of my garage device.

The only code changes we are going to make fall within and under the “wifi section” below is my current code

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
   static_ip: 192.168.10.130
   subnet: 255.255.255.0
   gateway: 192.168.10.1
   dns1: 192.168.10.1

I now want this device to use a different wifi name and ip address so this code is what it is now changed to:

wifi:
  ssid: !secret v20internal
  password: !secret v20internal_password
  use_address: 192.168.10.130
  manual_ip:
   static_ip: 192.168.20.31
   subnet: 255.255.255.0
   gateway: 192.168.20.1
   dns1: 192.168.20.1

Notice the addition of the code “use_address” the ip you must use here is the original ip you have been using for years on this device.

1st click "save then 2nd click "install

Click “wirelessly”

It will be successful, however you will now loose connectivity because this entire process is unnecessarily complicated to simply change an IP (of course that’s my humble opinion) and thus begins the rest of the shenanigans to complete this process…

Click “stop”

go to “settings” and click the word “esphome”

delete the device by clicking on the 3 dots and then “delete”

Click “add device” and enter the NEW IP

Click “finish”

PHYSICALLY UNPLUG POWER TO THE DEVICE - WAIT 5 SECONDS, PLUG POWER BACK IN

Click “settings” then “add-ons”

click “esphome device builder”

click “restart”

It will still show “offline”…it’s not. The trick here is to COMPLETELY REMOVE the code line “use_address” then click “save” Once you do this, click “logs” to get it to be “seen” again and become online…do so now. Click “logs”.

Once it shows online, click “edit”

then click “install” (wirelessly of course)

CONGRADULATIONS!! You have now spent 1 hour of your life changing an ip address

Couple points to note.

  • I did not lose any history using this method
  • This process is stupid AF, but it works.
  • My final code looks like:
wifi:
  ssid: !secret v20internal
  password: !secret v20internal_password
  manual_ip:
   static_ip: 192.168.20.31
   subnet: 255.255.255.0
   gateway: 192.168.20.1
   dns1: 192.168.20.1

Hm…
I did change IP quite a few times before and i never complicated like that. I just insert “use_address…”, flash it, when done (when you get those violet colored messages) i click “stop” to re-enter editor, delete (or comment out) “use_address” line, save&close editor, refresh browser’s page and voila. It also always appears online in esphome devices, also all sensors come back, i never deleted and re-added any of my devices (and i have over 40 of them).