hass-pfsense icon indicating copy to clipboard operation
hass-pfsense copied to clipboard

DHCP Count Stuck on 0

Open remlei opened this issue 1 year ago • 8 comments

HA Core 2024.1.2 pfSense 2.7.2


DHCP Count stuck to zero after pfsense version update probably due to major upcoming changes with deprecated ISC DHCP server in favor of KEA DHCP server.

To reproduce, simply update to latest version and set the DHCP server to KEA.

remlei avatar Jan 07 '24 23:01 remlei

I have the same issue. It started today after updating pfSense Plus from 23.05 to 23.09.1, changing the DHCP server backend from ISC to KEA. I'm also running HA Core 2024.1.2.

drRax avatar Jan 08 '24 00:01 drRax

Noticed the same behavior, just commenting to follow 👍

Langelus avatar Jan 13 '24 20:01 Langelus

I as well changed from ISC to KEA and now report 0 clients within the Home Assistant integration.

vanimox avatar Jan 14 '24 01:01 vanimox

I have the same problem, only I also down/upgraded from 23.05.1 to 2.7.2 and changed from ISC to KEA.

Hurr1c4n3 avatar Jan 16 '24 09:01 Hurr1c4n3

I am experiencing this as well. I am still using ISC and have NOT switched to KEA as of yet.

PFSense Plus 23.09.1-RELEASE

wormuths avatar Jan 26 '24 17:01 wormuths

Same issue. I'm on the latest version of pfSense CE (2.7.2 as of writing) and have NOT switched to KEA

bscheutjens avatar Feb 02 '24 15:02 bscheutjens

Same issue. I'm on the latest version of pfSense CE (2.7.2) using ISC. I switched to KEA but switched back to ISC because KEA does not handle DHCP Static Mappings (A nice little surprise for unwary travellers).

uniqueuid avatar Feb 07 '24 03:02 uniqueuid

I took a look at the code and might have a fix.

Disclaimer: This involves manually changing files. If you make an error, the integration might not start anymore

  • Take your file editor of choice (I use the add-on Studio Code Server)
  • Go to the following path: custom_components/pfsense
  • Open the file __init__.py
  • Go to lines 357 to 360. They should look like as follows:
                        if lease["online"] in ["active", "online"]:
                            lease_stats["online"] += 1
                        if lease["online"] in ["offline", "idle/offline", "idle"]:
                            lease_stats["idle_offline"] += 1
  • Change the first line to:
                        if lease["online"] in ["active", "active/online", "online"]:
  • The whole block should now look like this:
                        if lease["online"] in ["active", "active/online", "online"]:
                            lease_stats["online"] += 1
                        if lease["online"] in ["offline", "idle/offline", "idle"]:
                            lease_stats["idle_offline"] += 1
  • Restart Home Assistant

bscheutjens avatar Feb 07 '24 08:02 bscheutjens

The fix proposed by bscheutjens above worked for me!

danleongjy avatar Feb 16 '24 14:02 danleongjy

I merged a long time ago but never snapped a release. I've now released v0.6.3 with this and other minor updates. Let me know how it goes.

travisghansen avatar Feb 16 '24 18:02 travisghansen

I merged a long time ago but never snapped a release. I've now released v0.6.3 with this and other minor updates. Let me know how it goes.

It works for me.

Hurr1c4n3 avatar Feb 16 '24 18:02 Hurr1c4n3