Changing the IP address of an existing device in the Xiaomi Miio integration

With recent HA update it was made possible to configure the Xiaomi Miio integration via the UI:

This is really nice to use and the vacuum works as expected.

However, sometimes my vacuum changes its IP address and I need to reconfigure the integration. Sadly I can’t configure a static IP for the vacuum. The only way to reconfigure the integration I found to do it is to:

  1. remove the integration
  2. restart HA
  3. add the integration again with new IP but same token
  4. rename the entity to what it was before.

Am I missing an easier way to change the address?

1 Like

I believe you are not missing anything with changing the address but normally static ip can be set from your router.

Thx for the suggestion. Sadly, I don’t have admin access to my router, so I can’t do it.

Expectation from xiaomi integration: it ask login and password for MiHome, take a list of all devices from servers like Xiaomi-cloud-tokens-extractor utility, ping all known devices, add them to HA if they are available in this network, make a beautiful card for lovelace for every device.
Reality: it “discover” devices from configuration.yaml, asks ip and token (which are already written in config file), and you need to rename all items in your card’s config.

I also need a way to easily change ip for devices in miio_integration. I have provider’s router which internal dchp server saves maximum 5 static IP addresses.

To change to a new IP don’t remove the integration, just add a new one and it will replace the IP and keep the rest.

1 Like

You can also edit config file by hand and change the IP address there.
Config file: ./.storage/core.config_entries
Search for: xiaomi_miio

9 Likes

Thanks! Changing the IP in the config saved me, as for some reason the cloud login is not working anymore for me. Is it just me?

For future readers, you have to restart HA after editing the config file. Putting it here in case it is not obvious to someone.