# How to get a devices zone name

**URL:** <https://community.homey.app/t/how-to-get-a-devices-zone-name/47325>\
**Category:** Developers\
**Tags:** homeyscript\
**Created:** [May 12, 2021, 9:31am UTC](https://community.homey.app/t/how-to-get-a-devices-zone-name/47325 "2021-05-12T09:31:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jens.Hummelmose](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jens.hummelmose/32/34209_2.png) [@Jens.Hummelmose](https://community.homey.app/u/Jens.Hummelmose)\
**Post date:** [May 12, 2021, 9:31am UTC](https://community.homey.app/t/how-to-get-a-devices-zone-name/47325/1 "2021-05-12T09:31:19Z")

</div>

Hi.

Sorry for asking a simple question - I have started developing in Homeyscript (I usually develop in C# or PHP).

I wat to do a Danfoss Ally \<-\> DeCONZ thing, and for that I need to get the zone name of a device. I easy get the zone-id of the device, but I can’t find a way to look up the zone name via the ID.

I can’t find anyting in the documentation regarding that. In my test loop I can get zone name in one loop and zone id in another. Isn’t there an easier way?

// Get all devices

const devices = await Homey.devices.getDevices();

const zones = await Homey.zones.getZones();

for (const zone of Object.values(zones))

{

log(`\nZone '${zone.name}'`);  
log(`\nZone '${zone.id}'`);

}

for (const device of Object.values(devices)) {  
if (device.class === ‘thermostat’) {  
log(`\nZone '${device.zone}'`);  
log(`\nZone '${Homey.zones.getZone(device.zone)}'`);  
}

}

---

<div class="post-metadata">

**Author:** ![Jens.Hummelmose](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jens.hummelmose/32/34209_2.png) [@Jens.Hummelmose](https://community.homey.app/u/Jens.Hummelmose)\
**Post date:** [May 12, 2021, 10:12am UTC](https://community.homey.app/t/how-to-get-a-devices-zone-name/47325/2 "2021-05-12T10:12:04Z")

</div>

OK.

I found : device.zoneName

Why isn’t this in the documentation or part of the intellisense.
