network_scanner icon indicating copy to clipboard operation
network_scanner copied to clipboard

Edit network Config ?

Open IanAdd opened this issue 2 years ago • 12 comments

Hi, is there a way to edit the config rather than delete and recreate when I want to add a specific description to a MAC ?

IanAdd avatar Mar 11 '24 01:03 IanAdd

I would also like this. maybe a way of manually adding individual items after initial setup?

Trevsweb avatar Apr 20 '24 14:04 Trevsweb

I found that if you install a file browser on your home assistant you can navigate to homeassistant>.storage>core.config_entries

search for the network_mapper entry and then you can add/edit the maps. but remember the loop only looks for 25

Trevsweb avatar Apr 20 '24 16:04 Trevsweb

I found that if you install a file browser on your home assistant you can navigate to homeassistant>.storage>core.config_entries

search for the network_mapper entry and then you can add/edit the maps. but remember the loop only looks for 25

I tried to modify the file core.config_entries but the changes are not seen. There could be other configurations, perhaps in DB or other files that are maintained. In fact, if I uninstall the integration I expect it's configuration files to be deleted. Instead by reinstalling it again I find the following entries already present, and I wonder where they are stored?

image

Has anyone succeeded? I agree with @IanAdd request to implement a tool to reconfigure the integration...

Thanks

Jonny-T-cyber avatar Apr 23 '24 17:04 Jonny-T-cyber

I was looking for the same thing, have anyone found a way to do it? Thanks!

luispadarotto avatar Apr 28 '24 01:04 luispadarotto

To workaround this I edited the code on line 21 to hardcode my device list. It would be even better to read these in from a separate file, but for now this works for me.

self.mac_mapping = self.parse_mac_mapping(""" FF:FF:FF:FF:FF:01;Nest WiFi;\n FF:FF:FF:FF:FF:02;Upstairs Nest Protect;\n """)

lucky81 avatar Jul 23 '24 17:07 lucky81

To workaround this I edited the code on line 21 to hardcode my device list. It would be even better to read these in from a separate file, but for now this works for me.

self.mac_mapping = self.parse_mac_mapping(""" FF:FF:FF:FF:FF:01;Nest WiFi;\n FF:FF:FF:FF:FF:02;Upstairs Nest Protect;\n """)

I edited "/homeassistant/custom_components/network_scanner/sensor.py", added my personal MAC mappings as you suggested and restarted the component but I don't get any of the personal mappings in the scan itself. Any ideas?

lucazade avatar Aug 06 '24 00:08 lucazade

To workaround this I edited the code on line 21 to hardcode my device list. It would be even better to read these in from a separate file, but for now this works for me. self.mac_mapping = self.parse_mac_mapping(""" FF:FF:FF:FF:FF:01;Nest WiFi;\n FF:FF:FF:FF:FF:02;Upstairs Nest Protect;\n """)

I edited "/homeassistant/custom_components/network_scanner/sensor.py", added my personal MAC mappings as you suggested and restarted the component but I don't get any of the personal mappings in the scan itself. Any ideas?

OK I got it! I needed to restart also HA :)

lucazade avatar Aug 06 '24 00:08 lucazade

I have tried adding two of my devices as you suggested and then restarted but it doesn't work for me. Do you have any theories on what I might have done wrong? /Peter

(""" 00:1e:06:42:93:9b;HomeAssistant;Odroid;\n a4:e5:7c:a7:24:da;Plug Odroid Shelly;Shelly/Espressif;\n """)

HAPSagan avatar Aug 06 '24 13:08 HAPSagan

I have tried adding two of my devices as you suggested and then restarted but it doesn't work for me. Do you have any theories on what I might have done wrong? /Peter

(""" 00:1e:06:42:93:9b;HomeAssistant;Odroid;\n a4:e5:7c:a7:24:da;Plug Odroid Shelly;Shelly/Espressif;\n """)

Try removing the last semicolons before the newline character. It may also not like the slash after Shelly. Also remove the space at the start and end of the string.

lucky81 avatar Aug 06 '24 18:08 lucky81

I have now tried all three examples below, but so far no success. /Peter

    self.mac_mapping = self.parse_mac_mapping(""" A8:42:A1:3E:64:C4;Router;TP-Link Limited;\n """)
    self.mac_mapping = self.parse_mac_mapping(""" A8:42:A1:3E:64:C4;Router;TP-Link Limited\n """)
    self.mac_mapping = self.parse_mac_mapping(""" A8:42:A1:3E:64:C4;Router;TP-Link Limited """)

HAPSagan avatar Aug 07 '24 10:08 HAPSagan

I have now tried all three examples below, but so far no success. /Peter

    self.mac_mapping = self.parse_mac_mapping(""" A8:42:A1:3E:64:C4;Router;TP-Link Limited;\n """)
    self.mac_mapping = self.parse_mac_mapping(""" A8:42:A1:3E:64:C4;Router;TP-Link Limited\n """)
    self.mac_mapping = self.parse_mac_mapping(""" A8:42:A1:3E:64:C4;Router;TP-Link Limited """)

try the following: self.mac_mapping = self.parse_mac_mapping("A8:42:A1:3E:64:C4;Router;TP-Link Limited") and check for errors in logs

lucazade avatar Aug 07 '24 10:08 lucazade

That worked! Thank you. Can you tell me how to add another device? For example: 96.8A.4A.CB.AD.1E;Range Extender;TP-Link Limited

HAPSagan avatar Aug 08 '24 10:08 HAPSagan

I have updated to support unlimited devices through configuration.yaml

parvez avatar Sep 13 '24 19:09 parvez