Changing IP address for Zigbee socket connection

I’ve recently set up a Zigbee gateway using a Sonoff gateway flashed with Tasmota firmware. Nice work on the part of the Tasmota crew, works a treat!

All has been running well but the IP address of the gateway eventually changed when the DHCP lease expired - as expected. I now have it using a statically allocated IP address instead so it won’t move again.

I’m sure I’m missing something here but can’t for the life of me find where I change this in Home Assistant though - I need to change the socket info from socket://192.168.xxx.182:8888 to the new addy of socket://192.168.xxx.57:8888

I can even see in the logs it’s trying connect at the old .182 address, but not where to set it!

Or do I need to remove the integration and re-add ? Will I then need to re-add all the ZB devices as well ?

Thanks in advance!

Why not simply change the DHCP reservation to whatever IP address home assistant is expecting? After that restart the bridge and it should grab the other IP address.

A fair question and one I’d considered :slight_smile:

Turns out it’s not trivial though - the DHCP server I’m using, like most, issues non-fixed addresses based on a range - 96-254 in my setup at home. The address that had been allocated to the gateway was right in the middle of this and there’s no way to say to the DHCP server “use this range except for this one particular address” For this same reason I can’t just set a static IP on the gateway and force it to 182 - occasionally there’d be an address conflict from the DHCP server pool.

I guess there is also a sort of philosophical aspect to this - I’d rather not change my network config when the better place to change it is on the device. Somewhere in HA/ZHA that address is being set, I just need to find where that is and alter it :slight_smile:

I’m also trying to avoid the delete integration and re-add approach so I don’t have to re-pair all the zigbee devices. There aren’t that many, but a few of them (Phillips Hue) seem to be a bit funky about re-pairing if you don’t have the phillips bridge.

Hopefully someone can point me in the right direction, thanks for the suggestion though! :slight_smile:

You should be able to set a DHCP reservation for a device on your DHCP server even if it’s within the DHCP pool.

Anyway, another not-recommended option would be to edit the IP address in the config entry at /config/.storage/core.config_entries. Just make a copy of this file first before editing in case something goes wrong.

4 Likes

Thank you Tediore, that was the file I was looking for. I took a copy as you suggested, edited it to the new IP and seems to be working as expected now.

I will keep that DHCP suggestion in mind though - but my holiday project is to re-do the local network onto an entirely new IP range, so being able to do so for things like HA without rebuilding everything will be a big time saver.

Thanks again.

1 Like

After the 3rd octet changed on my network, I had to do this to get everything running. Worked great!