Shelly - DeviceConnectionError after changing IP (before I integrated the device)

Hi,
I have two new Shelly devices in my network (plus 2pm). Before I started to integrate both into HA, I set a static IP address. Unfortunately HA tries to use the old (DHCP) IP address of the devices and the integration fails.

Even when I delete the integrate and wait for discovering of the devices again, the old IP is used.
But, when I got into the device the visit link points to the right IP address. But all inputs and sensors are disabled.

The debug log just shows the following.

2024-02-04 21:03:49.976 DEBUG (MainThread) [aioshelly.common] host 192.168.64.72: error: DeviceConnectionError(ClientConnectorError(ConnectionKey(host='192.168.64.72', port=80, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, proxy_headers_hash=5670172743653991968), OSError(113, "Connect call failed ('192.168.64.72', 80)")))
2024-02-04 21:03:49.976 DEBUG (MainThread) [aioshelly.rpc_device.device] host 192.168.64.72: error: DeviceConnectionError(DeviceConnectionError(ClientConnectorError(ConnectionKey(host='192.168.64.72', port=80, is_ssl=False, ssl=True, proxy=None, proxy_auth=None, proxy_headers_hash=5670172743653991968), OSError(113, "Connect call failed ('192.168.64.72', 80)"))))

Another strange thing is, that when I remove the devices and add them again, HA still knows which room I assigned before. At least for me, this is not the expected behavior.

I’m using the following HA versions on a Raspberry Pi 4.

  • Core 2024.1.6
  • Supervisor 2023.12.1
  • Operating System 11.4
  • Frontend 20240104.0

So, why is the old IP used? How can I completely remove the devices from HA?
Is the behavior a bug?

Thanks for your help,
Johannes

This is pretty common since HA will auto detect as soon as it’s on your network. What I do is when I’m doing the initial setup of the Shelly (and I have a lot of them) I set the wifi and static IP on the first setup when I connect to the access point it publishes, that way when HA detects it it’s detected at the proper IP. If you don’t do this I found the easiest way to fix it is to restart HA so it can re-detect it on the new IP if it still is looking to the old one.

Hi,
thanks for the reply.
So I removed the devices, restarted HA, the devices were discovered again, in the config dialog the new IP address was shown, BUT after adding the devices still the same problem.
HA is still trying to use the old IP for the initialization.
:frowning:

Any other idea? Or How can I force HA to forget everything about these devices?

Just two more remarks. The two new Shellies replacing defect devices. So I’m reusing the old IP.
Second point, I’m using also a FritzBox router and for each Shelly device it is creating an integration too (e.g. to switch off the internet access).

Did you make any progress with you’re problem? Because I have a similar one. After resetting a Shelly plus 1 I added it back to Homeassistant before asigning a static Ip Address. I then set a static Ip Address and reconfigured my Shelly Integration. It works most of the time but every hour or so Homeassistant tries to connect to it via the old Ip address.

Same Problem here, I tried to remove it and add again, no luck