# Error: Not Found: Device with ID xxx

**URL:** <https://community.homey.app/t/error-not-found-device-with-id-xxx/119627>\
**Category:** Developers\
**Created:** [November 3, 2024, 8:07am UTC](https://community.homey.app/t/error-not-found-device-with-id-xxx/119627 "2024-11-03T08:07:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pieterv123](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pieterv123/32/13353_2.png) [@Pieterv123](https://community.homey.app/u/Pieterv123)\
**Post date:** [November 3, 2024, 8:07am UTC](https://community.homey.app/t/error-not-found-device-with-id-xxx/119627/1 "2024-11-03T08:07:59Z")

</div>

For a a few months I am getting a lot of this errors: (a lot of emails)

I assume a device is deleted, but the app is still doing all the actions (capabilities, timers, etc.)

> Error: Not Found: Device with ID ed2d613a-b697-4f21-84fb-2c6e2e814d97  
> at Remote Process  
> at HomeyClient.emit (/node\_modules/@athombv/homey-apps-sdk-v3/lib/HomeyClient.js:44:23)  
> at Object.emit (/node\_modules/@athombv/homey-apps-sdk-v3/manager/drivers.js:78:54)  
> at Object.emit (/node\_modules/@athombv/homey-apps-sdk-v3/lib/Driver.js:126:50)  
> at /node\_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:570:27  
> at process.processTicksAndRejections (node:internal/process/task\_queues:95:5)  
> at Forecastsolardevice.setCapabilityValue (/node\_modules/@athombv/homey-apps-sdk-v3/lib/Device.js:562:23)  
> at /app/drivers/forecastsolar/device.js:285:18  
> at process.processTicksAndRejections (node:internal/process/task\_queues:95:5)

In my code I have added, but without success

> onDeleted() {  
> clearTimeout(this.PollingTimeOut);  
> clearTimeout(this.StartPolling);  
> this.homey.clearInterval(this);  
> this.homey.clearTimeout(this);  
> this.log(‘forecastsolar has been deleted’);  
> }

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [November 3, 2024, 8:44am UTC](https://community.homey.app/t/error-not-found-device-with-id-xxx/119627/2 "2024-11-03T08:44:46Z")

</div>

You have some strange things in your code:

```auto
clearTimeout(this.PollingTimeOut);
this.PollingTimeOut();

```

You’re clearing a timeout that has the same name as a method? That can’t be right.

A timer is the result of a call to `setTimeout/setInterval`, and that’s what you need to clear:

```auto
this.PollingTimer = this.homey.setTimeout(...);
...
this.homey.clearTimeout(this.PollingTimer);

```

Also this:

```auto
clearTimeout(this.PollingTimeOut);
clearTimeout(this.StartPolling);
this.homey.clearInterval(this);
this.homey.clearTimeout(this);

```

You shouldn’t be using `clearTimeout` at all, only `this.homey.clearTimeout` (same for `clearInterval`).
