Hello,
I have some devices listed under known_devices.yaml.
They show up in HA under device_tracker
However, the mac address is not listed in the state attributes even though it is defined in the known_devices.yaml.
I want to find the ip address of the device using the mac address in an automation.
Right now, I am doing this in a very complicated way.
My way currently:
device tracker detects the device in “home”
calls a shell command to run a sh script located in a local folder
the script takes manually entered MAC address in an automation as variable to search the ARP table and write the result in a file called ip.txt.
HA uses file sensor to read the ip.txt and writes these to the input_text.
This way is awfully complicated.
If there was a way to store stdout of the shell command or read MAC address from the known_devices.yaml, it would be a lot simpler.
Unfortunately, it doesn’t seem to work for me.
I use Asus-wrt integration to populate the device_tracker.
Maybe, this integration doesn’t record MAC addresses. However, they are listed under known_devices.yaml. Hmm, weird.
So, it could depend on the Device Tracker integration you use, because mine is AVM Fritzbox and your’s AsusWRT. You could temporarily switch to NMap to check, if this changes things.
Yeah, I suspected as such.
But, it is weird that MAC address is listed under known_devices.yaml but not exported to the HA state attributes with Asuswrt integration unlike your AVM Fritzbox. Should I open a bug report or something I wonder?
I suggest waiting for the next release of HA, because there has been a commit after 2021.2.3, which obviously (I am not familiar with Python) addresses this.
It has been addressed like you said.
But now it has a different problem. It cannot accurately detect wireless aimesh nodes. It produces weird MAC addresses.