I hope that it sometimes happens to miss an error from a scene or QA in a deluge of messages in the web console. Scripts can run for months and have branches of code that are rarely visited. Such errors can be easily missed – especially because a QA restarts after a failure and “nothing obvious” shows up later. Still, it does not mean that nothing bad happens… And what about errors at night? Or when you are on holidays? Just because is after 1st of May? I read on this forum that user had over 350 (!) QAs & Scenes running in parallel - best chance to miss something important.
So, I would like to introduce auto::cerr – Automatic Capture of Errors. auto::cerr captures all error messages from www console, fingerprints each error, throttles repeats, and pushes concise alerts to your phone (plus optionally to Virtual Console, if installed). It also keeps a compact, color-coded history inside the QA UI and sends periodic summaries during “error storms”.
@cag014 advised me to capture errors this way. Thanks.
Features summarized:
Catches every logged error. Tracks errors from QA, setTimeout & setInterval, scenes, explicit error(…) (terminates QA), and self:error(…) (non-terminating). Bases on api.get "/debugMessages".
Immediate push alert. Sends a normalized message (HTML stripped) to the admin phone (or another chosen user) with shortened error text, time, origin. You will never miss an error again.
Virtual Console integration (optional). Emits a richer log line to your vconsole QA (full text, emphasis, counters). Works standalone too, but the console gives you better forensics – and is recommended (because auto::cerr prints very little to the web console). Virtual console is similar to www console but works with Yubii. Description and download: https://forum.fibaro.com/topic/78997-virtual-console-for-yubii/#findComment-292212
Compact on-device dashboard. Presents statistics of captured errors in the QA interface, with automatic deletion after a defined time (so the table does not grow infinitely), color representation of error age (fresh -> old), and more. You can view all errors in one place within a customized time window. Also on the phone.
Summaries of errors. Emits a summary of every error that meets a criterion (user defined, e.g., occurs more than once in 10 min) – to phone and vconsole. Tracks which errors are summarized and does not include them again (until a long time gap occurs).
Storm detection & smart throttling. Incorporates a sophisticated mechanism to:
automatically detect an error storm from any source (many errors one after another due to QA auto-restart)
prevent the user’s phone from being flooded with error messages. Only one message is pushed. Configurable rules suppress repeated messages with dynamic (non-linear) relaxation based on the real situation.
there are two user defined time-windows: one for fast storm detection and one normal (o.e. 3 errors in 5 min OR 8 in 10 min to detect storm)
DST-aware operation. As any time-driven app is sensitive to DST time changes. Automatically detects DST flips and, per your custom policy, either:
corrects internal data structures to reflect the new time (experimental, not fully tested), or
restarts the QA. Other sources of time drift are ignored (time server failure, manual changes).
Auto-selects push receiver. “admin” is automatically selected as the recipient of info. Others can be chosen manually (by design – only one).
Blacklist. Manages a list of QA or Scene IDs to be completely ignored (no vconsole, no stats, no push).
Mute/disable controls. Framework can be muted for 30 min, until the end of the day, or completely disabled.
Hash token. Generates a short hash token (from text+origin) for each message to easier reference to the same errors (shown with push and vconsole info).
Works out of the box. No configuration required – defaults work well.
QA for download and additional info in next mail.