// ===================================================================== // Homey Overview — v1.5.6 // Builds a full system overview (apps, flows, devices, Z-Wave, Zigbee, // logic variables, HomeyScript scripts, backup/storage/memory health, // moods, alarms, and more) and emails it as HTML, with a "Summary & // Actions" section highlighting what changed since the last run. // See the README for setup instructions. // ===================================================================== // Set any of these from `false;` to `true;` to see the corresponding Name(s) or Node ID('s) added to the list. // (See further down for the DEFAULT_MAIL_TO, TIMEZONE and onlyShowDetailsOnChange settings, which you'll likely want to change.) const showUpdateableApps = true; const showDisabledApps = true; // Also covers crashed apps const showSDKv2Apps = true; const showSDKv3Apps = true; const showAppChannels = true; // Show apps broken down by channel: Test (beta) and Development (sideloaded) const showStableApps = true; // Show names of Stable-channel apps (the majority — everything not Test/Development) const showDisabledFlows = true; const showBrokenFlows = true; const showDisabledAdvancedFlows = true; const showBrokenAdvancedFlows = true; const showZwaveDevices = true; const showZwaveRouterDevices = true; const showZwaveUnsecureDevices = true; const showZwaveSecureS0Devices = true; const showZwaveSecureS2AuthenticatedDevices = true; const showZwaveSecureS2UnauthenticatedDevices = true; const showZwaveBatteryDevices = true; const showZwaveUnreachableNodes = true; const showZwaveUnknownNodes = true; const showZigbeeNodes = true; const showZigbeeRouter = true; const showZigbeeEndDevice = true; const showZigbeeUnknownDevices = true; // Annotates each Zigbee node of unclassified/unknown type directly in the "All Zigbee nodes" list (e.g. "Name (unknown type)") instead of a separate section. const showVirtualDevices = true; const showIRDevices = true; const showOtherDevices = true; const showGroupDevices = true; // Show composition of group devices (Homey Pro models post-2022 only) const showLogicVariables = true; // Show names of Logic variables const showHomeyScriptScripts = true; // Show names of HomeyScript scripts const showExampleScripts = false; // Include Homey's built-in "example-xxx" HomeyScript scripts (shipped with every Homey) in the count/list above. Off by default since they're just Homey's own boilerplate, not something you added. const showBetterLogicVariables = true; // Show names of Better Logic variables (only relevant if that app is installed) // Set any of these to see the corresponding system-health info. Backup, // storage, throttling/under-voltage and images are only available on // Homey Pro models from 2023 onward (post-2022) — the Pro Mini and later // share the same platform/firmware here, so this isn't really a "2023" // distinction. They're silently skipped (shown as "-") on older Homey Pro // models, so it's safe to leave these on regardless of your hardware. // (Homey Self-Hosted likely uses the same platform check, but this hasn't // been independently verified — feedback welcome.) const showBackup = true; // Show date/time of the last successful backup const showStorage = true; // Show used/free storage const showMemory = true; // Show used/free memory const showThrottle = true; // Show throttling & under-voltage status const showImages = true; // Show amount of images const showMoods = true; // Show amount (and names) of Moods — safe to leave on even if you don't use Moods at all, it'll just show 0 const showAlarms = true; // Show amount of alarm clocks // Email settings // Reads the destination address(es) from the flow argument (args[0]), so this // script can be shared/reused without hardcoding a personal email address. // Multiple recipients can be supplied, separated by "," or ";" — one email // is sent per recipient (rather than relying on the mail app to support a // combined recipient list in a single field). // Falls back to a default when run manually from the script editor (no args). const DEFAULT_MAIL_TO = 'your.email@example.com'; // <-- CHANGE THIS to your own email address (only used when run manually without an argument) const rawMailTo = (args && args[0] && String(args[0]).trim()) ? String(args[0]).trim() : DEFAULT_MAIL_TO; const mailToList = rawMailTo.split(/[,;]+/).map(s => s.trim()).filter(Boolean); // Timezone used to format the date/time shown in the email (subject + header, // and the "last backup" date). The HomeyScript sandbox's default timezone can // be UTC regardless of where your Homey is actually located, so this is set // explicitly rather than left to the system default. CHANGE THIS to your own // IANA timezone name (e.g. 'America/New_York', 'Europe/London', 'Asia/Tokyo') // if you're not in the Netherlands. const TIMEZONE = 'Europe/Amsterdam'; // false (default) = always include the full detail report (System, Apps, // Flows, Devices, etc.) below the Summary. // true = only include the detail report when the Summary actually found // something (a change or an issue) — on a "nothing changed" run, the email // is just the short Summary section. The first-ever run (no previous scan // to compare against) always includes the full detail report regardless of // this setting, since there's nothing to summarize yet. const onlyShowDetailsOnChange = false; // Number of days after which a stale last-backup is flagged in the Summary, // e.g. "⚠️ Last backup is more than 7 days old". Unlike almost everything // else in the Summary, this is NOT a scan-to-scan diff — it's a threshold // check against the CURRENT last-backup age, so it fires on every run where // the backup is too old, regardless of whether that changed since the // previous scan. Only relevant on Homey Pro models post-2022 (where backup // date is available at all — see showBackup above). const staleBackupWarningDays = 7; // Script version, shown in the email footer. Bump this if you modify the // script, so you can tell at a glance (or in a screenshot) which version // generated a given report. const VERSION = '1.5.6'; // ================= Don't edit anything below here ================= // v1.0 — initial release: // - Uses the new homey-api (v2). If your Homey Pro is on the older // firmware (v1 API), some fields (WiFi/Ethernet status) won't populate. // - Builds an HTML report in addition to the console log, and emails it // via the 'Email versturen' / 'Send Email' app (homey:app:email.sender:sendmail) // - Every section has a "back to top" link (note: Gmail often doesn't // support in-mail anchor navigation, other clients do) // - Summary section at the top with findings vs. the previous scan. // Comparison data (incl. name lists) is stored in a Logic variable // called "Overview_previous_snapshot" (JSON string) — this variable is // created and updated automatically, you don't need to create it yourself. // - Diffs show the involved item(s), in readable sentence form: // "