diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md index bc51ad4c0..46768db9b 100644 --- a/docs/configuration/configuration.md +++ b/docs/configuration/configuration.md @@ -64,4 +64,7 @@ advanced: # Availability timeout in seconds, disabled by default (0). # When enabled, devices will be checked if they are still online. availability_timeout: 0, + # Blacklist devices from being checked for availability + availability_blacklist: + - DEVICE_FRIENDLY_NAME ``` diff --git a/lib/extension/availability.js b/lib/extension/availability.js index 13aee06db..d34cc584b 100644 --- a/lib/extension/availability.js +++ b/lib/extension/availability.js @@ -22,9 +22,18 @@ class Availability { this.timers = {}; this.pending = []; this.state = {}; + + // Initialize blacklist + this.blacklist = settings.get().advanced.availability_blacklist.map((e) => { + return settings.getIeeeAddrByFriendlyName(e) || e; + }); } isPingable(device) { + if (this.blacklist.includes(device.ieeeAddr)) { + return false; + } + if (pingableDevices.find((d) => d.zigbeeModel.includes(device.modelId))) { return true; } diff --git a/lib/util/settings.js b/lib/util/settings.js index c29517ccd..86007f742 100644 --- a/lib/util/settings.js +++ b/lib/util/settings.js @@ -23,6 +23,7 @@ const defaults = { // Availability timeout in seconds, disabled by default. availability_timeout: 0, + availability_blacklist: [], /** * Home Assistant requires ALL attributes to be present in ALL MQTT messages send by the device.