DHCP and reserved addresses
14 min Read in this browser
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:
- an IP address and its prefix (sent as a subnet mask),
- the gateway (the router) to reach other networks,
- the DNS servers that turn names like
connect.selorahomes.cominto 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.
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:
- Let the device join the network and take an address from DHCP.
- 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. - 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.
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.
DHCP
The service, usually on the router, that hands each device an address, the gateway and DNS servers when it joins the network. The address is a loan that can change.
IP address
The number that identifies a device on a network, such as 192.168.1.42. Other devices use it to reach that one.
Subnet
A range of addresses that can reach each other directly, without going through a router. 192.168.1.0/24 is the 254 addresses from 192.168.1.1 to 192.168.1.254.
Gateway
The address a device sends traffic to when it's for another network, such as the internet. At home, it is the router.
DNS
The service that turns names such as connect.selorahomes.com into IP addresses.
Integration
The part of Home Assistant that connects one brand or protocol, such as Sonos, Lutron Caséta or Frigate, and brings its devices in.
Frigate
The open-source recorder Selora runs on the Hub. It records the cameras and detects people, vehicles and animals in what they see, locally.
DHCP reservation
A rule on the router that always gives one device the same address, recognised by its MAC address. How cameras, hubs and speakers keep an address others can rely on.
Selora Connect
Selora's web app for homeowners and installers: the installations, their plans and services, remote access and support sessions.
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.