Network Scanner Integration that shows list of devices in your network

hey folks! want to my integration i created:

It shows the list of devices in my network with their ip, mac address and friendly names
would like your feedback before publishing it out to hacs.

3 Likes

Hey

Thanks for the share :wink: It works well here, my comments:
ā†’ In Installation chapter you can indicate you can just paste the url of the github in hacs for an easier installation :slight_smile:
ā†’ Configuration entry with the whole list: no way to get it to extend of one line each time you fill one ? instead of getting a crazy long list displayed straight ?
ā†’ on my system it displays the ip, mac address without problem but nothing for the local name. Canā€™t it get it from nmap ? as my router supports it for my lan and my devices have some.

Thanks

VincĆØn

that are great inputs.

  • I think could get the hostnames of each device but they are what the devices have been individually set for themselves.
  • I found it easier to add the custom list in the configuration.yaml but not sure why that is not suggested by the ha developer documentation

You can list out in configuration.yaml as such and it will be pre-populated in the textboxes when you initialize.

network_scanner:
  ip_range: 10.1.1.1-254
  mac_mapping_1: "01:11:81:41:21:e1;My Personal iPhone;Apple Inc."

I am thinking over how to make it easier. Few challenges I have:

  • input has a limit of 255 characters, so could not paste the whole list
  • updating requires deleting the old entity and re-adding it
  • in this configuration.yaml is helpful as you can add new friendly names in there and it will show up in the config flow modal

Thanks again!

Cool, but can you add a mac mapping dynamicly? I guess not.

1 Like

how do you mean by dynamically? could you give an example?

I really mean to set them up without having to configure the integration again. On reading your posts again i realise its not possible.

Two aspect of the configurations could definitely be automated:

  1. The host could help determine the ip range that need to be scanned, eg. if the host is 10.1.1.227, Could automatically set the scan ip range to 10.1.1.1-254

  2. Get the host names from the devices scan instead of asking the user to provide the friendly name.

Definitely would be good enhancements. The makes sense as default and customization should be supported.

In that case it could be a /24, but it could also be /8, or anything inbetween.

definitely, but think scanning by default on such a large range would not be appreciated.

Also I updated to get the vendor and hostname info from the scan instead of manually entering. If nothing found, would show ā€œUnknownā€

1 Like

Is that in 1.0.3? I am not seeing that.

EDIT I see there is now 1.0.5 and I am seeing vendor and hostname :slight_smile:

1 Like

Hi
Thanks for this - Iā€™ve installed and its up and running, but Iā€™ve not been able to get the ā€˜Custom Nameā€™ & ā€˜Custom Descriptionā€™ working at all? I have added the following. entries to HA configuration file, what have I missed please? (my live MAC entries are correct - the MAC list below masked for privacy)

Network Scanner

network_scanner:
ip_range: 192.168.1.1-254
mac_mapping_1: 98:48:27:XX:YY:XX;Archer Router;TPlink
mac_mapping_2: 00:10:75:XX:YY:XX;NAS;Segate BlackArmor 440
mac_mapping_3: B0:39:56:XX:YY:BB;Orbi_Router;Netgear

Hi
a question / suggestion
I (and assume many others) have some scripts / automations etc that rely on devices IP address (rather than MAC) to work. I know and have created reserved and or static IP addresses for some of these devices) wondered if, by using your Network Scanner one could discover IP address from (known user listed) MAC addresses, to create entity (or whatever) list of correct IP addresses for these devices to use in Automations, scripts etc. My IPs do change each time Router reboots (power in area causing) resulting in scripts not workingā€¦
may not have described this well, Im new to HA but hopefully idea is conveyed
Cheers

Get your DHCP server to give out the same address each time.

Yes I could side step the question I asked, however as I stated I can & have done that BUT my router, like many domestic Routers, have a (practical) limited number of reserved IP addresses the DHCP server supports - when I reach about 20-25 the router (DHCP server) seems to fall over, hence interested in discovering IP address from MAC as an alternative (and hopefully stable / reliable) way of discovering a devices ip address from MAC by scanning LAN.

Well thatā€™s kinda backwards. Get a rpi (3 is more than enough) and install pihole. DNS, DHCP, all taken care of. Turn the router DHCP off. Best network upgrade I ever did.

1 Like

understood but are you able to assist / advise on either of my earlier questions please?

From this sensor you can see the Mac address mapped to the IP address in the one attribute, devices. In a template you can get the attribute by the usual method. Iterating through it to search for a particular Mac address is beyond my skills, so Iā€™ll leave it there for others to suggest.

Alternatively you could create a command line sensor using arp.

Yes thanks I may try that. Unfortunately Iā€™ve not managed to get the configuration to recognise the few friendly names I set up following the documentation as I understand it (both ways I saw) ie:
Attempt #1 as recorded in Configuration
network_scanner:
ip_range: 192.168.1.1-254
mac_mapping_1: 98:00:27:00:96:22;Archer Router;TPlink.
mac_mapping_2: 00:10:22:35:55:72;NAS;Segate BlackArmor 440.

and Attempt #2
network_scanner:
ip_range: 192.168.1.0/24
98:00:27:00:96:22;Archer Router;TPlink.
B1:36:57:84:31:CC;Orbi_Router;Netgear.

Both above correctly scan and display the generic LAN devices as expected BUT the above friendly names are NOT populated in the resulting scan, Custom Name and Custom Description for these devices just shows ā€œUnknow Deviceā€, just like all the other discovered devices. Iā€™m out of ideas

  • hopefully parvez can set me straight.

Where are you entering these configurations?

in HA configuration.yaml file