How to enable Home Assistant to find the IP addresses of all my things automatically, when my router is set to reboot every 24 hours?

No you’re right. I didn’t know that. But the Ubiquiti ‘Access Point’ has been on my shopping list for a few months now, exactly because it has been said to be solid as a rock, despite large numbers of 2.4GHz connections. If nothing else it will allow me scope to grow my network going forward.

The simplest way is probably

  1. Use that unused pi to set up pihole.

  2. Use the dhcp server in pihole. It is easy to reserve up addresses, with the bonus that local dns works.

  3. Turn off the dhcp server on your router.

I don’t have an unused Raspberry PI. I only have one that is running Home Assistant. Did you mean use this somehow?

There is a pihole addon

Right. Thanks. First I’ll have to figure out what a Pihole is and how to use it, lol. But first I’ll fill my own pie hole with some Xmas extras I think. :slight_smile:

Good plan. Still eating…

OK. Done. Much easier than I imagined. There was an address reservation section in my router settings and a ‘scan’ function. This found all my connected devices, their host names, their MAC addresses and their IP addresses and reserved the existing IP address on the router for their future use. So basically a quite useful mash up of all the advice given here.

The only thing is that a lot of my Wifi devices (I presume they must be my Tuya smart plugs), don’t have host names associated with them. But maybe that won’t matter because the SmartLife integration handles this anyway - although ultimately (since flashing seems to have become easier), I might have a go at flashing these as I want to rely on 3rd parties as little as possible. I’ve already been confronted with the ridiculous situation of companies going bust and my things not working any more, other companies charging for services that were previously free and still others selling their IP, or forcing obsolescence of their stuff simply in a cynical attempt to force me to ‘upgrade’ and buy new stuff from them. I want to know that I will still be able to turn my lightbulb on and off in 5-10 years time, without someone trying to charge me for the privilege. Which is why I have now gone down the rabbit hole with Home assistant, lol. But the flashing can come later once I have everything set up as much as possible.

Just one last point. Now everything has a fixed IP address, can I run the initial Home assistant set-up again? If so, how? It would be much quicker than entering/editing all of the configuration data manually.

1 Like

These pre assigned IP’s from your DHCP server are usually matched against the unique MAC address that each device Is built with so missing host names will have no bearing.

Just make sure the pool available for any non pre assigned DHCP addresses is large enough for the number of devices you have and importantly that the pre assigned / fixed DHCP IP addresses along with any static IP addresses do not fall within your DHCP address range.

Is this why maybe after a router reboot, my router had a panic attack and it took over 20 minutes for everything to reconnect? So, just to be clear, keep it all within the pool of non-DHCP addresses? I have a feeling that maybe this was a missing but potentially important piece of information?

All my devices with reserved iP addresses are getting ip via dhcp and are in the dhcp range. That won’t cause any problem. You should though make sure the range of addresses is big enough for all your devices.

Well, my router did have a 20 minute identity crisis/panic attack after a reboot and it took an age for everything to reconnect after I reserved IP addresses for all my things. So is that down to an issue I have not considered? Why the conflicting advice?

Considering you are not ready yet for investments to new wifi hw, I suggest to check if you can flash your wifi router with alternative firmware. For example OpenWRT.
In the past I had some old TPLink which was very unstable on original fw (was hanging daily ir every second day), turning rock stable with openWRT.
Also original tplink was offering only one ssid (wifi network) while the same device with openWRT been able to provide up to 4.
At the end I ended up with Unifi solution but it was due to coverage in my house. Otherwise this old router got new live with OpenWRT. It’s worth to try. Just make sure there is a support for your device (you will find it on OpenWRT pages)

It sounds like you have something else on your network thats causing you problems. DHCP assigns IP addresses, and rechecks them every so often (i think its 24 hours). If you have something thats powered on, when your network restarts, that then tries to take over issuing IP addresses, then at some point, the 2 will conflict, things will start to vanish, and everything will grind to a halt, untill a reboot of one of the devices issuing the IP addresses temporarily fixes it for a short while (untill the DHCP lease expires, around 24 hours later)

The advise given will help you solve it, but, you have to systematically work through EVERYTHING you have connected

The problem obviously IS NOT your router, if you are on your 3rd one, and having the same issues

I have an ISP supplied router, with around 50 devices connected, a few with fixed IP addresses, set up via the routers interface itself, and its smooth

Could you list EVERYTHING you have connected, starting from the router. Maybe a fresh set of eyes to your entire system will spot something that youre overlooking

I definitely don’t have anything else on my network that is assigning WiFi IPs other than my combo router/modem. Sadly I can’t flash to OpenWRT either, as this is one of the few routers that is unsupported. This was one of the first solutions I looked into when I started having problems. Things seem stable for the time being. But too early to tell. I followed the advice to assign IP addresses to all my things in my router and I changed the 2.4GHz channel to channel 1, after using software to determine the quality of signal from each channel.

It was strange it took so long for everything to reconnect after I rebooted my router this morning. But now I have applied the advice given here, I’ll disable the automatic reboot and see if my network can remain stable beyond a few days.

Yes - only the devices using DHCP and without a router mapped address wil grab an address from here within the DHCP pool. Other devices with static IP addresses and any you allocate via the router must be configured to be outside of this DHCP address range.

This could have caused you loads of problems before and so, just maybe it will all be much smoother now.

Well, there are two directly opposed schools of thought here it seems? Why the dichotomy? Is there a technical reason why this step is necessary? Without requiring me to learn double Dutch (so to speak), could you possibly explain further?

Are there - what’s the other one ? You mean @DavidFW1960 ?
You should NOT allocate fixed IP’s or router assigned IPs within the DHCP range. Here’s why.

You allocate such an address but the device wakes and sleeps. You have a power cut or you reboot your router. Now the router has no way to know if the IP is in use and might allocate it to another device. Now you have two devices with the same IP.

True some careful routers may check if there is an ‘unused’ entry for an IP assignment for a device that is currently offline but I bet there are many that don’t.

Just to clarify . I am not saying this is needed…

reading through this entire thread, there is indeed 2 paths

one is the people saying for you to assign fixed IP addresses to everything, and try to work out what is causing the issue with your existing equipment

the other is throwing more money to try and solve the problem, which could be solved by following the other train of thought

There is not just a simple ‘click this box’ fix to what is happening to your network. Something is causing it, and to find out what, will take elimination, and if you have a lot of equipment connected, eliminating each bit will also take time.

do you have wifi and wired stuff connected? you can ‘split test’ your entire system be disabling the wifi for a while, and see if the fault returns. if it does, then you know its a wired device causing it, if it doesnt, then you know its a wifi device, and can then work towards the next step of identifying whats causing it

at the moment, you have an end fault, you have an end result that you want, and you have a temporary fix to bounce between the 2. but you need to find what is causing the issue that makes you need to implement that temporary fix, and make that into an permanent
fix

you can reserve IP addresses to the MAC address of ANY device. this will ensure that that IP is not used when the router reboots, unless that specific device connects to the router. I use this for my CCTV DVR, Raspbery Pi running HA, and a few other devices that benefit from a fixed IP address

The dichotomy is between whether dhcp allocated fixed addresses (ie tying mac address to ip address) can be within your dynamic ip range. The answer is yes.

What you don’t want is to set a fixed ip on a device that is within the dhcp range.