HomeAssistant not capable to include devices without known MAC address?

I think I found a really annoying issue regarding HomeAssistant: Obviously, there is a quite strange restriction to detect devices within network: MAC address availability.

As I have permanently connected VPN clients with own subnet within my network (i. e. holiday home), these devices can not be resolved by their MAC (as they are not “physically” connected to my network), but only by their IP.

Is there any solution - any way of configuration - to also track devices “without” MAC, but by their IP? MAC address may be unique and always remain the same, but there are also cases (see mine) where only IP is available - and if IP is static, this should not be any problem.

Can anybody help? I hope, there is another solution than having a single HomeAssistance instance for every remote place permanently connected via VPN… This would mean much more cost regarding to hardware, maintenance time … and so on.

You maybe able to use ARP and add a static entry on you HA box. Still needs the mac address of remote device though to map to

On Windows the command is arp -s ippadress macaddress

not sure if what it would be on a linux flavour, but google should help

I think is only true for discovery of devices, manually configuring components would probably solve the issue? Maybe this could help;

@aidbish
I have already tried to arp -s , but Operation not permitted.

What I would need, is a feature, to map an IP without a known MAC to a “fantasy MAC”. A way to manipulate ARP cache HASS sees.

@sjee
Problem is, that my HASS runs inside a docker container. So I would need a solution directly in HASS, as I can not do any changes inside the container except configuring HASS.

I understand but it’s only for discovery of devices not if you manually configure them I assume. What devices are you actually talking about? Are you running HASS.io in a container?

but you are ONLY talking about the ‘discovery’ component. You can freely configure IP addresses for your devices, and it doesn’t need a MAC at all.

I simply run a docker container with latest HASS version at an Ubuntu Server. No HassIo.

Although still no joy, I have found out some things:
After having added a file here /etc/network/if-up.d/ with

arp -i eth0 -s ip mac

and executed it, I could see the entry in /proc/net/arp. Now, I definitely have an IP → MAC mapping for the VPN connected device. So far, so good.

Then, I put network: host option inside my docker-compose file to make my container see and use my host’s network configurations and inside HASS config added this:

device_tracker:
platform: fritz
host: 192.168.44.1
username: myHassUser
password: !secret http_password
track_new_devices: True

Then, the HASS log said “Successfully connected to FRITZ!Box 6890 LTE” - yeaaaahhhh, device is found now! But later on, in the HASS UI, I can not see any of my connected Comet DECT climate devices!

So I put a second entry to my fritzbox-section (1st Fritzbox was already there before - now I want to add a second one which is permanently connected via VPN to the 1st one):

fritzbox:
devices:
- host: IP 1st Fritzbox
username: myHassUser
password: !secret http_password
- host: 2nd Fritzbox
username: myHassUser
password: !secret http_password

But then log says:

2018-08-17 14:11:41 INFO (MainThread) [homeassistant.setup] Setting up fritzbox
home-assistant | 2018-08-17 14:11:42 WARNING (SyncWorker_12) [pyfritzhome.fritzhome] login failed 0000000000000000
home-assistant | 2018-08-17 14:11:42 WARNING (SyncWorker_12) [homeassistant.components.fritzbox] Login to Fritz!Box myIP as myHassUser failed

When I log in via the Fritzbox UI with exactly same credentials, I can log in. But why HASS can’t?

Quite strange: It tries to log in to the device BEFORE device_tracker above has come, althought device_tracker section is defined above fritzbox section in config.

Sorry for not getting along with the forum’s editor - formatting is correct inside my config, but here I can not manage it appearing like it is inside my config. Sorry again. And still hoping for help.

Can you use the ping tracker?

use the </> tags around the code.

CRAZYYY!!!

I removed the credentials from device_tracker block and then, it logged in to my second box. After having restarted my docker, same error as before: Login fails!

Seems to be a bug, I suppose a timing issue. Obviously, by conincidence, this very first and only time it worked, device detection was finished before login trial…

Do you think, I should report it as bug and if yes, how and where could I do this?

Ok, I’m a bit confused here. Sure you need the host option for discovery to work (as stated in the docs). But… what has the Fritzbox problem got to do with your original question? Better post the issue in the topic where you’ve been discussing it already.

The problem is not due to multiple Fritzbox access, but accessing Fritzbox with unknown MAC. Even if I throw out my first Fritzbox, the problem persists. That is why I opened a new discussion.

With my “real” local Fritzbox, I have never needed any device tracker - simply fritzbox block was sufficient.

With ARP tweak, the 2nd box gets detected by device tracker with platform fritz, but mostly not with platform fritzbox.

Do you think, I should post into the other thread nevertheless? And don’t worry - I am confused now, too, as it really got connected for one single time! :wink:

Well @hthiery is the developer of the component (as far as I know) so maybe he has something usefull to say about this.

Okay, I will do so