Device IP change - how to update in HA without having to re-add device and reconfigure scripts

Hi everyone,

I’ve been playing with home assistant for a while testing / trialing out items. Today I made the decision that all of the shelly1’s and other items should be on static ip addresses so I can better manage/handle routing etc.

However in doing that, removes their functionality from HA.

I might be blind, but I can’t for the life of me find where you can edit a device/integration to update the associated IP address of the item. Is this not actually possible?

Do you instead have to delete/re-add the deivce and then reassociated/redo the automations/scripts etc?

Surely theres a location where you can edit / modify an item to update its IP address?

Thanking everyone in advance, hopefully theres a way… thought I had to ask before doing it the manual method and re-adding everything.

14 Likes

Hi there, I think it would best to just delete the device and add it again. Even then the shellys should retain their original entity_id and so you wont have to resync any automations or so. Make sure that you restart the device after you delete the shellys before re-adding. I advise you to try this with one device first than deleting all the devices at once.

2 Likes

I do also whish there should be an option to change the ip addres in esphome integration in homeassistant!

Due to the nature of the original desgin (mDNS) most people running esphome on the same subnet as homeassistant have no issue with ip address changes though…

Me, running esphome devices on a separate ssid and disabling mdns… I whish it was possible to change ip addresses without the hassle of deleting integrations and re-adding them.

7 Likes

Just managed to change back 2 device-ip’s, that I forgot to pin in my router.
Via networkshare go to:

homeassisant\config.storage\core.config_entries

Open, edit and save with texteditor

PS show hidden files & folders needed ( mac: shift+cmd+ . )

40 Likes

i am having the same issue. i am moving my iot devices to a separate vlan and ssid, so they’ll get new ip addresses. I’d like to avoid readding the devices to HA, so changing their IP in the config files would be great. i did try the approach suggested by @avonthur but for me the device remains unaivailable, even when updating the ip address in core.config_entiries

2 Likes

Did you ever work out how to do this? I am also trying to move my devices to a swcured vlan, which is different from the HASS Server

2 Likes

Yes, I did. but what is your question? as long as the devices are able to reach each other via routing and a default gateway all is fine…

Another solution that can be used from HA itself:

Install and run the Terminal addon.
From the Terminal:
Change directory to /config/.storage:
cd /config/.storage
Then edit the core.config_entries file:
nano core.config_entries

Make changes to this file as you see fit, then use ctrl + x to exit the program, and press y when asked to save and then enter to confirm you want to keep the same filename.

Reboot Home Assisant, and it should work.
If not, there are probably more changes required than you think, and the best solution would just be to delete the integration and start over.

19 Likes

This is the way I just fixed it, thanks for sharing!

Hi Arthur, I’m in the list of people that you helped with your message. Thank you!
Just few additional notes for how will come here later:

1- the right path should be:
/homeassistant/.storage/core.config_entries

2- I had the same issue of @molnart … initially it doesn’t work. Just need a full reboot and after all works well!

3- I’ve used the add-on “file editor”, download directly from Add-on Store in HA.

1 Like

Thanks a lot…working for me !!!

What if the file /config/.storage/core.config_entries doesn’t exist?

Will creating it do anything? what format should it be? json or yaml ?

ok it seems like this is something to do with the studio code server addon. all dotfiles are hidde and the usual vscode tricks to show hidden files are not working.

./frustrating

Ok it’s a "helpful" preconfiguration done by the studio code server addon due to addon authors personally nuanced view of the world.

So, I’m running on a Raspberry 3b+ (not containerized) and the core-deconz fix doesn’t help me. Has anyone figured out an alternative way to fix this?

core.config_entries:

{
  "entry_id": "***",
  "version": 1,
  "domain": "deconz",
  "title": "***",
  "data": {
    "host": "core-deconz",
    "port": 8080,
    "api_key": "***"
  },
  "options": {
    "master": true
  },
  "pref_disable_new_entities": false,
  "pref_disable_polling": false,
  "source": "ssdp",
  "unique_id": "***",
  "disabled_by": null
},

Maybe this is a new Feature, but i could add the existing device with it’s new IP and it just worked.
Didn’t even delete the old one first.

Thanks @andrix - worked for me. I fixed a changed IP address of a Sony Bravia Android TV. I had changed its IP by adding a DHCP reservation on my DHCP server for the TV. Unlike other integrations, core.config_entries did not update the Sony TV section and still had the old IP.
With core.config_entries updated to new IP, Now Home Assistant can detect again whether the TV is turned on or not and all the other fun stuff.

1 Like

Anyone running HAOS and finding out that any manual edits to core.config_entries are rolled back when you reboot your system try this:

Prerequisites:

  • SSH connection to HA
  • Basic knowledge of vim or nano or some other text editor available in HAOS
  1. Stop the core: ha core stop
  2. Edit the config (I use vim, might be more beginner friendly): vim config/.storage/core.config_entries
  3. Start the core: ha core start
3 Likes

Via Terminal & SSH under Linux (in my case I am using a Raspberry Pi)

First of all let’s make a backup of the file:

cp homeassistant/.storage/core.config_entries homeassistant/.storage/core.config_entries_backup

in my case I changed the network but kept the host ID of each devices

sed -i 's/192.168.1./192.168.8./g' homeassistant/.storage/core.config_entries

Reboot… and it works! :wink:

1 Like

thank you for this, saved me some headaches!!

Many thanks. You can also edit the file with the SSH and Web Terminal Add-on.

  1. nano /homeassistant/.storage/core.config_entries
  2. find your device (you can find on nano with Ctrl+W)
  3. edit the IP
  4. exit saving changes (Ctrl+W, Y)
  5. reboot HA → reboot now