npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iobroker.notification-manager

v1.3.0

Published

Manage ioBroker notifications, e.g. by sending them as messages

Downloads

998

Readme

Logo

ioBroker.notification-manager

NPM version Downloads Number of Installations Current version in stable repository

NPM

Tests: Test and Release

notification-manager adapter for ioBroker

Manage ioBroker notifications, e.g. by sending them as messages

General description

This adapter allows to redirect the ioBroker internal Notifications to messenger adapters which support the Notification System. If you are missing an adapter, please open a ticket on the corresponding adapter.

Configuration

For each category you are able to configure if the category should be active. If the category is not active, the notification-manager will not handle anything for this specific category.

Additionally, you can configure if the notification-manager should suppress certain categories. If a notification for a suppressed category is registered, the adapter will immediately clear this notification without sending you any messages.

Finally, you can configure supported messaging adapters. Whenever a new notification for an active (and non-suppressed) category is generated, the adapter will send the notification via the first configured adapter. If sending the message was successful, the notification-manager will clear the notification. IF sending was not successful it will re-try with the second adapter.

Whenever a category is active but has not configured any specific settings yet, then the adapter will use the configured fallback settings. New categories are always active by default to ensure you will be notified. This means whenever a new category is implemented by some adapter, the fallback settings for the given severity will be applied.

You can further define to just suppress a category. The notification-manager will then simply acknowledge the notification, so that is does not appear in your system.

Since js-controller version 7, adapters have the possibility to add additional contextData to notifications. This is for example used to display specific actions for the user in the Admin GUI. By default, the notification-manager will send you these notifications and will NOT delete them, so that these stay present for later user interactions. However, if you decide that you don't need such interactions fort certain category you can disable them via the checkbox.

Registering user-centric notifications

As a user you at best know, when you want to be notified about specific situations in your system. Thus, the notification-manager provides you with an interface to register your own notifications inside the ioBroker notification system. Three categories are supported, one for each severity level notify, info and alert.

The notifications can be registered via sendTo

(async () => {
    try {
        await sendToAsync('notification-manager.0', 'registerUserNotification', { category: 'notify', message: 'Your delivery has arrived' });
    } catch (e) {
        log(`Could not register notification: ${e}`, 'error');
    }
})();

Requirements for messaging adapters

Please set the common.supportedMessages.notifications flag to true in your io-package.json.

Whenever a new notification should be delivered via the messaging adapter, notification-manager will send a message to the configured instance.

The messages consist of the command sendNotification and a message with the following structure:

{
  "host": "system.host.moritz-ThinkPad-P16-Gen-1",
  "scope": {
    "name": "System-Benachrichtigungen",
    "description": "Diese Benachrichtigungen werden vom ioBroker-System erfasst und weisen auf Probleme hin, die überprüft und behoben werden sollten."
  },
  "category": {
    "instances": {
      "system.adapter.backitup.0": {
        "messages": [
          {
            "message": "Restart loop detected",
            "ts": 1684074961226
          }
        ]
      },
      "system.adapter.notification-manager.0": {
        "messages": [
          {
            "message": "Restart loop detected",
            "ts": 1684075183094
          }
        ]
      }
    },
    "description": "Eine Adapterinstanz stürzt beim Start häufig ab und wurde aus diesem Grund gestoppt. Die Protokolldatei muss vor dem Neustart der Instanz überprüft werden.",
    "name": "Probleme mit häufig abstürzenden Adapterinstanzen",
    "severity": "alert"
  }
}

Where category.instances shows the affected adapter instances for this notification. Additionally, the category has an i18n description and an i18n name. The same properties exist for the scope of the category. Additionally, the affected host is included.

After sending the notification, the notification-manager expects an answer with the property { sent: true } if the messaging adapter was able to deliver the notification, else it should respond with { sent: false }.

Changelog

1.3.0 (2024-10-10)

  • (@foxriver76) by default we do not delete notifications with contextData
  • (@foxriver76) added checkbox to also delete notifications with contextData for specific categories

1.2.1 (2024-08-29)

  • (@foxriver76) fixed issue if host name contains .

1.2.0 (2024-08-05)

  • (@klein0r) Added Blockly blocks

1.1.2 (2024-05-02)

  • (foxriver76) made logging a bit more silent

1.1.1 (2024-03-16)

  • (foxriver76) added possibility to suppress messages
  • (foxriver76) fixed issue that bottom of settings page is shown behind toolbar
  • (foxriver76) fixed issue that all notifications are cleared instead of only the handled one

1.0.0 (2023-12-08)

  • (foxriver76) added possibility to send custom messages
  • (foxriver76) added UI indicators for each category

0.1.2 (2023-10-11)

  • (foxriver76) also show notifications provided by adapters in the configuration

0.1.1 (2023-07-04)

  • (foxriver76) added possibility to send test messages from web interface (closes #1)

0.1.0 (2023-06-02)

  • (foxriver76) initial release

License

MIT License

Copyright (c) 2024 foxriver76 [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Icon made by "Good Ware" from www.flaticon.com