cyberjunky / home-assistant-arpscan_tracker

This component tracks devices using the arp-scan liinux command, it's very fast, and reasonably accurate.
MIT License
28 stars 4 forks source link

arpscan tracker no longer working correctly with HA core version 2023.5.0 and higher #13

Closed rbak69 closed 1 year ago

rbak69 commented 1 year ago

Hi Ron,

Please note that since the upgrade from home assistant core version 2023.4.6 to 2023.5.x (tried with minor version 0, 1 and 2) the arpscan tracker no longer seems to work correctly. It is only related to the core version and not the OS version. As soo as I downgrade to core version 2023.4.6 all works fine again.

Looking in the logs I can see the following details:

2023-05-08 13:17:07.970 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration arpscan_tracker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-05-08 13:18:16.242 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.arpscan_tracker 2023-05-08 13:18:16.246 DEBUG (SyncWorker_4) [custom_components.arpscan_tracker.device_tracker] Scanning... 2023-05-08 13:18:16.276 DEBUG (SyncWorker_4) [custom_components.arpscan_tracker.device_tracker] Scandata /bin/sh: arp-scan: not found 2023-05-08 13:18:16.278 DEBUG (SyncWorker_4) [custom_components.arpscan_tracker.device_tracker] Arpscan successful 2023-05-08 13:18:16.278 DEBUG (SyncWorker_4) [custom_components.arpscan_tracker.device_tracker] Scanner initialized 2023-05-08 13:18:16.470 DEBUG (SyncWorker_10) [custom_components.arpscan_tracker.device_tracker] arpscan last results [] 2023-05-08 13:18:28.646 DEBUG (SyncWorker_2) [custom_components.arpscan_tracker.device_tracker] Scanning... 2023-05-08 13:18:28.671 DEBUG (SyncWorker_2) [custom_components.arpscan_tracker.device_tracker] Scandata /bin/sh: arp-scan: not found 2023-05-08 13:18:28.672 DEBUG (SyncWorker_2) [custom_components.arpscan_tracker.device_tracker] Arpscan successful 2023-05-08 13:18:28.672 DEBUG (SyncWorker_2) [custom_components.arpscan_tracker.devicetracker] arpscan last results [] etc.

When I look at the log details in core version 2023.4.6 it looks like this:

_2023-05-08 14:11:58.621 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration arpscan_tracker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2023-05-08 14:14:52.702 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.arpscan_tracker 2023-05-08 14:14:52.718 DEBUG (SyncWorker_6) [custom_components.arpscan_tracker.device_tracker] Scanning... 2023-05-08 14:14:54.625 DEBUG (SyncWorker_6) [custom_components.arpscan_tracker.device_tracker] Scandata Interface: eth0, type: EN10MB, MAC: aa:bb:cc:dd:ee:ff, IPv4: 192.xxx.yyy.zzz 2023-05-08 14:14:54.627 DEBUG (SyncWorker_6) [custom_components.arpscan_tracker.device_tracker] Arpscan successful 2023-05-08 14:14:54.627 DEBUG (SyncWorker_6) [custom_components.arpscan_tracker.device_tracker] Scanner initialized 2023-05-08 14:14:54.827 DEBUG (SyncWorker_8) [custom_components.arpscan_tracker.device_tracker] arpscan last results [Device(mac='eth0,', name='eth0,', ip='Interface:', last_update=datetime.datetime(2023, 5, 8, 14, 14, 54, 626066, tzinfo=zoneinfo.ZoneInfo(key='Europe/Amsterdam'))), Device(mac='11:22:33:44:55:66', name='112233445566', ip='192.xxx.yyy.111', last_update=datetime.datetime(2023, 5, 8, 14, 14, 54, 626066, tzinfo=zoneinfo.ZoneInfo(key='Europe/Amsterdam'))) ... 2023-05-08 14:15:07.861 DEBUG (SyncWorker_4) [custom_components.arpscan_tracker.device_tracker] Scanning... 2023-05-08 14:15:09.733 DEBUG (SyncWorker_4) [custom_components.arpscan_tracker.device_tracker] Scandata Interface: eth0, type: EN10MB, MAC: b8:27:eb:a0:a6:1c, IPv4: 192.168.56.20 2023-05-08 14:15:09.734 DEBUG (SyncWorker_4) [custom_components.arpscan_tracker.device_tracker] Arpscan successful etc._

So to me it seems it is missing the configuration data as it does not seem to report back the network interface to use.

Are you aware of any changes between core version 2023.4.6 and the newest release 2023.5.x that requires any changes to your code. Or is this indeed a bug in the latest release for the home assistant core version?

Kind regards, René

cyberjunky commented 1 year ago

@rbak69 it's not a bug unfortunately, Frenck / HA core developers removed the arp-scan command from the latest image, they know this integration was using it, but they find it's not a core tool. so yeah... i need to announce that this integration must be phased out, I have seen some python replacement code for arp-scan somewhere, but have to take a look if we can integrate that into the code instead

cyberjunky commented 1 year ago

Since I thought I was the only user (I didn't check the usage stats yet) I didn;t make a problem out of it... but maybe if we 'all' open a ticket at HA, and ask for it, they will change their idea... since arp-scan is so much faster than the default ping tracker

rbak69 commented 1 year ago

Hi @cyberjunky I used the nmap tracker before but it was useless. Very unreliable.

When I supported you on the Toon custom component code I noticed your arpscan tracker that you have build and gave that a try. I love it as it works really well and seems to be very reliable. Worked very well for me last winter to determine whether anyone was at home and if there was not to put the Toon in manual mode and automatically lower the setpoint on the Toon. The moment someone arrived it would automatically put my Toon on automatic.

Would be great if we could get it working again. I am surprised no one else has noticed it stopped working with the most recent core version.

rbak69 commented 1 year ago

Raised the following ticket at HA: https://github.com/home-assistant/core/issues/92816

nickrout commented 1 year ago

Why not run apk add arp-scan in the commandline?

cyberjunky commented 1 year ago

@nickrout Most of the deployments use docker... there are some hacks to ben found on forum where you create a script and run in at each reboot using an automation... but haven't looked yet.

jamespo commented 1 year ago

I note 'Frenck' has already closed the issue, I'm surprised anyone bothers to make custom components with his attitude.

I've forked this component and will implement the scan functionality natively in python if possible.

cyberjunky commented 1 year ago

@jamespo I stopped coding official integrations, switched to only do some HACS ones, it's too cumbersome, managed to get 'fireservicerota' in the official distro, which serves a good cause (target audience volunteering firefighters in UK and NL) tried to get Bitvavo and Binance integration there as well, had some other good ideas too, but costed me too much time back then, since the framework and coding rules changed many times during development. and it's only a hobby... I will look if I get it working again, maybe with a custom install command like mentioned.

rbak69 commented 1 year ago

@cyberjunky, @jamespo, I have left a comment on the response from 'Frenck' but do not expect much of it. I feel really sad as this custom component worked very well. As mentioned it has proven to be very fast and reliable until the introduction of Core release 2023.5.0.

Would be great if you would be able to get this working again by adding the scan functionality natively in python as part of this component.

cyberjunky commented 1 year ago

@nickrout you where right, it simply worked installing arp-scan pkg at startup, thanks for the heads up! @rbak69 @jamespo Please check version 1.0.7 which installs it at startup, seems to work just fine here...

cyberjunky commented 1 year ago

@cyberjunky, @jamespo, I have left a comment on the response from 'Frenck' but do not expect much of it. I feel really sad as this custom component worked very well. As mentioned it has proven to be very fast and reliable until the introduction of Core release 2023.5.0.

Would be great if you would be able to get this working again by adding the scan functionality natively in python as part of this component.

The python version didn't return complete scans, and was not so fast either, I have now implemented installing of the pkg at startup.

Paul-Vdp commented 1 year ago

Once more the 'ivory tower' mentality strikes ... Sawing the feet from under a custom component for very questionable reasons, and slamming the door shut in our faces when questioned about it. I'm sure they never claimed to operate a democracy, but I'm equally sure they would not admit running an autocracy ...

rbak69 commented 1 year ago

I am indeed not impressed by the tone of the responses in the ticket I created with the Home Assistant core team. Nevertheless I am very happy with the support from you guys!

I have upgraded the custom component to version 1.0.7 and can confirm it is working again for me as well.

Thanks @cyberjunky, @jamespo and @nickrout for your quick responses and the support to get this workaround in place!

poudenes commented 1 year ago

EDIT: saw last post you updated it already. So my post was not needed....

Home Assistant 2023.5.2 Supervisor 2023.04.1 Operating System 10.1 Frontend 20230503.3 - latest

Im using this tool and get all my devices correct.

olivievranska commented 1 month ago

Hi guys,

I'm a bit new in HASS. Keen on first months and proud to be able to play Docker as additional new topic, one day after official HASS update all my working settings suddenly disappeared. I tried to build from the scratch again as IT professional keeping backups but I found that Frenck's Melody Boys removed much more core tools like nmcli, apt, etc. I googled a bit and was really shocked that the reason for such serious change was shitty official documentation. Yes, someone wrote bullshit that confuse users and they decided that they know better than users what is da best for us. No sorry, no announcement enough time before for developers of custom integrations to can take action.

It brings the new knowledge to me, I learn Docker hands on 😁 it is good but I really hate that I don't know if my HAG will run after official (!!!) update as before or if I have to try to save stubbed patient.

I just disabled HASS updates but due dependencies to used integrations it becomes unuseful in few days.

I have been thinking what's wrong with me when I'm pissed by asshole's disrespect and no one else in github nor community forum 😶

So thanks for this thread that I checked searching for how to solve "single unlinked entity that cannot be maintained nor deleted", you helped me more than you think ❤️

For your laugh - I bought HAG and fastly realised that good idea was again destroyed by idiot/s, someone who thought that 32 GB unchangeable eMMC and 2 USB connectors are enough to do all magic they announced in PR. Possibilities offered by HAY were closed because HAG is the official successor of HAY.

When I see someone like Frenck, I think "You can choose to be kind, a hero saving the world, someone who can do right things - and you choosed to be annoying asshole." 🙄

I'm not developer, I'm aaplication level specialist but if would make sense to complain in official spotlight in mass, you can count me in.

Enjoy the days ❤️

nickrout commented 4 weeks ago

God you are a rude person.

olivievranska commented 3 weeks ago

Hi guys,

I'm a bit new in HASS. Keen on first months and proud to be able to play Docker as additional new topic, one day after official HASS update all my working settings suddenly disappeared. I tried to build from the scratch again as IT professional keeping .................... Enjoy the days ❤️

I prefer action, not talks.

That's why arp-scan is working again on my HAG.

Installed addon "Run On Startup.d", after installation choosed "Create example scripts...". Taken homeassistant.sh, skipped first row contained #! /bin/bash (in my case, but it can be whatever based on env adjustment). Written down apk add --no-cache arp-scan. Saved, closed, HAG rebooted. Then arp-scan --localnet --interface=end0 --format='${ip}\t${mac}\t${vendor}\r' and voilá!

image