[SOLVED] Adding in and Migrating HA to New Router - IP Addresses Difficulties

I am swapping out a router and keeping the old one online for other purposes. I am [trying] to migrate devices from one IP address range to another and I am quite stuck. As an example: I changed the IP address on a Tasmota switch, set the IP address in the switch itself, and I have the switch as a client on the new router - all good. However, HA thinks the IP address is on the old router in that when I go to “Devices” and look at the device and click on “Visit Device” the link is pointing to the old IP address.
I have tried deleting the switch and readding resulting in no change - same IP address issue.
I have tried ‘brute force’ and changed all the IP addresses in the config file in “homeassisant\config.storage\core.config_entries” - no effect.

There has got to be an easier (or smarter) way.

OrangeLoon

Found the missing piece. The Tasmota MQTT Settings in each device needed to be updated.

@OrangeLoon Are you saying that all you needed to do was:

  1. Go to the device’s web interface
  2. Navigate to Configuration > Configure MQTT
  3. Edit the MQTT parameters > Host value to provide the IP address of the MQTT broker?

Because I’ve done that, and it hasn’t worked. I can control the device using the Tasmotrol app, but Home Assistant still has the old IP address. Even deleting the entire integration and re-adding it via the auto-detection is creating brand new devices with the old IP addresses, even though everything else is using the new IP addresses.

I’m completely at a loss at this point, I can’t find anywhere else to update the IP addresses for the Tasmota devices…

Edit: When I look at the device web interface, and navigate to Information, I see that the device knows the new IP address. However, when I look at the discovery messages in MQTT Explorer, I’m seeing that the devices are sharing the old IP address in those messages.

So, it seems like there must be another place to update the IP address on the device, but I’m damned if I can find it. Thanks for any hints you can provide. (Though a specific navigation path would be best. ;- )

OK, I just solved my own problem, and it was dumb enough I need to come clean, so that this posting and comments are sufficient to answer future questions.

My problem was that I did step #3 incorrectly; I transposed the last two octets of the MQTT Broker’s IP address. So of course Home Assistant wasn’t finding the new devices through MQTT discovery.

Instead, Home Assistant was simply re-adding the old details, because the MQTT discovery messages were being retained (they were a month or two old), and had the old IP addresses. (This seems like something that HA could at least warn about.)

Once I re-updated all of the Tasmota devices with the correct MQTT broker IP address, all of the devices magically appeared in HA, just as expected.

HTH someone else who might make the same dumb mistake I did.

1 Like

Thanks @Alderete @OrangeLoon for posting your trials.
I came here with a similar question. “I have tasmota wifi plugs that were connected to home assistant. however their IP addresses changed as i changed internet provider and routers. how do i make home assistant associate the same ‘device’ with the new IP address?”
I found the IP addresses and MAC address pairs in /config/.storage/core.device_registry file.
I couldn’t find a way to tell the tasmota plug to be on a static IP. I am able to access the tasmota plug through the web browser, so I don’t see the issue in them, but rather HA is stuck to the old plug IPs.
So, I am hoping I don’t need to change anything on the plugs. Just change the IP addresses in the YAML file.
Alternatively, I wonder whether my new asus router will let me set static specific IPs for the plugs. Will see.