I’m wondering how people with HomeAssistant are managing the IP address for all of their IOT devices?
The options that I’m aware of are:
Static IP Addresses - You manually set a static IP address on each device. This doesn’t really scale, and is vulnerable to human error (e.g. address conflict on two devices)
DHCP - The devices grab IP addresses from a pool - however, the address may change between reboots, lease timeouts etc.
DHCP with static reservations - On your DHCP server, you reserver specific IP addresses from the pool for devices via MAC addresses. It’s a bit of overhead though.
Let’s say you have a mix of IOT devices (some of this is planned in my case):
ESPHome devices
Shelly devices
Tuya devices (used via localtuya or tuya-local - still figuring out which is better)
WLED light controllers
In my case, the router is running VyOS, and it’s a dual-stack IPv4/IPv6 network.
Larger microcontrollers have memory and flash to implement protocols like DNS and mDNS. Others don’t - e.g. Tasmota can use mDNS to lookup the IPv4/IPv6 of a MQTT server, but by default doesn’t so it’s IPv4 only.
There were bugs in the HA implementation of a MQTT broker which broke IPv6, so I’ve never tried it again:
Discovery protocols is the usual tool, like mDNS, SSDP, uPNP and ZeroConfig to mention some of the open ones, but some devices also use proprietary discovery protocols.
mDNS Caches on i.e smaller Device, Is Small, and TTL very short, beside “shit happens” in all Topologies
LAN NIC’s communities over their IP Numbers , Minimizing their “usage/effort” is always an “optimizing” approach ( Host Names is just a “Help” for Humans ! )
I Always Connect to my HA, Laptops, PC’s With their IP(Not Names), whether it’s from a browser or consoles/apps of various kinds
And Yes, ALL My IP Devices, have “dedicated” IP Numbers( within the DHCP-Scope ), I Deside Which IP Number every Device Will Have, So i know quite fairly which i.e Brand/Device it is when seeing an IP-Number in i.e logs etc
( I Know … Knowledge For Nerds )
Your first and third options you have given are basically the same thing.
Letting your router manage IP addresses at random (the dynamic in DHCP) and then asking for your system to go and search for them is a bit inefficient and has overheads and often issues that neophytes stumble over. Who’s in control? You, or it? Consistency, reliability, guesswork, randomness - pick two.
How many IPv4 addresses can you issue on your LAN for one /24 segment? Go on, look it up. Manageable with a paper list or spreadsheet? If you need more, then IPv6 is there, and has been there for decades, to supply the need. I read somewhere there were enough IPv6 addresses for every two atoms in the universe - you won’t run out soon!
There are many valid reasons why having a fixed IPv6 address may not be a desirable thing, especially if you have something to hide, or protect yourself from. A sustained DDOS on your dedicated IPv6 Address is not something to be sneezed at - you cannot just turn off your router for a few minutes and get a new address like a lot of people can with IPv4 and NAT.
A little more reading on basic networking will bring some clarity to your search for knowledge.
RARELY! You do not need static IP addresses.
On my network I have more than 100 IP clients, and only one has a static IP, my router. (Managing over 100 IP addresses would quickly get out of control). My cameras and servers all have reserved IP addresses in the router. The camera IP’s are reserved only because their IP is hard-coded in Go2RTC (inside Frigate). Servers have reserved IP addresses for similar reasons. For example when you configure Samba Share in Home Assistant you have to provide the IP address of the server you are connecting to. If that server were on DHCP assignment you run the risk of the server IP changing.
Reserved addresses in your DHCP router are not static IP’s.