Open geedsen opened 1 month ago
The instructions do not explain how install arp-scan in the HA container. I gave up.
Back in the days the tool was installed in the default ha image. But HA developers removed everything they think didn't belong there. So I added an install command which runs when my integration is started, but it seems it does not work anymore or fails on some install types, or both. I will have a look when I have some spare time.
Thanks.
I found the install code in https://github.com/cyberjunky/home-assistant-arpscan_tracker/blob/master/custom_components/arpscan_tracker/device_tracker.py#L60
And can report it fails because the package manager it assumes to be present isn't.
# whoami
root
# apk add arp-scan
-sh: apk: not found
#
Maybe instead of subprocess.getoutput("arp-scan "+options)
we could do with pure python https://pypi.org/project/arpwitch/ ?
@tomchiverton not sure, scapy and arpwitch need root permissions. What is the OS you run on, does it have another pkg manager installed?
It's running under KVM, as per https://www.home-assistant.io/installation/linux
So being root isn't an issue, I think? Output above was directly from 'virtsh console' after entering "root" at the HA login prompt
Does apt-get ...
command work instead of apk? Or also not available?
No, none of these are available in HAOS.
haos has "arp" commond, can add-on use this? like "arp |grep eth0".
here is log: :/config# arp |grep ether 192.168.100.185 ether 68:ab:bc:c6:d5:8f C enp5s0 ricecooker.lan ether cc:b5:d1:12:25:61 C enp5s0 curtainlivingroom.lan ether 7c:c2:94:5d:be:34 C enp5s0 curtainbedroom.lan ether 7c:c2:94:5e:2e:44 C enp5s0 xiaoduaudiospeaker.lan ether 88:2d:53:3f:f8:cf C enp5s0 gassensor.lan ether dc:ed:83:20:d8:21 C enp5s0 172.18.0.3 ether 02:42:ac:12:00:03 C br-fe6cca2934a7 xiaomi-humidifier-p3_mi ether 64:9e:31:38:90:06 C enp5s0 172.18.0.2 ether 02:42:ac:12:00:02 C br-fe6cca2934a7 youyanji.lan ether 68:ab:bc:b6:9b:28 C enp5s0 yugang.lan ether 68:ab:bc:b5:f2:d5 C enp5s0 boardlinkremote.lan ether 34:ea:34:c7:3c:28 C enp5s0 172.17.0.2 ether 02:42:ac:11:00:02 C docker0 mideafriger.lan ether 9c:c1:2d:be:dc:86 C enp5s0 172.17.0.3 ether 02:42:ac:11:00:03 C docker0 mijiahub.lan ether 54:ef:44:47:6d:5b C enp5s0 192.168.100.240 ether b8:50:d8:56:91:d5 C enp5s0 mediaclothesdryer.lan ether 10:2c:8d:fc:e6:99 C enp5s0 washer.lan ether 88:f2:bd:7b:38:d2 C enp5s0 dreamcleanbot.lan ether 70:c9:32:08:42:8b C enp5s0 iStoreOS.lan ether 60:be:b4:04:04:ed C enp5s0 192.168.100.77 ether c0:39:37:18:31:e2 C enp5s0 fryer.lan ether 68:ab:bc:93:ac:ef C enp5s0 ax6000.lan ether 3c:cd:57:fa:d6:00 C enp5s0 computerlight.lan ether cc:b5:d1:2e:bf:d6 C enp5s0
I can not locate that command here on the latest haos
pi@pi5:~ $ sudo virsh console haos
Connected to domain 'haos'
Escape character is ^] (Ctrl + ])
homeassistant login: root
Welcome to Home Assistant OS.
Use `ha` to access the Home Assistant CLI.
# arp
-sh: arp: not found
#
Well, I just tested the docker version of homeassistant, using the docker exec -it homeassistant /bin/bash command to enter homeassistant. The two may be different.
The two are very different. As I understand it, HA under Docker is "HA Core" and doesn't support addons, for instance; https://www.home-assistant.io/installation/#advanced-installation-methods
I installed it, added it to the configuration and restarted HA. But where do I see the results of the scan? And in terminal if I type arp-scan I get this: