Skip to content

Add DHCP reservation read and write support - #173

Open
cmadds wants to merge 1 commit into
schmittx:mainfrom
cmadds:pr-reservations
Open

Add DHCP reservation read and write support#173
cmadds wants to merge 1 commit into
schmittx:mainfrom
cmadds:pr-reservations

Conversation

@cmadds

@cmadds cmadds commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Adds support for reading and managing DHCP reservations (static IPs) for clients.

Read

Client device_tracker entities gain two attributes:

  • ip_reserved (bool) — whether the client's current IP is a reservation
  • reserved_ip — the reserved IP, when one exists

Populated by fetching the network's reservations and matching by MAC.

Write

Two new services:

  • eero.set_reservation (mac, ip, name, target_network) — create/update a reservation
  • eero.delete_reservation (mac, target_network) — remove a reservation

Documented in services.yaml, strings.json, and translations/en.json. The README gains a usage section including a one-tap "reserve" dashboard-button example.

Implementation notes

  • Reservations are fetched from {network}/reservations (same session/API the integration already uses), normalised to handle a bare list or a {data|reservations: [...]} wrapper.
  • The fetch is wrapped so a failure can't break setup (logs at debug, defaults to an empty list).
  • set_reservation POSTs {mac, ip, description}; delete_reservation looks the reservation up by MAC and DELETEs its url (falling back to {network}/reservations/{id}).
  • Uses eero's undocumented reservations endpoint — verified working end-to-end on a live network (create/read/delete round-trip on a real client).

Testing

  • ip_reserved/reserved_ip populate correctly across wired + wireless clients (reserved infra vs dynamic devices).
  • eero.set_reservation pins a device and eero.delete_reservation releases it, with the attribute flipping accordingly.

Happy to adjust naming/approach — flagging in particular the reliance on the unofficial reservations endpoint.

- Expose ip_reserved / reserved_ip attributes on client device_tracker entities
- Add eero.set_reservation and eero.delete_reservation services to pin/remove a
  static IP for a client MAC
- Fetch network reservations from the reservations endpoint and match by MAC
- Document the services (strings/translations) and a dashboard usage example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant