Retrieve MAC address via SSDP

@pierre-gilles

For automatic MAC address recovery, I looked at what scanNetwork('ssdp') currently returns.

For my LG TV, I get:

{
  "source_ip": "192.168.1.71",
  "source_port": 49363,
  "headers": "..."
}

The MAC address is not present in the SSDP response itself.

Would it be possible for the scan to add a source_mac when it can resolve the IP via the host’s ARP/neighbor table?

For example:

{
  "source_ip": "192.168.1.71",
  "source_mac": "64:e4:a5:b4:88:74",
  "source_port": 49363,
  "headers": "..."
}

This would allow integrations using Wake-on-LAN to automatically retrieve the MAC address during discovery, without asking the user to enter it manually.

What do you think?

Hi @spenceur!

Since Gladys 5.0, the SSDP scan can return source_mac.

The SSDP response itself still does not contain the MAC. Gladys looks for it in the system’s neighbor table (ARP), based on the IP address, and adds it to the result when it finds it. If the machine has never communicated with this device before, the field may be missing: a prior exchange (a ping, a connection) usually fills the table.

I’m moving this topic to « Delivered Requests ». If there’s still a case that doesn’t match, open a new topic: it will be easier to follow.