There is any way to list all the devices or entities with their mac addresses?
I try to identify a device from my network.
If I could know a list similar to this:
Sonoff Device - MAC xx:xx:xx:xx:xx:xx
At least I could know what type of deice is what I search for, then I can search deeper from the specific integration…
{% set devices = states | map(attribute='entity_id') %}
{% for device in devices %}
{% set bun = device_attr(device, 'connections') %}
{% if bun is not none and 'mac' in bun | map(attribute='0') | list %}
{% for connection in bun %}
{% if connection[0] == 'mac' %}
{{ device }} - {{ connection[0] }} - {{ connection[1] }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
Just a small addition, putting a hyphen after each of the {% openings suppresses the new line that would otherwise be output.
{%- set devices = states | map(attribute='entity_id') %}
{%- for device in devices %}
{%- set bun = device_attr(device, 'connections') %}
{%- if bun is not none and 'mac' in bun | map(attribute='0') | list %}
{%- for connection in bun %}
{%- if connection[0] == 'mac' %}
{{ device }}, {{ connection[0] }}, {{ connection[1] }}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endfor %}
When I first ran the script I thought it had only found 1 device before I realised I needed to scroll past all the blank lines.
Hi, I found that if you use the below URL it will list all the MAC addresses and provide you the ability to sort and and search for specific MAC addresses registered within Home Assistant. Hope this helps.