[Homey Pro] overview script

I think what Caseda also meant was, chatgpt’s ‘knowledge’ stops at around 2021

How about adding first a funktion like:

let output = '';
function addLog(...args) {
  output += args.join(' ') + '\n‘;
}

Then change every log statement to „addLog“ and either return „output“ or add a statement to create your tag using „output“?

And today is the day, that the script has been adapted for returning the end result in multiple ways.

  • JSON Object: All the values are separated in their appropriate tag that you, for example, can read with the “Read [TEXT] as JSON and select path [PATH] as …” logic flow card.
  • String: All the (basic) values can be separated by your own chosen separator, to for example send it as push message to your phone.
  • HomeyScript tag: The returned JSON object or String can also be put into a HomeyScript tag.
  • Logic Variable: The returned JSON object or String can also be put into a Logic Variable, this variable does have to be of the type “Text”.

I did need to move the codes to my github page (no need to have an account), as the character count was getting too big of the Tagged version (it is over the 32000 character max limit the forum allows).
But in addition it will make copying the code easier.

If you do find any issues, or missing something feel free to contact me or leave a reply, and i’ll see what I can do.

5 Likes

Working great so far! Thx @Caseda!

Thank you!

Looks like there are some differences:
Tagged Overview reports in my case 0 Virtual devices
Overview v1.16 reports: 3 Virtual devices

Hmmm, i can confirm, thanks.
I didn’t change anything in that piece of code so a bit strange that it shows 0
I’ll check when i’m back at home why it does so.

Overview script v1.17 and Tagged overview script v1.1 are out now and ready to be downloaded.

It appears that I missed a change in the new SDK used in HomeyScript.
Which needed me to refactor some of the code used how the virtual devices are counted.

While testing I noticed that Homey Bridge is technically a virtual device in Homey, so I separated it out now into its own category of device.

Changelog is the same for both:
v1.17 - v1.1:

  • Fixed: API change
  • Added: sysInternals devices as virtual devices
  • Separated out Homey Bridge devices
4 Likes

A new version just released, this update now adds support for the new grouping of devices in Homey Pro 2023 and Homey Pro mini (untested).

  • v1.19/v1.3 (July 10, 2025):
    • Added: Group support (Homey Pro 2023/Mini)
3 Likes

--------------- Homey Pro Overview v1.19 --------------

Homey name: Rogier’s Homey Pro

Homey version: 12.5.2-rc.2

Homey model: Homey Pro (Early 2023) (4 core(s))

Uptime: 143165.19 (1 day, 15 hours, 46 minutes, 5 seconds)

WiFi: Connected

Ethernet: Connected

Throttled: No (Currently: No)

Under voltage: No (Currently: No)

Update available: No

Storage: 2.66 GB (983.12 MB free)

------------------ Main ---------------------

6 Users (1 Owner, 0 Manager, 5 User, 0 Guest)

49 Apps (38 Stable, 11 Test, 0 Development/Community Appstore, 0 SDKv2, 49 SDKv3, 0 Updateable, 0 Disabled/Crashed)

22 Zones

250 Notifications (Timeline)

835 Insight entries (163 Boolean (Yes/No), 672 Number)

395 Logic Variables (86 Boolean (Yes/No), 190 Number, 119 String (Text))

1 Flows (0 Broken, 0 Disabled)

133 Advanced flows (0 Broken, 12 Disabled)

33 Images

2 Moods

0 Alarms (0 Enabled)

16 HomeyScript scripts (0 Token/Tag)

----------------- Devices -------------------

9 Unavailable devices

0 Group devices

0 Devices in a group

61 Virtual devices

1 Infrared (database) devices

10 Z-Wave devices (9 Unsecure, 0 Secure (S0), 1 Secure (S2 Authenticated), 0 Secure (S2 Unauthenticated), 10 Router, 0 Battery, 0 Unreachable, 2 Unknown)

11 Zigbee devices (4 Router, 7 End device)

1 Homey bridges

98 Other devices

182 Total devices

——————————————————— :white_check_mark: Script Success

:right_arrow_curving_left: Returned: “Overview finished”

Very very neat and helpful @Caseda

One request if you could be bothered with that; Could you perhaps also add;

  • Total Memory Available / Current Memory Available
    As for placement ,behind the Storage part would make most sense I guess.

After line 60 something „await Homey.system.getInfo() .then(result => { …“ insert: log(result.totalmem); log(result.freemem);

1 Like

Cool, did not know where to look for the value.
But ended up with this;

if (showMemory || homeyPlatformVersion === 2) { await Homey.system.getInfo() .then(result => { let sizeFree = result.freemem + 'B' if (result.freemem >= 1000000000) { sizeFree = (result.freemem / 1000000000).toFixed(2) + ' GB'; } else if (result.freemem >= 1000000) { sizeFree = (result.freemem / 1000000).toFixed(2) + ' MB'; } log('Memory:', (result.totalmem / 1000000000).toFixed(2), 'GB (' + sizeFree + ' free)'); }) .catch(() => log('Failed: Getting Memory information')); }

Which seems to work as I wanted :slight_smile:
For those not JS-savvy; if you add this please also add showMemory with;

const showMemory = false; // Show Memory status (Very slow!, is enabled for Homey Pro (early 2023))

At the top constants.

Can You run these scripts by a flow an import/export/show the whole result (in a widget) on a dash board ?

How ? Please. :folded_hands:

Found it / Solved : [APP][Pro] Enhanced Device Widgets. Live 1.1.26, Test 1.1.26 - #457 by DoctorBazinga

Any chance an entry of the dateand/or how many days ago the last cloud backup has been made ??

Backups aren’t saved on your Homey, only in the cloud, so can’t retrieve any backup information with HomeyScript.

I don’t have cloud backups, but this seems to return a value:

await Homey.backup.getOptionLastSuccessfulBackup()
2 Likes

Wrote it in this topic below already :winking_face_with_tongue:
It indeed returns the timestamp of the last succesful backup, Robert

Mr. Bazinga is posting the same questions in different topics :thinking:

1 Like

Thank you for pointing me to the backup option, I missed that part of the API.
Unfortunately it is only available for Homey Pro 2023 and higher (for now) because of not being allowed to fetch that on the older Homey Pro’s with HomeyScript, I’ll ask if they want to add that “Scope”.

Both scripts have been updated:

Homey Overview (v1.20):

  • Add support: Last Backup date (Homey Pro 2023 and higher)
  • Add support: Homey Memory

Homey Tagged Overview (v1.4):

  • Add support: Last Backup date (Homey Pro 2023 and higher)
  • Add support: Homey Memory
3 Likes
// backup status 2016-2019 models
const sTate = await Homey.backup.getState();
let ePoch = sTate.$lastUpdated;
let dAte = new Date(ePoch);
// make it readable
let jSon1 = JSON.stringify(sTate).replace(/{|}|\"/g, "");
let jSon2 = jSon1.replace(/,/g, "\; ");
let lastBackup = jSon2.replace(/:/g, "\: ");
log('Last Backup Status: \t', lastBackup  + '; Date: ' + dAte);

Gotta love the differences in the API :sweat_smile:
In the new Homey pros the state is only that “it is available to backup”, nothing more.
I’ll see if I can implement it.

EDIT: it is also available on the same function, just the scope is missing, probably soon to be added.

1 Like