# Get list of all connected devices to homey hub

**URL:** <https://community.homey.app/t/get-list-of-all-connected-devices-to-homey-hub/99079>\
**Category:** Developers\
**Tags:** app, homey-pro\
**Created:** [December 27, 2023, 1:31pm UTC](https://community.homey.app/t/get-list-of-all-connected-devices-to-homey-hub/99079 "2023-12-27T13:31:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaume\_Lemer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/guillaume_lemer/32/83144_2.png) [@Guillaume\_Lemer](https://community.homey.app/u/Guillaume_Lemer)\
**Post date:** [December 27, 2023, 1:31pm UTC](https://community.homey.app/t/get-list-of-all-connected-devices-to-homey-hub/99079/1 "2023-12-27T13:31:46Z")

</div>

Hello everyone,

I’'m new into the Homey community and wanted to create a little plugin to get by lights behaving has i wanted.  
I started at first with a little script, where i can use 2 calls to retrieve the list of zones and the list of all the devices connected to my hub

```auto
const devices = Object.values(await Homey.devices.getDevices());
const zones = Object.values(await Homey.zones.getZones());

```

All is working fine with that script so i was happy and wanted to switch to a little plugin of my own to make things a bit more clean.

But, when i’m in my “app.ts” i don’t find anyway to get all the devices connected to the hub. Only the devices created (inside of the drivers folder) inside of the plugin, and that i don’t want. I would like to be able to just fetch all the devices connected to the hub simply, and be able to , for exemple to a

```auto
device.setCapabilityValue("onoff", false);

```

Is there any way to get the list of all the devices connected to the hub inside of the plugin, and not just the devices managed by the plugin itself ?

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [December 27, 2023, 1:38pm UTC](https://community.homey.app/t/get-list-of-all-connected-devices-to-homey-hub/99079/2 "2023-12-27T13:38:13Z")

</div>

you need the WebAPI from within the App if you want to do things out of your own app.

> **[Welcome to the Web API documentation 👋 | Homey Web API](https://api.developer.homey.app/)**
>
> 🌍 Learn how to build great integrations.

> The Web API is also used by [HomeyScript](https://homey.app/a/com.athom.homeyscript) and apps using the `homey:manager:api` permission. [Learn more »](https://athombv.github.io/node-homey-api/HomeyAPI.html#.createAppAPI)

> **[Permissions | Homey Apps SDK](https://apps.developer.homey.app/the-basics/app/permissions#which-apps-may-use-the-api-permission)**
>
> Homey Apps require permissions for certain functionality, learn which permissions exist and how to request them.

---

<div class="post-metadata">

**Author:** ![Guillaume\_Lemer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/guillaume_lemer/32/83144_2.png) [@Guillaume\_Lemer](https://community.homey.app/u/Guillaume_Lemer)\
**Post date:** [December 30, 2023, 4:38pm UTC](https://community.homey.app/t/get-list-of-all-connected-devices-to-homey-hub/99079/3 "2023-12-30T16:38:46Z")

</div>

Taking the risk to look full noob here, but when i try to use the AthomCloudAPI (from : [https://api.developer.homey.app/](https://api.developer.homey.app/)) it seems that the app crash because it cannot find the dependency.

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/d/fddd320d2dd3d578d3c026c6579517f16076c846.png)

For now i just wanted to have the simple devices list as in the exemple, but it crash instanly…  
Here is the little code snipped i have currently (the same of the one of the doc)

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/c/fc3103606cf354d552ca052d2f2eff33e379187c.png)

Any idea on what i’m missing there ?
