Managing devices
How do I remove a WLED device from the adapter?
In short: In Admin, you delete a device under "Devices" with the trash can icon, or in the instance settings with the red button in the "Remove" column. The adapter then removes all states of the device and stops its connection and timers. If the device is still running in your network, the adapter finds it again via Bonjour and creates it anew.
How to do it: in the device manager
- In Admin, open the "Devices" tab and select the instance
wled.<instance>. - Click the trash can icon next to the device ("Delete this device").
- Confirm the question "Do you really want to delete the device <device>?".
- The device disappears from the list. The log shows
<MAC> deleted.
How to do it: in the instance settings
- In Admin, open the settings of
wled.<instance>under "Instances". - In the device table, click the red button with the trash can icon in the "Remove" column.
- The dialog "Delete device confirmation" shows the name and IP address. Click "Delete Device".
- The message "Device deleted successfully" confirms the deletion. If something goes wrong, "Failed to delete device" appears.
CAUTION
When deleting, the adapter removes the device object wled.<instance>.<MAC> with all states below it. Scripts, VIS views and aliases that point to these states will then point to nothing. If the adapter creates the device again later, the states are recreated under the same MAC.
What the adapter cleans up when you delete a device
For that device, the adapter stops the watchdog and the timers, closes the WebSocket connection and forgets the device. This also happens if you delete the device object wled.<instance>.<MAC> directly in the "Objects" tab. The log then shows Device <MAC> was deleted from object tree, cleaning up backend processes and objects.
If the adapter doesn't know the device when you delete it in the "Objects" tab, for example because it was never connected, it reports Device <MAC> not found in devices array, cannot clean up backend processes and objects. The objects are deleted anyway; you can ignore the warning.
Why does the deleted device come back?
The adapter looks for WLED devices via Bonjour (mDNS). The search starts when the adapter starts and when you click "Discover new devices" in the "Devices" tab. If a device the adapter doesn't know answers, the adapter creates it anew. A deleted device that is still switched on in your network therefore reappears. There is no list that lets you exclude individual devices from the search.
So only delete a device once you no longer use it or have taken it off the network.
Delete a device from a script
With sendTo you delete a device by its IP address. The answer is success or failed:
sendTo('wled.0', 'deleteDevice', '192.168.x.y', (result) => {
log(`Delete device: ${result}`);
});If the adapter can't find a device with this IP address, the log shows Device with IP 192.168.x.y not found and the answer is failed.
Older versions
Up to v0.9.2: In the instance settings you can't delete a device that has been offline since the adapter started. "Failed to delete device" appears, and the log shows Device with IP 192.168.x.y not found. In that case, delete the device in the "Devices" tab or in the "Objects" tab.
From v0.9.3: Deleting in the instance settings also works for devices that are offline (#787). For this, the adapter also looks for the device in the object tree.
Up to v0.9.2: In the "Devices" tab, the dialog doesn't wait for the result and doesn't show an error. For instances from wled.10 upwards, deleting fails there. Use the "Objects" tab instead.
From v0.9.3: The dialog in the "Devices" tab waits for the result, shows "Can not delete device <device>" if something goes wrong, and also works for instances from wled.10 upwards (#914).
From v0.9.3: "Discover new devices" first stops the running search and then starts a new one. Searches no longer run side by side (#905).
See also: How and when does the adapter find my WLED devices automatically? · How do I add a device manually by IP?
How do I deal with devices that are switched off or offline, and how do I get rid of the log messages?
This section is still being written.
What happens to commands sent to a device that is switched off?
This section is still being written.