Contacting the DHCP API for InfluxDB data

Is there an API that I can contact in order to get information about DHCP information. It would be nice to be able to get current connected clients or even an array with their ip addresses and lease times?

Did do a quick search although I couldn't find anything.

There isn't.

Some of the information you are looking for may be available at /etc/pihole/dhcp.leases. It doesn't necessarily reflect connection status, so you may have to correlate that with arp or ip neigh.

You may also want to check the documentation for dnsmasq, Pi-hole's embedded DHCP/DNS server.

In the upcoming Pi-hole version 6.0 the API will be completely redesigned.
Delivering DHCP information might be possible then.

2 Likes

Oh awesome; I didn't realise that we were due to a major API update. Fingers crossed that they will produce an API for DHCP; would love to implement into Home Assistant.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.