Can't remove devices - Cannot invoke method contains() on null object

So, I was just doing FW update on my Aeotec Home Energy Meter Gen5 that required to remove it from my network. I did that, updated re-add and noticed that now I have 2 meters in my things list, tried removing and adding again and now I have 3 meters (12 devices in total as I use a composite DTH i created). When I try to remove them from IDE I get:

Cannot invoke method contains() on null object

Anyone else having this problem?


I am having the exact same problem. I have submitted a support ticket. I encourage you to do the same to help highlight the problem.

I ran into the same thing today. It’s a bug. SmartThings is apparently not allowing deleting devices that are not directly associated with a hub. You’ll see this if you log into the IDE and go to that device.

The workaround is easy enough - edit the device, choose a hub, then save. Now you can delete the device as normal.


Ah, thank you good sir. For some reason Child Devices for my Meter were not assigned to the HUB. I have no idea why.

I think it’s actually very common for hub to be null for custom and 3rd party integrations. This a recent bug that has caused problems when trying to delete those, though.

1 Like

I wrote one other ‘multi device’ DTH and all child devices using it have HUB assigned but I added them some time ago and as you said - it’s a recent bug.

I was having the same problem
Cannot invoke method contains() on null object
What I had to do is go in & remove the thing (my case trying to remove an old android phone) from all smartthings ir was connected to then & only then would it remove.

Thank you very much. I’ve looked it up on Google for months and you are the only one that comes up with right solution.

Hi, I tried the above approaches by trying to associate it to a hub and removing any smartapps from it. But it still does not allow me to delete the device.

Still showing the error message - Cannot invoke method removeChildDevice() on null object

Background - installing a HS105. My steps are
(1) Add new HS105 using Kasa apps
(2) Ensure HS105 is included in the device handler file.
(3) Goto IDE-my devices to add the HS105 unique device ID…
(4) Notice HS105 is added to the smartthing-classic but not able to control switching it and off.

Trying to uninstall it and then noticed that I was not able to delete the device.

Pointers appreciated.


Change the type for other than Child… in IDE for TV type for example then save. Delete action can be operated.