# Can't use a custom device class

**URL:** <https://community.homey.app/t/cant-use-a-custom-device-class/48951>\
**Category:** Developers\
**Created:** [June 30, 2021, 11:57am UTC](https://community.homey.app/t/cant-use-a-custom-device-class/48951 "2021-06-30T11:57:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aybert](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Aybert](https://community.homey.app/u/Aybert)\
**Post date:** [June 30, 2021, 11:57am UTC](https://community.homey.app/t/cant-use-a-custom-device-class/48951/1 "2021-06-30T11:57:49Z")

</div>

Hi there

I’m just starting development for Homey, I fear I miss very basic knowledge.  
I want to customize my device class name, thus using the onMapDeviceClass method (which I actually did not notice in other apps)  
apparently the driver does not understand it. When pairing the devices, the discovery works well (I get my two devices displayed) but when I pair a device, it looks like the driver instanciates just another device class. I do not receive anything in the log, despite trying to log as much as i can.  
Is there somewhere a tuto showing all the steps to define a custom device class ? the above method is not sufficient by itself ?  
Thanks  
[[https://github.com/Aybert59/com.messiant.orangetv](https://github.com/Aybert59/com.messiant.orangetv)]

---

<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:** [June 30, 2021, 12:08pm UTC](https://community.homey.app/t/cant-use-a-custom-device-class/48951/2 "2021-06-30T12:08:54Z")

</div>

Private repo?

---

<div class="post-metadata">

**Author:** ![Aybert](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Aybert](https://community.homey.app/u/Aybert)\
**Post date:** [June 30, 2021, 2:24pm UTC](https://community.homey.app/t/cant-use-a-custom-device-class/48951/3 "2021-06-30T14:24:52Z")

</div>

not anymore, sorry

---

<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:** [June 30, 2021, 2:40pm UTC](https://community.homey.app/t/cant-use-a-custom-device-class/48951/4 "2021-06-30T14:40:32Z")

</div>

`STBDevice` will be undefined here: [com.messiant.orangetv/driver.js at master · Aybert59/com.messiant.orangetv · GitHub](https://github.com/Aybert59/com.messiant.orangetv/blob/master/drivers/settopbox/driver.js#L59)

Adding `const STBDevice = require('./device')` at the top of `driver.js` will import it (although at the moment, you only have one device class so there’s no need to use `onMapDeviceClass` at all).
