# Custom insight reporting

**URL:** <https://community.homey.app/t/custom-insight-reporting/111381>\
**Category:** Developers\
**Created:** [June 11, 2024, 6:06pm UTC](https://community.homey.app/t/custom-insight-reporting/111381 "2024-06-11T18:06:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreasQlight](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreasqlight/32/79555_2.png) [@AndreasQlight](https://community.homey.app/u/AndreasQlight)\
**Post date:** [June 11, 2024, 6:06pm UTC](https://community.homey.app/t/custom-insight-reporting/111381/1 "2024-06-11T18:06:28Z")

</div>

Can you set your own insight values? Like I have rmsVoltage, but also rmsVoltagePhaseB and rmsVoltagePhaseC.

Can I report these from a Zigbee driver? Could not really find anything related to setting “insight data” in the documentation. Seems to just happen magically when you setCapabilityValue()

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [June 11, 2024, 6:43pm UTC](https://community.homey.app/t/custom-insight-reporting/111381/2 "2024-06-11T18:43:49Z")

</div>

Not sure I understand, but you can store them as custom capabilities and then you will get insights for those. But that’s probably not what you meant ?

---

<div class="post-metadata">

**Author:** ![Eko\_taas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eko_taas/32/74256_2.png) [@Eko\_taas](https://community.homey.app/u/Eko_taas)\
**Post date:** [June 11, 2024, 8:02pm UTC](https://community.homey.app/t/custom-insight-reporting/111381/3 "2024-06-11T20:02:03Z")

</div>

If you create Advanced Virtual Device (app) with insight, you can store any value there and see on trends…

Would this work for you?

---

<div class="post-metadata">

**Author:** ![AndreasQlight](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/andreasqlight/32/79555_2.png) [@AndreasQlight](https://community.homey.app/u/AndreasQlight)\
**Post date:** [June 12, 2024, 10:10am UTC](https://community.homey.app/t/custom-insight-reporting/111381/4 "2024-06-12T10:10:49Z")

</div>

Looks like this is probably what I need. I tried setting this up, but I get an error message when I try to follow the examples in [old](https://apps-sdk-v2.developer.athom.com/tutorial-Drivers-Capabilities.html) or [new](https://apps.developer.homey.app/the-basics/devices/capabilities#custom-capabilities) docs.

.homeycopose/capabilities/meter\_rmsVoltagePhaseA.json

```auto
{
  "type": "number",
  "title": {"en" : "Voltage Phase A"},
  "units": {"en" : "V"},
  "getable": true,
  "setable": false,
  "uiComponent": null,
  "uiQuickAction": false,
  "icon": "/assets/icon.svg",
  "insights": true
}

```

.drivers/qudo/driver.compose.json

```auto
{
...
  "capabilities": [
    "dim",
    "meter_power",
    "measure_power",
    "measure_voltage",
    "meter_rmsVoltagePhaseA",
    "onoff"
  ],
...
}

```

.drivers/qudo/device.js

```auto
class Device extends ZigBeeDevice {
    ...

   async onNodeInit({ zclNode }) {
      ...

       await this.setCapabilityValue('meter_rmsVoltagePhaseA', this.voltagePhaseA)
          .catch((err) => {
            this.error('Error setting rmsVoltage capability:', err);
          });

      ...
    }
    
    ...
}

```

I get the error

```auto
2024-06-12T09:58:29.118Z [err] [Homey:665877af2fb1e463cd51143e] [ManagerDrivers] [Driver:qudo] [Device:a7988fb9-117d-4e6e-8c7f-40852cb5383f] Error setting rmsVoltage capability: Invalid Capability: meter_rmsVoltagePhaseA

```

I feel like I’ve missed something obvious here…

Edit:  
What I missed was that I needed to remove and readd the device…

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [June 12, 2024, 12:21pm UTC](https://community.homey.app/t/custom-insight-reporting/111381/5 "2024-06-12T12:21:23Z")

</div>

If you add a capability to the driver, already existing devices won’t get this capability automatically.  
You have to re-add the device or add the capability in onInit() using this.addCapability() … and perhaps check before with if (!this.hasCapability()).
