diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js
index 919eb5aa..74614de9 100644
--- a/scripts/pi-hole/js/groups-clients.js
+++ b/scripts/pi-hole/js/groups-clients.js
@@ -32,12 +32,12 @@ function reload_client_suggestions() {
continue;
}
- // Add MAC address
- var text = key.toUpperCase();
-
- // Check if this is a valid MAC address (skip mock devices)
- if (!utils.validateMAC(text)) {
- continue;
+ var text = key,
+ key_plain = key;
+ if (key.startsWith("IP-")) {
+ // Mock MAC address for address-only devices
+ key_plain = key.substring(3);
+ text = key_plain;
}
// Append host name if available
@@ -45,7 +45,7 @@ function reload_client_suggestions() {
text += " (" + data[key] + ")";
}
- sel.append($("").val(key).text(text));
+ sel.append($("").val(key_plain).text(text));
}
},
"json"
diff --git a/scripts/pi-hole/php/groups.php b/scripts/pi-hole/php/groups.php
index 275aee6e..3e818b0c 100644
--- a/scripts/pi-hole/php/groups.php
+++ b/scripts/pi-hole/php/groups.php
@@ -216,7 +216,7 @@ if ($_POST['action'] == 'get_groups') {
// Loop over results
$ips = array();
while ($res = $query->fetchArray(SQLITE3_ASSOC)) {
- $ips[$res['hwaddr']] = $res['name'] !== null ? $res['name'] : '';
+ $ips[strtoupper($res['hwaddr'])] = $res['name'] !== null ? $res['name'] : '';
}
$FTLdb->close();
@@ -227,8 +227,11 @@ if ($_POST['action'] == 'get_groups') {
// Loop over results, remove already configured clients
while (($res = $query->fetchArray(SQLITE3_ASSOC)) !== false) {
- if (isset($ips[$res['hwaddr']])) {
- unset($ips[$res['hwaddr']]);
+ if (isset($ips[$res['ip']])) {
+ unset($ips[$res['ip']]);
+ }
+ if (isset($ips["IP-".$res['ip']])) {
+ unset($ips["IP-".$res['ip']]);
}
}