New router with new IP range, how to modify all devices IP in HA?

If I want to change my HA from 192.168.50.XX to a new router 192.168.1.XX, how to modify (and where) in HA and all devices that are at old IP (like myStrom) how can I modify the IP address in HA?
I have no way to see and modify the IP address of myStrom device.

Have I to reinstall from scratch ?

In the default configuration, the HA receives its IP configuration from the router via DHCP. If a static IP is assigned, you can change this via Settings → Network → IPv4 (or IPv6).

If HA is unchanged and you just replaced old router with new router…

change new router to use old router IP range

Set static IP in router for HA

All should just work

EDIT: may be necessary to unplug ethernet and reboot HA for it to get new dhcp assigned IP if it is not already set as static in HA settings

I would not change the IP range. Change the range in the new router to the same as the old one.

You have hit one of the areas where HAs move to set everything up in GUI have cause a loss of options.
If you want to keep the new IP range, then you will have to delete your devices and then re-import them in HA with the same name and rename any of the entities you had renamed before and set the right tags and area for each device and entity.
This is a huge work, so go with the other suggestions here.

Take a screenshot of your old routers DHCP reservation list and set that up in the new router with the old IP range.
If you did not have reserved IPs in your old router, then make a copy of the old router lease list, since some of your devices might require the same IP as on the old router and then you need to reserve that IP for that specific device in the new router.
This depends on how the device is registered in HA.

Thanks for all your answers.
Unfortunately I have to change of router address… but now if my device myStrom was connected by wifi, where can I find in HA the wifi configuration of this device ?
I have checked configuration.yaml and other yaml without success and there is also no myStrom.yaml file.

You might have to remove the device and then import it again.
The potential big issue here is if you have automations based on device_id and not entity_id.
If it is device_id then you might have to redo the automations too.
If it is entity_id then you can just name the new entity the same as the old one.

1 Like

Running into a similar situation. I recently updated my router’s DHCP lease range. I realized that my Pi-hole was rate-limiting requests coming from Home Assistant because, once an hour, it was making over 1,000 PTR requests in just a few seconds.

I realized the problem wasn’t so much Home Assistant, as it was doing what it was supposed to. The problem was that my router’s DHCP range was unnecessarily large. So I’ve updated its range to be more reasonable, and well under 1,000 usable IP addresses.

However, Home Assistant still hasn’t updated its netmask in Settings > Network > Configure network interfaces which is resulting in it continuing making those 1,000+ PTR requests. I recognize that I could set IPv4 to “Static” but I know in the future I might forget that I’d need to update it and, as such, I would love to be able to keep it set to “Auto.”

I’ve rebooted the Raspberry Pi that’s running Home Assistant OS and also have ran “ha network update eth0 --ipv4-method auto” without any luck.

Any ideas as to what I should do or what I’m doing wrong?

Thanks in advance!

Restarting HAOS (Not just the HA Core) should solve it.
If it does not, then it suggests that your router has not been updated. Maybe you forgot to save your config?

1 Like

Well, you called it, my router was not actually updating its netmask.

It was user error on my part as I was changing the wrong setting on my TP Link Deco. I thought it was crazy how TP Link was having me set the range, using IP min and max IP addresses. Turns out that was solely for the DHCP lease range and not the actual netmask. Hint for any other TP Link Deco users, you’ll want to look within the “LAN IP” settings.

Thanks so much, @WallyR !