Selora Homes Selora Homes Academy

DHCP and reserved addresses

14 min

You will be able to

  • Explain what DHCP hands out to a device
  • Reserve the address of every device Home Assistant reaches over IP
  • Choose between a DHCP reservation and a fixed address on the hub

Nobody types addresses into smart plugs. When a device joins the network it asks a DHCP server, usually the home router, for its settings:

  1. an IP address and its prefix (sent as a subnet mask),
  2. the gateway (the router) to reach other networks,
  3. the DNS servers that turn names like connect.selorahomes.com into addresses.

The address is a lease: it lasts a set time. Halfway through, the device starts renewing it, and keeps trying until the lease runs out. A device that was off for a week may come back with a different address.

Check yourself Single answer

A plug got a 4-hour lease at 08:00. The router is down from 09:00 to 13:00. What happens to the plug?

Not graded: try as often as you like.

Reserve what Home Assistant reaches by address

Many devices are set up in Home Assistant by their IP address: a camera's stream, an amplifier, a bridge. What happens when that address changes depends on the integration:

  • Some find the device again. They recognise it on the network by its own ID, through discovery, and update the address they keep.
  • Others keep the address you gave them. A camera's stream URL in Frigate, for example, still points at the old address. The device looks dead, though it is working fine at its new address.

You can't tell which kind you have from the device page. Most of the time a device renews its lease and keeps its address, but it can get a new one after a long power cut, or after being off longer than its lease. That happens weeks or months later, when you're no longer there. So don't rely on the integration: reserve the address of every device Home Assistant reaches over IP, the hub included.

The order on site:

  1. Let the device join the network and take an address from DHCP.
  2. On the router, turn that lease into a reservation. Most routers offer it from their list of connected devices. Name it after the device and its place: cam-driveway, amp-living-room.
  3. Only then configure the integration, with that address.

Reserving after the integration is set up works too, as long as the address doesn't change in between. Reserving first means it can't.

When you can't manage the router, set the address on the device itself, outside the router's DHCP pool, as for the hub below.

Check yourself Single answer

After a power cut, the driveway camera has no recordings, though its own app shows it streaming. The other cameras are recording as usual. What do you check first?

Not graded: try as often as you like.

Keeping the hub's address stable

The Selora Hub must keep the same address: integrations, bookmarks and firewall rules point at it. Two ways to get there:

  • DHCP reservation on the router: the router always gives the hub's network card the same address, recognising it by its MAC address (a hardware ID printed on the device). Preferred when you can manage the router: the address is kept in one place. If the customer ever replaces the router, the hub still gets an address from the new one (recreate the reservation there), while a fixed address chosen for the old network may not fit the new one.
  • A fixed address on the hub, set in Selora Connect: DHCP + IP (a fixed address, with the gateway and DNS still from the router) or Manual (you also type the gateway and DNS). It's the way to go when you can't manage the router, for example a locked ISP box. It works when you can too, but isn't recommended: the router doesn't know the address is taken. Choose an address inside the router's network but outside its DHCP pool.

The public guide shows where to set this on the hub: IP configuration.

Go further on selorahomes.com

What you read is saved in this browser only. Sign in to keep it in your account, take the quizzes and get certified.

This lesson by Selora Homes is licensed CC BY 4.0 : share and adapt it, even commercially, crediting Selora Homes with a link. Photos by others keep their own licences, as credited.