network_scanner icon indicating copy to clipboard operation
network_scanner copied to clipboard

Update of sensor.network_scanner is taking over 10 seconds

Open Yvan13120 opened this issue 2 months ago • 6 comments

Log: Enregistreur: homeassistant.helpers.entity Source: helpers/entity.py:1284 S'est produit pour la première fois: 15:36:19 (1 occurrence) Dernier enregistrement: 15:36:19

Update of sensor.network_scanner is taking over 10 seconds

Other: Enregistreur: homeassistant.bootstrap Source: bootstrap.py:999 S'est produit pour la première fois: 15:20:28 (1 occurrence) Dernier enregistrement: 15:20:28

Waiting on integrations to complete setup: {('network_scanner', '01K7C8E3VA70SZK6JDN6WBDED9'): 158344.657469407}

Does anyone have an explanation for these messages?

Yvan13120 avatar Oct 12 '25 13:10 Yvan13120

Same here (haos 2025.10.2) , please investigate .. Thanks in advance

wiedwo avatar Oct 12 '25 17:10 wiedwo

I've test a nmap from the container on the host network, it takes about 46sec, and changing capabilities NET_RAW etc.. has no effect, finally I've tested nmap -sn -n -PS22,80,443 -T4 192.168.1.0/24 and boom 6 sec with all the devices on my network... so in sensor.py : def scan_network(self): """Scan the network and return device information.""" self.nm.scan(hosts=self.ip_range, arguments= '-sn -n -PS22,80,443,5555,8008,8443 -T4') devices = [] restart the HA container, and now no more message and my container is 100% available really faster but the issue is that you don't have hostname anymore, if you have PTR records you can replace -n by -R and add --dns-servers ip of your dns server

TheFab21 avatar Oct 16 '25 09:10 TheFab21

I've create a PR : in order to have the hostname you must have PTR records set on your dns server. https://github.com/parvez/network_scanner/pull/38

TheFab21 avatar Oct 16 '25 15:10 TheFab21

Same here. But your PR is not approved jet, right? @TheFab21 ?

Kieft-C avatar Nov 08 '25 13:11 Kieft-C

you're right, but you can edit by your side in HA

TheFab21 avatar Nov 08 '25 14:11 TheFab21

@TheFab21 seems to work.

Just download first -zip code instead official version, then exchange your sensor.py changed file.

Kieft-C avatar Nov 08 '25 18:11 Kieft-C