parvez / network_scanner

This Home Assistant integration provides a network scanner that identifies all devices on your local network. Utilizing the provided IP range and MAC address mappings, it gives each identified device a user-friendly name and manufacturer information.
MIT License
99 stars 3 forks source link

0 devices #16

Open Jab2870 opened 4 days ago

Jab2870 commented 4 days ago

For some reason, the integration does not show any devices.

image

image

Nmap is installed and working in the HA docker container, and scanning the specified subnet shows a number of devices:

image

The only log message I see is that it is taking more than 10 seconds:

Logger: homeassistant.components.sensor
Source: runner.py:189
integration: Sensor (documentation, issues)
First occurred: 16:45:25 (1 occurrences)
Last logged: 16:45:25

Setup of sensor platform network_scanner is taking over 10 seconds.

However, after leaving the intergration for well over 20 mins it sill shows 0

parvez commented 3 days ago

could you help confirm if the version you are using is 1.0.7. This plugin is now available on HACS as well, you can get it up to date through it. https://hacs.xyz/

Jab2870 commented 3 days ago

I can confirm i'm using 1.0.7 and installed it through hacs

parvez commented 2 days ago

i faced similar issue when my sophos firewall was blocking the scan requests. could you help check if you have any firewall that's blocking, or create a firewall rule to allow.

AlexH0606 commented 2 days ago

Good morning ! Can anyone help me? I have the same problem.. Let me explain: I have a local network in 10.0.0.x, and with a VPN, we reach an extent of 120 range, of 10.11.x.x (example: 10.11.47.2, 10.11.95.2, etc.) I can ping them using ssh, but nothing is found when scanning when I put 10.11.47.0/24.. Any idea?

Jab2870 commented 2 days ago

i faced similar issue when my sophos firewall was blocking the scan requests. could you help check if you have any firewall that's blocking, or create a firewall rule to allow.

I don't believe so. As I demonstrated in the initial post, I was able to run a ping scan from the home assistant docker container to the range I am trying to scan.

parvez commented 1 day ago

Could you enable debug log and see anything unusual?

Jab2870 commented 1 day ago

the relevant bits (took out bits relating to other intergrations

2024-09-20 11:05:14.860 INFO (MainThread) [custom_components.network_scanner.sensor] Network Scanner initialized
2024-09-20 11:05:14.860 DEBUG (MainThread) [custom_components.network_scanner.sensor] Scanning network
2024-09-20 11:05:24.848 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform network_scanner is taking over 10 seconds.
2024-09-20 11:10:03.268 DEBUG (MainThread) [custom_components.network_scanner.sensor] ip_range: 192.168.0.0/24
2024-09-20 11:10:03.268 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_1:
2024-09-20 11:10:03.268 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_2:
2024-09-20 11:10:03.268 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_3:
2024-09-20 11:10:03.268 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_4:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_5:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_6:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_7:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_8:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_9:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_10:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_11:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_12:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_13:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_14:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_15:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_16:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_17:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_18:
2024-09-20 11:10:03.269 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_19:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_20:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_21:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_22:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_23:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_24:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping_25:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mappings:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping unparsed:
2024-09-20 11:10:03.270 DEBUG (MainThread) [custom_components.network_scanner.sensor] mac_mapping parsed:
2024-09-20 11:10:03.275 INFO (MainThread) [custom_components.network_scanner.sensor] Network Scanner initialized
2024-09-20 11:10:03.275 DEBUG (MainThread) [custom_components.network_scanner.sensor] Scanning network
2024-09-20 11:10:13.269 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform network_scanner is taking over 10 seconds.
Jab2870 commented 1 day ago

so, I've done a bit of experimenting. It looks like hosts are dropped if they don't contain a mac address in the nmap scan. Nmap is only able to get the mac address for a device if it's on the same subnet. To demonstrate I added lines 96 and 97 to the sensor.py file:

image

The result was image