# Battery status report

**URL:** https://community.homey.app/t/battery-status-report/137581
**Category:** Ideas & Suggestions
**Created:** [June 4, 2025, 10:39am UTC](https://community.homey.app/t/battery-status-report/137581 "2025-06-04T10:39:38Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Jocke\_Wallen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jocke_wallen/32/76525_2.png) [@Jocke\_Wallen](https://community.homey.app/u/Jocke_Wallen)
#### Post date: [June 4, 2025, 10:39am UTC](https://community.homey.app/t/battery-status-report/137581/1 "2025-06-04T10:39:38Z")

</div>

A question from a novice user:

Is it possible to script a report in Homey Pro 2013 containing:  
device name , battery type, battery status

I.E.  
Thermometer1, CR2450, 77%

battery type = comment/note for device  
I’ve added battery type as comment for each battery powered device.

If this is possible please help understanding how I can achieve this.

---

<div class="post-metadata">

### Author: ![WimS](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wims/32/16494_2.png) [@WimS](https://community.homey.app/u/WimS)
#### Post date: [June 4, 2025, 11:09am UTC](https://community.homey.app/t/battery-status-report/137581/2 "2025-06-04T11:09:32Z")

</div>

Somewhere in the forum you can find a few Homey scripts that you can use in a flow telling you the battery levels or treshholds of all your devices.  
Just look it up in [Search results for 'battery' - Homey Community Forum](https://community.homey.app/search?q=battery)

---

<div class="post-metadata">

### Author: ![Jocke\_Wallen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jocke_wallen/32/76525_2.png) [@Jocke\_Wallen](https://community.homey.app/u/Jocke_Wallen)
#### Post date: [June 4, 2025, 11:19am UTC](https://community.homey.app/t/battery-status-report/137581/3 "2025-06-04T11:19:06Z")

</div>

Actually no, I didn’t find anything useful or understandable for a non programmer.  
And the titles showing closely useful info are like in german (?).  
TY anyway…

---

<div class="post-metadata">

### Author: ![SunBeech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sunbeech/32/111391_2.png) [@SunBeech](https://community.homey.app/u/SunBeech)
#### Post date: [June 4, 2025, 12:57pm UTC](https://community.homey.app/t/battery-status-report/137581/4 "2025-06-04T12:57:53Z")

</div>

If your purpose is purely getting insight into that info, then you can also use the battery overview in the mobile app (via More … \> Batteries)

 ![IMG_1887](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/2/3232886e464af587d6533bf7ae905882d18de4db.jpeg)

Or the detailed/list view of the devices page in the web app.

---

<div class="post-metadata">

### Author: ![Jocke\_Wallen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jocke_wallen/32/76525_2.png) [@Jocke\_Wallen](https://community.homey.app/u/Jocke_Wallen)
#### Post date: [June 4, 2025, 1:15pm UTC](https://community.homey.app/t/battery-status-report/137581/5 "2025-06-04T13:15:36Z")

</div>

TY!  
The mobile “More - Batteries” is more or less what I’d like to see on web as well…  
On the devices You need to go device by device, not as visual as on mobile app.  
Well, if that’s the way then that’s the way then.  
Thanks!

---

<div class="post-metadata">

### Author: ![SunBeech](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sunbeech/32/111391_2.png) [@SunBeech](https://community.homey.app/u/SunBeech)
#### Post date: [June 4, 2025, 1:30pm UTC](https://community.homey.app/t/battery-status-report/137581/6 "2025-06-04T13:30:54Z")

</div>

In the web app, if you select the list view:

 ![IMG_1888](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/5/3548723db6ce1926b00abe29d6f8899a357d20e2.jpeg)

Then you get a list of your devices, which includes the battery percentage and type:

 ![IMG_1890](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/9/d9177f95335890842897eaf2898ec68850817999.jpeg)

---

<div class="post-metadata">

### Author: ![Jocke\_Wallen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jocke_wallen/32/76525_2.png) [@Jocke\_Wallen](https://community.homey.app/u/Jocke_Wallen)
#### Post date: [June 4, 2025, 4:12pm UTC](https://community.homey.app/t/battery-status-report/137581/7 "2025-06-04T16:12:16Z")

</div>

Thanks, that’s quite close to what I’m looking for.  
As some devices doesn’t have battery type, I have added the info in additional info fields for those devices (like IKEA sensor and remote).  
I was hoping that even the additional info could be made visible somehow.  
This is good enough though.  
Thanks!

---

<div class="post-metadata">

### Author: ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)
#### Post date: [June 4, 2025, 10:52pm UTC](https://community.homey.app/t/battery-status-report/137581/8 "2025-06-04T22:52:09Z")

</div>

This “case” kept me awake for 3 nights, now I found a way to get the Notes field data, and edited a script for battery level reporting.  
Can you test the code below?

 ![1000049701](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/b/bbeddb609ecd5f3b6b41ba5e43fc43deaed63ef9.jpeg)

 ![1000049699](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/4/74ac5345aadc2aeaca6e9d999b9fdc78f2e6e7c1.jpeg)

Code

```auto
const devicesObject = await Homey.devices.getDevices({ filter: { class: 'sensor' } });
const deviceKeys = Object.keys(devicesObject);
const batteryLevels = [];

for (const deviceKey of deviceKeys) {
  const device = devicesObject[deviceKey];
  const batteryCapability = device.capabilitiesObj?.measure_battery;
    if (batteryCapability) {
      const batteryLevel = batteryCapability.value;
      const deviceName = device.name;
      const batteryInfo = device.energyObj.batteries;
      const deviceNote = device.note;
      batteryLevels.push({ name: deviceName, battery: batteryLevel, info: batteryInfo, note: deviceNote });
      }
  }
// Sort on charge level low > high
batteryLevels.sort(function(a, b) {
return a.battery - b.battery;
});

const batteryInfoText = batteryLevels.map((device) => `- ${device.name} \nCharge: ${device.battery}% \nInfo: ${device.info} \nNote: ${device.note}`).join('\n');
      
console.log('Device Battery info:\n' + batteryInfoText);
// for use in Homeyscript flow cards:
return 'Device Battery info:\n' + batteryInfoText;

```

NB  
To have it formatted like:

> [@Jocke\_Wallen](#):
>
> Thermometer1, CR2450, 77%

You just have to change this line

```auto
const batteryInfoText = batteryLevels.map((device) => `- ${device.name} \nCharge: ${device.battery}% \nInfo: ${device.info} \nNote: ${device.note}`).join('\n');

```

into this:

```auto
const batteryInfoText = batteryLevels.map((device) => `${device.name}, ${device.info}, ${device.note}, ${device.battery}%`).join('\n');

```

Output:

 ![1000049703](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/a/9a7c98d6b11c8d97caca6f102ec43fc7e4a33e62.jpeg)

---

<div class="post-metadata">

### Author: ![Jocke\_Wallen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jocke_wallen/32/76525_2.png) [@Jocke\_Wallen](https://community.homey.app/u/Jocke_Wallen)
#### Post date: [June 5, 2025, 5:08am UTC](https://community.homey.app/t/battery-status-report/137581/9 "2025-06-05T05:08:07Z")

</div>

> [@Peter\_Kawa](#):
>
> `const batteryInfoText = batteryLevels.map((device) => `${device.name}, ${device.info}, ${device.note}, ${device.battery}%`).join('\n');`

THANKS!!!  
Made small changes to “beautify” the output and now it’s pretty much what I was looking for!  
(I know absolutely nothing about coding but trial-and-error works when You have a good base to start with!)  
Again, thank You!

---

<div class="post-metadata">

### Author: ![Robkrekel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robkrekel/32/113089_2.png) [@Robkrekel](https://community.homey.app/u/Robkrekel)
#### Post date: [June 6, 2025, 5:13am UTC](https://community.homey.app/t/battery-status-report/137581/10 "2025-06-06T05:13:57Z")

</div>

I made a simple flow for it. Works fine, and I get a reminder every day to charge or replace battery’s

 ![2025-06-06 07_11_45-Homey Web App - Homey Pro van Rob](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/7/3746e291f7abb9f815af9a7f65d440755c7bc3c3.jpeg)
