[Homey Pro] overview script

Ahh, ok! Many thanks for your time and response! If I can test something, please let me know!

I found the issue and has been fixed in v1.6 of the script, Athom changed (removed capitalization) how they name/type a router or end device on the new Homey Pro (early 2023) from:
Router ā†’ router
EndDevice ā†’ enddevice

So easy fix, still a weird change, perhaps a bug in the API used on the new Homey Pro.

2 Likes

Iā€™ve just released v1.7 of the script, it has several things added:

Storage information
This is disabled by default for Homey Pro (2016-2019) as it is a very slow/heavy function (the more apps, the slower it is), but can be a good indicator.

Number of alarm clocks
It is available build in, and apparently lots of people donā€™t know it exists or know what ā€œAlarmsā€ mean in the ā€œMoreā€¦ā€ part of the mobile app, so why not create a bit more awareness.
In short, it is a build in (basic) scheduler.

Throttled
Homey Pro (early 2023) is throttling (slowing down) when a bad power supply is used (like the current 5.0V 2.1A version as the voltage drops too much), but it can also happen when the temperature has gotten too high.

Under voltage
Homey Pro (early 2023) was initially delivered with a ā€œbadā€ power supply (5.0V 2.1A) that in many cases could not deliver enough voltage so Homey Pro would throttle and cause weird behaviour, hence adding this.

These last 2 can be kept track of (and triggered on) perfectly with an app: sysInternals

But Iā€™ve also cleaned up the code a little bit, so even with all these additions, the script length itself only increased with 7 lines of code compared to v1.6.

7 Likes

Hi, @Caseda I came to realize the group app devices are virtual devices also?
Iā€™ve added the uri here:

      else if (
        device.driverUri === 'homey:app:com.arjankranenburg.virtual'
        || device.driverUri === 'homey:app:nl.qluster-it.DeviceCapabilities'
        || device.driverUri === 'homey:app:nl.fellownet.chronograph'
        || device.driverUri === 'homey:app:net.i-dev.betterlogic'
        || device.driverUri === 'homey:app:com.swttt.devicegroups'
      ) {
        virtualNames.push(device.name);
      }
1 Like

Since an Homey pro (early 2023) firmware update (10.0.0-rc.80) the unavailable function that made it impossible to retrieve an appā€™s settings (getAppSettings()) with the Web API has since been fixed.
It still would show the error if you didnā€™t have Better Logic app installed (oversight on my part), with version v1.9 of the script this has now been fixed to not show if your homey version is equal or higher then 10.0.0-rc.80.

2 Likes

Still a very great script @Caseda !

I have been updating all my apps and all apps i use: All are now (some in testversions) SDK3.
I have updated all flows, removed some apps (like group, which i donā€™t need since the AVD-Reflection-groupings are, for me, a better replacement).

My old homey (and thus my house) runs very good.

So, i am right now creating a BackUp, and am gonna try migrating (i do not have any zigbee devices):

--------------- Homey Pro Overview v1.9 --------------
Homey name: Homey
Homey version: 8.1.3
Homey model: Homey Pro (Early 2019) (2 core(s))
Uptime: 86895 (1 day, 0 hour, 8 minutes, 15 seconds)
Update available: No

------------------ Main ---------------------
1 Users (1 Owner, 0 Manager, 0 User, 0 Guest)
46 Apps (0 SDKv2, 46 SDKv3, 2 Updateable, 0 Disabled/Crashed)
39 Zones
1 Notifications (Timeline)
32 Logic Variables (9 Boolean (Yes/No), 15 Number, 8 String)
225 Flows (2 Broken, 39 Disabled)
84 Advanced flows (6 Broken, 9 Disabled)
1 Alarms (0 Enabled)
82 HomeyScript scripts (0 Token/Tag)
54 Better Logic Variables (2 Boolean (Yes/No), 25 Number, 25 String)

----------------- Devices -------------------
28 Virtual devices
0 Infrared (database) devices
78 Other devices
70 Z-Wave devices (54 Unsecure, 15 Secure (S0), 1 Secure (S2 Authenticated), 0 Secure (S2 Unauthenticated), 44 Router, 26 Battery, 1 Unreachable, 5 Unknown)
0 Zigbee devices (0 Router, 0 End device)

176 Total devices

Letā€™s see how the migration goes with all SDK3 apps, it should all work right :wink:
Everything looks ready for a real migration try!

WAUW!

This has been a extremly succesfull migration!

Except for 1 device (Fibaro Implant doesnā€™t respond to pushing the button, but sensors work correct), everything works as expected!

I have checked most devices already, and a lott of flows, i cannot find anything wrong at this time!

I did need to install 2 apps by hand ofc, Smarthings and my personal Watchman app (which is the next project to publish people!).
And i am using the LED and speaker, so i still have a bit of work, but that was expected, since the new HP2023 doesnā€™t have a speaker anymore and iā€™ll be using the Homesh app for that!

Ofc, i am gonna wait a few days before resetting my old homey to make sure everything really works correctly, at least all required stuff, but itā€™s looking very good!

Hats off @Emile !


--------------- Homey Pro Overview v1.9 --------------
Homey name: Homey Pro van Arie J.
Homey version: 10.0.0-rc.98
Homey model: Homey Pro (Early 2023) (4 core(s))
Uptime: 2337.98 (0 hour, 38 minutes, 57 seconds)
WiFi: Connected
Ethernet: Not connected
Throttled: No (Currently: No)
Under voltage: No (Currently: No)
Update available: No
Storage: 2.66 GB (1.09 GB free)

------------------ Main ---------------------
1 Users (1 Owner, 0 Manager, 0 User, 0 Guest)
46 Apps (0 SDKv2, 46 SDKv3, 0 Updateable, 0 Disabled/Crashed)
39 Zones
0 Notifications (Timeline)
32 Logic Variables (9 Boolean (Yes/No), 15 Number, 8 String)
225 Flows (0 Broken, 39 Disabled)
84 Advanced flows (0 Broken, 9 Disabled)
1 Alarms (0 Enabled)
82 HomeyScript scripts (0 Token/Tag)
54 Better Logic Variables (2 Boolean (Yes/No), 25 Number, 25 String)

----------------- Devices -------------------
27 Virtual devices
0 Infrared (database) devices
78 Other devices
70 Z-Wave devices (54 Unsecure, 15 Secure (S0), 1 Secure (S2 Authenticated), 0 Secure (S2 Unauthenticated), 44 Router, 26 Battery, 1 Unreachable, 5 Unknown)
0 Zigbee devices (0 Router, 0 End device)
175 Total devices

And yes, even my Watchman app is working, i can speak to my Homey again, but now even faster :slight_smile:

4 Likes

For those that find it useful to see what apps are currently installed as Stable or Test channel apps, or apps that you have installed with CLI or Community Appstore (unfortunately it is impossible for me to differentiate between CLI and Community Appstore apps).
This is now in v1.10 of the script.
It shows how many you have in each channel, and you can enable to show the names of said apps.

Some good information why I added it:

  1. Installed as Test channel apps will still be Test channel apps even if there currently is no Test version of the app, if the developer uploads a test version your app will update to that Test version if you have automatic updates enabled.
    You might not want that to happen, so you can overwrite a Test channel app by just installing the Stable version of the current app from the appstore, then it will not update anymore when the developer does upload a Test version, only after the Test version was approved for Stable.

  2. For people that have (several) apps installed via CLI or the Community Appstore, it is always nice to know which apps before you migrate to another (Newer) Homey Pro, so you can manually install those again after migrating.

2 Likes

Nice additions! Everything works.
FYI, getting the storage info on a Pro 2019 did not take a really long time imho, the script took 30s in my case, and 7s without getting storage.

I know it isnā€™t that long, but if people donā€™t expect a script to not do anything for 10-30 seconds they will think it failed and press it again, and again. (Not really possible to show a loading animation or something)
People hate waiting :stuck_out_tongue:.
But also the reason you can still enable it, then you at least know.
Would have been nice if we could get just the general storage, not immediately for every app too, that would probably make it 20x faster.

Ha yes I get why it can be a very long time to some folks :stuck_out_tongue_winking_eye:
Maybe the first output should be: (:sweat_smile:)

// ================= Don't edit anything below here =================

if (showStorage || homeyPlatformVersion === 2) {
log("!! Pro 201x owners:\n\nYou've set 'showStorage = true', be patient and wait for 30s or more, until the script finishes\n");
}
await wait(2000);
log('.');
await wait(1500);
log('   .');
await wait(1000);
log('      .');
await wait(800);
log('         .');
await wait(600);
log('            .');
await wait(300);
log('               .\n\n\n\n');

log('--------------- Homey Pro Overview v1.10 --------------');

And move the getStorageInfo code to the bottom of the script, so the impatient can see by the output it is busy processing :stuck_out_tongue_winking_eye:

And what are the chances Athom still is going to spend time on changes of these kind of Pro 201x ā€˜thingiesā€™ā€¦

Not the right place for a discussion on it, but i am using the HP2019 again.
While the Migration of hp2019 to HP2023 went very well, somehow, my whole house was very unstable with the HP2023.
(Zwave) sensors not or slow reacting, lights not being turned on, or just a few turned on.
Where everything is completly stable with the HP2019, this was just not the case with the HP2023.
(And yes, i have the new adapter and no undervoltage etc.)

I just hope Arie that before you have switched back, you also shared your findings with Athom :wink: Frankly, they are making a lot of progress lately.
Btw Jamie () is describing similar experience to yours with ZWAVE devicesā€¦

Anyway, for me itā€™s running great except of Bluetooth devices but had to perform some additional tuning ;-( ā€¦

--------------- Homey Pro Overview v1.10 --------------

Homey name: Homey 2023 Pro
Homey version: 10.0.0-rc.103
Homey model: Homey Pro (Early 2023) (4 core(s))
Uptime: 85295.96 (23 hours, 41 minutes, 35 seconds)
WiFi: Not connected
Ethernet: Connected
Throttled: No (Currently: No)
Under voltage: No (Currently: No)
Update available: No
Storage: 2.66 GB (845.72 MB free)
------------------ Main ---------------------

2 Users (1 Owner, 0 Manager, 1 User, 0 Guest)
59 Apps (13 Stable, 40 Test, 6 Development/Community Appstore, 0 SDKv2, 59 SDKv3, 0 Updateable, 0 Disabled/Crashed)
32 Zones
50 Notifications (Timeline)
54 Logic Variables (21 Boolean (Yes/No), 31 Number, 2 String)
571 Flows (0 Broken, 11 Disabled)
---------------------------------------------
Broken flow name(s):
---------------------------------------------
44 Advanced flows (0 Broken, 2 Disabled)
---------------------------------------------
Broken advanced flow name(s):
---------------------------------------------
1 Alarms (1 Enabled)
20 HomeyScript scripts (11 Token/Tag)
----------------- Devices -------------------
24 Virtual devices
0 Infrared (database) devices
15 Z-Wave devices (4 Unsecure, 1 Secure (S0), 5 Secure (S2 Authenticated), 0 Secure (S2 Unauthenticated), 13 Router, 2 Battery, 0 Unreachable, 0 Unknown)
---------------------------------------------
Unreachable node(s):
Node ID: 
---------------------------------------------
---------------------------------------------
Unknown node(s):
Node ID: 
---------------------------------------------
67 Zigbee devices (23 Router, 44 End device)
126 Other devices
232 Total devices

Btw @Caseda , seems that IR devices are not reported correctly, I do have like 4 devices currently (Homey IR) and they are working finally (compared to HP2019 where they did not work for me at all).

Ah yes, seems like one of those changes Athom has made with the new Homey Pro :sweat_smile:.
Fixed with v1.11

1 Like

i add list of
device + capabilty
Script name and id
logical variable and id
if can help

// Set any of these from `false;` to `true;` to see the corresponding Name(s) or Node ID('s) added to the list
const showStorage = false; // Show storage status (Very slow!, is enabled for Homey Pro (early 2023))
const showUpdateableApps = false; // Names of Apps that can be updated
const showDisabledApps = false; // Names of Apps that are disabled or crashed
const showStableApps = false; // Names of Stable channel Apps
const showTestApps = false; // Names of Test channel Apps
const showDevApps = false; // Names of Apps that are installed via CLI or Community Appstore
const showSDKv2Apps = false; // Names of Apps that are on SDKv2
const showSDKv3Apps = false; // Names of Apps that are on SDKv3
const showDisabledFlows = false; // Names of Flows that are disabled
const showBrokenFlows = false; // Names of Flows that are broken
const showDisabledAdvancedFlows = false; // Names of Advanced Flows that are disabled
const showBrokenAdvancedFlows = false; // Names of Advanced Flows that are broken
const showZwaveDevices = false; // Names of all Z-Wave devices
const showZwaveRouterDevices = false; // Names of Z-Wave router devices
const showZwaveUnsecureDevices = false; // Names of unsecure Z-Wave devices
const showZwaveSecureS0Devices = false; // Names of secure (S0) Z-Wave devices
const showZwaveSecureS2AuthenticatedDevices = false; // Names of secure (S2 Authenticated) Z-Wave devices
const showZwaveSecureS2UnauthenticatedDevices = false; // Names of secure (S2 Unauthenticated) Z-Wave devices
const showZwaveBatteryDevices = false; // Names of Z-Wave battery devices
const showZwaveUnreachableNodes = false; // Node ID's of unreachable (flagged) devices
const showZwaveUnknownNodes = false; // Node ID's of unknown nodes
const showZigbeeNodes = false; // Names of all ZigBee devices
const showZigbeeRouter = false; // Names of ZigBee: router devices
const showZigbeeEndDevice = false; // Names of ZigBee: end device devices
const showVirtualDevices = false; // Names of all Virtual devices
const showIRDevices = false; // Names of all InfraRed devices
const showDeviceAndCapability = false; // Show all device and its capabilty
const showScriptsAndId = false; // Names and id of all Script
const showLogicalAndId = false; // Names of all logical variables and its id

// ================= Don't edit anything below here =================

log('--------------- Homey Pro Overview v1.11 --------------');

await Homey.system.getSystemName()
  .then(result => log('Homey name:', result))
  .catch(() => log('Failed: Getting Homey name'));

let homeyPlatformVersion, homeyVersion;
await Homey.system.getInfo()
  .then(result => {
    log('Homey version:', homeyVersion = result.homeyVersion);
    log('Homey model:', result.homeyModelName, '(' + result.cpus.length + ' core(s))');
    homeyPlatformVersion = result.homeyPlatformVersion || 1;

    const d = Math.floor(result.uptime / 86400);
    const h = Math.floor((result.uptime % 86400) / 3600);
    const m = Math.floor((result.uptime % 3600) / 60);
    const s = Math.floor(result.uptime % 60);
    let uptimeHuman = '';
    if (d > 0) uptimeHuman += d + ' day' + (d > 1 ? 's, ' : ', ');
    uptimeHuman += h + ' hour' + (h > 1 ? 's, ' : ', ');
    uptimeHuman += m + ' minute' + (m > 1 ? 's, ' : ', ');
    uptimeHuman += s + ' second' + (s > 1 ? 's' : '');
    log('Uptime:', result.uptime, '(' + uptimeHuman + ')');

    if (homeyPlatformVersion === 2) {
      log('WiFi:', (result.wifiConnected) ? 'Connected' : 'Not connected');
      log('Ethernet:', (result.ethernetConnected) ? 'Connected' : 'Not connected');
      log('Throttled:', (result.videoCoreThrottleOccured) ? 'Yes' : 'No', '(Currently:', (result.videoCoreThrottleCurrently) ? 'Yes)' : 'No)');
      log('Under voltage:', (result.videoCoreUndervoltageOccured) ? 'Yes' : 'No', '(Currently:', (result.videoCoreUnderVoltageCurrently) ? 'Yes)' : 'No)');
    }
  })
  .catch(() => log('Failed: Getting Homey\'s statistics'));

await Homey.updates.getUpdates()
  .then(result => {
    if(result.length > 0) {
      log('Update available:', result[0].version);
    } else {
      log('Update available: No');
    }
  })
  .catch(() => log('Failed: Getting updates'));

if (showStorage || homeyPlatformVersion === 2) {
  await Homey.system.getStorageInfo()
    .then(result => {
      let sizeFree = result.free + 'B'
      if (result.free >= 1000000000) {
        sizeFree = (result.free / 1000000000).toFixed(2) + ' GB';
      } else if (result.free >= 1000000) {
        sizeFree = (result.free / 1000000).toFixed(2) + ' MB';
      }
      log('Storage:', (result.total / 1000000000).toFixed(2), 'GB (' + sizeFree + ' free)');
    })
    .catch(() => log('Failed: Getting storage information'));
}

log('\r\n------------------ Main ---------------------');

await Homey.users.getUsers()
  .then(result => {
    let owner = 0, manager = 0, user = 0, guest = 0;

    Object.keys(result).forEach(function(key) {
      const role = result[key].role;
      if (role === 'owner') owner++;
      if (role === 'manager') manager++;
      if (role === 'user') user++;
      if (role === 'guest') guest++;
    });

    log(Object.keys(result).length, 'Users', '('  + owner + ' Owner, ' + manager + ' Manager, ' + user + ' User, ' + guest + ' Guest)');
  })
  .catch(() => log('Failed: Getting users'));

await Homey.apps.getApps()
  .then(result => {
    let sdkv2Apps = [], sdkv3Apps = [], updateableApps = [], disabledApps = [], stableApps = [], testApps = [], devApps = [];

    Object.keys(result).forEach(function(key) {
      if (result[key].updateAvailable) updateableApps.push(result[key].name);
      if (result[key].sdk === 2) sdkv2Apps.push(result[key].name);
      if (
        result[key].sdk === 3
        || homeyPlatformVersion === 2
      ) {
        sdkv3Apps.push(result[key].name);
      }
      if (!result[key].ready) disabledApps.push(result[key].name);
      if (result[key].origin === 'devkit_install') devApps.push(result[key].name);
      else if (result[key].channel === 'stable' || result[key].channel === 'live') stableApps.push(result[key].name);
      if (result[key].channel === 'beta' || result[key].channel === 'test') testApps.push(result[key].name);
    });

    log(Object.keys(result).length, 'Apps', '(' + stableApps.length + ' Stable, ' + testApps.length + ' Test, ' + devApps.length + ' Development/Community Appstore, ' + sdkv2Apps.length + ' SDKv2, '  + sdkv3Apps.length + ' SDKv3, '  + updateableApps.length + ' Updateable, ' + disabledApps.length + ' Disabled/Crashed)');
    if (showStableApps) {
      log('---------------------------------------------')
      log('App(s) in the Stable channel:');
      log(stableApps.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showTestApps) {
      log('---------------------------------------------')
      log('App(s) in the Test channel:');
      log(testApps.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showDevApps) {
      log('---------------------------------------------')
      log('App(s) that are installed via CLI or Community Appstore:');
      log(devApps.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showSDKv2Apps) {
      log('---------------------------------------------')
      log('SDKv2 app(s):');
      log(sdkv2Apps.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showSDKv3Apps) {
      log('---------------------------------------------')
      log('SDKv3 app(s):');
      log(sdkv3Apps.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showUpdateableApps) {
      log('---------------------------------------------')
      log('Updateable app(s):');
      log(updateableApps.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showDisabledApps) {
      log('---------------------------------------------')
      log('Disabled app(s):');
      log(disabledApps.join('\r\n'));
      log('---------------------------------------------')
    }
  })
  .catch(() => log('Failed: Getting apps'));

await Homey.zones.getZones()
  .then(result => log(Object.keys(result).length, 'Zones'))
  .catch(() => log('Failed: Getting zones'));

await Homey.notifications.getNotifications()
  .then(result => log(Object.keys(result).length || 0, 'Notifications (Timeline)'))
  .catch(() => log('Failed: Getting notifications'));

await Homey.logic.getVariables()
  .then(result => {
    let boolean = 0, number = 0, string = 0;
  
    Object.keys(result).forEach(function(key) {
      if (result[key].type === 'boolean') boolean++;
      if (result[key].type === 'number') number++;
      if (result[key].type === 'string') string++;
    });

    log(Object.keys(result).length, 'Logic Variables', '(' + boolean + ' Boolean (Yes/No), ' + number + ' Number, ' + string + ' String)');
  })
  .catch(() => log('Failed: Getting variables'));

await Homey.flow.getFlows()
  .then(result => {
    let disabledFlows = [], brokenFlows = [];
    Object.keys(result).forEach(function(key) {
      if (!result[key].enabled) disabledFlows.push(result[key].name);
      if (result[key].broken) brokenFlows.push(result[key].name);
    });

    log(Object.keys(result).length, 'Flows', '('  + brokenFlows.length + ' Broken, ' + disabledFlows.length + ' Disabled)');
    
    if (showBrokenFlows) {
      log('---------------------------------------------')
      log('Broken flow name(s):');
      log(brokenFlows.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showDisabledFlows) {
      log('---------------------------------------------')
      log('Disabled flow name(s):');
      log(disabledFlows.join('\r\n'));
      log('---------------------------------------------')
    }
  })
  .catch(() => log('Failed: Getting flows'));

await Homey.flow.getAdvancedFlows()
  .then(result => {
    let disabledFlows = [], brokenFlows = [];
    Object.keys(result).forEach(function(key) {
      if (!result[key].enabled) disabledFlows.push(result[key].name);
      if (result[key].broken) brokenFlows.push(result[key].name);
    });

    log(Object.keys(result).length, 'Advanced flows', '('  + brokenFlows.length + ' Broken, ' + disabledFlows.length + ' Disabled)');
    
    if (showBrokenAdvancedFlows) {
      log('---------------------------------------------')
      log('Broken advanced flow name(s):');
      log(brokenFlows.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showDisabledAdvancedFlows) {
      log('---------------------------------------------')
      log('Disabled advanced flow name(s):');
      log(disabledFlows.join('\r\n'));
      log('---------------------------------------------')
    }
  })
  .catch(() => log('Failed: Getting advanced flows'));
  
await Homey.alarms.getAlarms()
  .then(result => {
    let enabled = 0;
    Object.keys(result).forEach(function(key) {
      if (result[key].enabled) enabled++;
    })

    log(Object.keys(result).length, 'Alarms', '(' + enabled + ' Enabled)')
  })
  .catch(() => log('Failed: Getting alarms'));

await Homey.apps.getAppSettings({id: 'com.athom.homeyscript'})
  .then(result => {
    log(Object.keys(result.scripts).length, 'HomeyScript scripts', '(' + ((result.tokens) ? Object.keys(result.tokens).length : 0) + ' Token/Tag)');

  })
  .catch(() => {
    if (homeyPlatformVersion === 2 && homeyVersion.localeCompare("10.0.0-rc.80", undefined, {numeric: true, preversion: ["rc"]}) < 0) {
      log('Failed: Getting HomeyScript, Homey Pro (early 2023): getting information from apps is currently unavailable.');
    }
    else {
      log('Failed: Getting HomeyScript');
    }
  });
await Homey.apps.getAppSettings({id: 'net.i-dev.betterlogic'})
  .then(result => {
    let boolean = 0, number = 0, string = 0;
    Object.keys(result.variables).forEach(function(key) {
      if (result.variables[key].type === 'boolean') boolean++;
      if (result.variables[key].type === 'number') number++;
      if (result.variables[key].type === 'string') string++;
    });

    log(Object.keys(result.variables).length, 'Better Logic Variables', '(' + boolean + ' Boolean (Yes/No), ' + number + ' Number, ' + string + ' String)');
  })
  .catch(() => {
    if (homeyPlatformVersion === 2 && homeyVersion.localeCompare("10.0.0-rc.80", undefined, {numeric: true, preversion: ["rc"]}) < 0) {
      log('Failed: Getting Better logic, Homey Pro (early 2023): getting information from apps is currently unavailable.');
    }
  });

log('\r\n----------------- Devices -------------------');
let allDevices = 0, other = 0, zwaveDevices = [], zwaveNodes = [], zwaveRouterDevices = [], zwaveBatteryDevices = [], zwaveSxDevices = [], zwaveS0Devices = [], zwaveS2AuthDevices = [], zwaveS2UnauthDevices = [];

await Homey.devices.getDevices()
  .then(result => {
    let virtualNames = [], irNames = [];

    Object.keys(result).forEach(function(key) {
      const device = result[key];

      if (device.driverUri === 'homey:manager:vdevice') {
        if (device.driverId === 'infraredbasic' || device.driverId.includes('virtualdriverinfrared')) {
          irNames.push(device.name);
        }
        else {
          virtualNames.push(device.name);
        }
      }
      else if (
        device.driverUri === 'homey:app:com.arjankranenburg.virtual'
        || device.driverUri === 'homey:app:nl.qluster-it.DeviceCapabilities'
        || device.driverUri === 'homey:app:nl.fellownet.chronograph'
        || device.driverUri === 'homey:app:net.i-dev.betterlogic'
        || device.driverUri === 'homey:app:com.swttt.devicegroups'
      ) {
        virtualNames.push(device.name);
      }
      else if (device.flags.includes('zwaveRoot')) {
        zwaveDevices.push(device.name);
        zwaveNodes.push(Number(device.settings.zw_node_id));
        
        if (
          device.settings.zw_battery === 'āœ“'
          || device.energyObj.batteries
        ) {
          zwaveBatteryDevices.push(device.name);
        }
        else {
          zwaveRouterDevices.push(device.name);
        }

        switch(device.settings.zw_secure) {
          case 'āØÆ':
            zwaveSxDevices.push(device.name);
            break;
          case 'āœ“':
          case 'S0':
            zwaveS0Devices.push(device.name);
            break;
          case 'S2 (Unauthenticated)':
            zwaveS2UnauthDevices.push(device.name);
            break;
          case 'S2 (Authenticated)':
            zwaveS2AuthDevices.push(device.name);
            break;
        }
      }
      else if (
        !device.flags.includes('zwave')
        && !device.flags.includes('zigbee')
      ) {
        other++;
      }
    });

    allDevices += virtualNames.length + irNames.length + zwaveDevices.length + other;

    log(virtualNames.length, 'Virtual devices');
    log(irNames.length, 'Infrared (database) devices');

    if (showVirtualDevices) {
      log('---------------------------------------------')
      log('Virtual device(s):');
      log(virtualNames.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showIRDevices) {
      log('---------------------------------------------')
      log('Infrared (database) device(s):');
      log(irNames.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }
  })
  .catch(() => log('Failed: Getting devices'));

await Homey.zwave.getState()
  .then(result => {
    const unknownNodes = result.zw_state.nodes
      .filter((el) => !zwaveNodes.includes(el))
      .sort((a, b) => a - b)
      .slice(1);
    
    log(zwaveDevices.length, 'Z-Wave devices', '(' + zwaveSxDevices.length + ' Unsecure, ' + zwaveS0Devices.length + ' Secure (S0), ' + zwaveS2AuthDevices.length + ' Secure (S2 Authenticated), ' + zwaveS2UnauthDevices.length + ' Secure (S2 Unauthenticated), ' + zwaveRouterDevices.length + ' Router, ' + zwaveBatteryDevices.length + ' Battery, ' + result.zw_state.noAckNodes.length + ' Unreachable, ' + unknownNodes.length + ' Unknown)')

    if (showZwaveDevices) {
      log('---------------------------------------------')
      log('Z-Wave device(s):');
      log(zwaveDevices.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZwaveRouterDevices) {
      log('---------------------------------------------')
      log('Z-Wave router device(s):');
      log(zwaveRouterDevices.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZwaveUnsecureDevices) {
      log('---------------------------------------------')
      log('Z-Wave unsecure device(s):');
      log(zwaveSxDevices.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZwaveSecureS0Devices) {
      log('---------------------------------------------')
      log('Z-Wave secure (S0) device(s):');
      log(zwaveS0Devices.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZwaveSecureS2AuthenticatedDevices) {
      log('---------------------------------------------')
      log('Z-Wave secure (S2) authenticated device(s):');
      log(zwaveS2AuthDevices.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZwaveSecureS2UnauthenticatedDevices) {
      log('---------------------------------------------')
      log('Z-Wave secure (S2) Unauthenticated device(s):');
      log(zwaveS2Unauth.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZwaveBatteryDevices) {
      log('---------------------------------------------')
      log('Z-Wave battery device(s):');
      log(zwaveBatteryDevices.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZwaveUnreachableNodes) {
      log('---------------------------------------------')
      log('Unreachable node(s):');
      log('Node ID:', result.zw_state.noAckNodes.sort((a, b) => a - b).join('\r\nNode ID: '));
      log('---------------------------------------------')
    }

    if (showZwaveUnknownNodes) {
      log('---------------------------------------------')
      log('Unknown node(s):');
      log('Node ID:', unknownNodes.join('\r\nNode ID: '));
      log('---------------------------------------------')
    }
  })
  .catch(() => log('Failed: Getting Z-Wave state'));

await Homey.zigBee.getState()
  .then(result => {
    let zigbeeDevices = [], routerDevices = [], endDevices = [];

    Object.keys(result.nodes).forEach(function(key) {
      const device = result.nodes[key];
      zigbeeDevices.push(device.name);

      if (device.type.toLowerCase() === 'router') routerDevices.push(device.name);
      if (device.type.toLowerCase() === 'enddevice') endDevices.push(device.name);
    });
    
    log(zigbeeDevices.length, 'Zigbee devices', '(' + routerDevices.length + ' Router, ' + endDevices.length + ' End device)');

    if (showZigbeeNodes) {
      log('---------------------------------------------')
      log('ZigBee device(s):');
      log(zigbeeDevices.join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZigbeeRouter) {
      log('---------------------------------------------')
      log('ZigBee router(s):');
      log(routerDevices.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    if (showZigbeeEndDevice) {
      log('---------------------------------------------')
      log('ZigBee end device(s):');
      log(endDevices.sort((a, b) => a - b).join('\r\n'));
      log('---------------------------------------------')
    }

    allDevices += zigbeeDevices.length;
  })
  .catch(() => log('Failed: Getting ZigBee state'));

log(other, 'Other devices');
log(allDevices, 'Total devices')

if (showDeviceAndCapability){
  log('---------------------------------------------')
  log('Show all device and capability');
  log('---------------------------------------------')
  // Loop over all devices
  let devices = await Homey.devices.getDevices();
  for (const device of Object.values(devices)){
    log ("----------------------------");
    log(`nome: ${device.name} class: ${device.class}`);
    log ("capability");
    // If this device isn't available, skip it.
    if (!device.capabilitiesObj) continue;
      for (const capability of Object.values(device.capabilitiesObj)) {
        log(`ID (${capability.id}) NAME ${capability.title} VALUE ${capability.value}`);
      }
    };
};
if (showScriptsAndId){
  log('---------------------------------------------')
  log('Show all SCRIPT name and id');
  log( 'to call use')
  log ('await Homey.apps.getApp({id:"com.athom.homeyscript"}).then(homeyScript => { homeyScript.apiPost("script/"+ [SCRIPT_ID]+"/run",);})')
  log('---------------------------------------------')

    await Homey.apps.getAppSettings({id: 'com.athom.homeyscript'})
    .then(result => {
      Object.values (result.scripts) .forEach(value=>{

        log ("NAME: " + value.name +" ID: "+value.id);
      }
      )
    })
    .catch(() => {
      if (homeyPlatformVersion === 2 && homeyVersion.localeCompare("10.0.0-rc.80", undefined, {numeric: true, preversion: ["rc"]}) < 0) {
        log('Failed: Getting HomeyScript, Homey Pro (early 2023): getting information from apps is currently unavailable.');
      }
      else {
        log('Failed: Getting HomeyScript');
      }
    });
};
if (showLogicalAndId){
  log('---------------------------------------------')
  log('Show all HOMEY variables');
  log('---------------------------------------------')

  const variables = await Homey.logic.getVariables();
  Object.values (variables).forEach(value=>{

    log ("NAME: " + value.name +" ID: "+value.id);
  });
};

return 'Overview finished';

Thanks for the ideas, the first 2 I donā€™t see any benefit.

Devices and itā€™s capabilities is way easier to see from the developer tools, as you can also search/filter there.

And script IDā€™s is very niche, the names is of course already visible on the left of the screen.

I do like adding the logic IDā€™s though as there is no overview of that yet anywhere, though that is also pretty niche in use I guess, might be pretty easy to add.

i didnā€™t know the developer tools, so yes about device and its capability is more than enough, about scrip i donā€™t know why but in my homey (2019) in the exemples name and id are the same, in my personal script are different, and i spent a day to undertand that you must use id if you call a script from another script

  • Show all SCRIPT name and id
  • to call use
  • await Homey.apps.getApp({id:ā€œcom.athom.homeyscriptā€}).then(homeyScript => { homeyScript.apiPost(ā€œscript/ā€+ [SCRIPT_ID]+ā€œ/runā€,);})

NAME: LuciOrto ID: d5ecf368-aa71-49d5-97cb-16fa159b026b
NAME: systemAnalize ID: 63dad07c-8f74-4659-b5c1-4be74b5eafb6
NAME: TermostatiOn ID: 55946086-c33e-4ce4-829f-fec5d4631aa6
NAME: ReadSensor ID: 0e67f6a1-1515-4a27-9c69-605cf09644df
NAME: TuyaMsg ID: e8637887-d876-4a6f-bc9b-754468cad383
NAME: TempoLavatrice ID: af95ecff-478b-4ca1-a188-97089fca631b
NAME: SensoriInterni ID: 826dbf77-7c9d-4519-9b87-14d42c8cd135
NAME: overview ID: 6ea905a6-939c-42a1-b6c2-0a124e085275
NAME: SensoriEsterni ID: a5d2f2e2-b0fc-4c06-a391-4cc7fefd86af
NAME: StatoSezionale ID: 4950b48f-6ac6-4a88-86ed-19871712b481

i donā€™t know if there ase some easy way to call a script

@Roberto_Mario
I guess because those scripts are pre-defined by Athom in the code and it was easier to make those IDā€™s the same as their name and not risk to get duplicate idā€™s for generated scripts.

v1.12 was just released, changelog:

  • Add: Logic names and their corresponding IDā€™s, each type can be activated separately to keep it a bit more readable if you have lots of logic variables. (thanks for the idea @Roberto_Mario).
  • Add: Node IDā€™s for any Z-Wave name lists.
1 Like

Hi,

I really like your script, but I have to ask you this.
There is one Zigbee device that has been unavailable for 2 weeks. The script still reports back that there are none unreachable nodes.

How can this be?
image

ZigBee devices arenā€™t flagged unavailable according the ZigBee status, if a device instance is set unavailable then it is either an app issue, or Homey Pro issue and thatā€™s something the ZigBee chip canā€™t see, for both those situations an app restart probably fixes that.
the unreachable nodes you are showing the screenshot of is for Z-Wave, completely different protocol.