Action Command Notification Plugin Question

I may be overthinking this and / or missing the obvious, but I have found no way to trigger a notification add without it coming explicitly from a machine using the defined pattern:

//action:notification your message goes here

Looking over the plugin itself, I saw no way other than the action hook (assumedly wired directly into the serial comm interface) to add a notification.

You can delete them and list them via the API, but there's no add.

Is this by design? If not, I've got a pull request I may want to submit with the following changes to it:

    def get_additional_permissions(self):
        return [
                "key": "ADD",
                "name": "Add printer notifications",
                "description": gettext("Allows to add printer notifications"),
                "default_groups": [USER_GROUP],
                "roles": ["add"],
    def get_api_commands(self):
        return {"clear": [], "add": []}

    def on_api_command(self, command, data):
        if command == "add":
            if not Permissions.PLUGIN_ACTION_COMMAND_NOTIFICATION_ADD.can():
                return flask.abort(403, "Insufficient permissions")
    def _add_notification(self,  message):
        self._notifications.append((time.time(), message))
        self._plugin_manager.send_plugin_message(self._identifier, {"message": message})"Got a notification: {}".format(message))

I also modified action_command_handler to use _add_notification rather than duplicate code.

The notifications come directly from the printer, in the UI it is called 'Printer Notifications' to make that clearer. It's not supposed to show anything else, just what is received over the serial comm.

I understand that part clearly. Not all "machines" support // nomenclature (ie GRBL) so I thought an API method would be very appropriate for it. GRBL sends its notices / notifications via a MSG: preamble.

This may be outside of the bounds of the OctoPrint roadmap. Completely understood if that is the case.

I've pretty much already made up my mind to pull in the core plugin and manage it separately. If the core contributors are good with my suggestion, I'm more than happy to provide a pull request regardless.

hmm. I think I may have just solved this myself. It was in my own response just now. I

Within the gcode receive hook I should be able to rewrite GRBL MSG: messages as //action:notification .

I did mention I may have been overthinking and / or missing something key here :slight_smile:

The only other item I would like to add here is that it would be nice to put errors / warnings. / etc in the notification stack. Currently, I can't think of any way to intercept an error / warning response from the printer, forward that error / warning on to Octoprint, and also facilitate a notification.