Skip to content

moonNode Monitor

Minty Trebor edited this page Oct 15, 2023 · 7 revisions

moonNode-Monitor

The moonNode-Monitor node is the primary node for establishing the connection between Node-Red and Moonraker.

Typically only one moonNode-Monitor node is required for each node-red instance. It is recommended to connect the output of moonNode-Monitor to a Link-Out node (to allow multiple flows to receive the output) , and a Debug Node to help you review & navigate the Model.

Setup

Other than name, moonNode-Monitor has two parameters:

  • Moonraker WS. Select the IP address & port of the Moonraker service or add a new connection
  • Auto Start. Check this box to start the monitor node to auto-start polling for information at boot/deployment.

Model Object Selection

Select any combination of the Machine objects you wish to monitor.

Input

Monitor In
The monitor node checks for payload.monitorState value of ON or OFF to start/stop the node connecting to Moonraker. Useful in scenarios where monitoring is not required 24/7. (EG. control by Start/Stop buttons on a dashboard)

Output

moonNode-Monitor will output the following msg structure every time it receives an update to the Model from Moonraker.

  • msg.payload.fullModel - Complete Current state
  • msg.payload.patchModel - Changes Only
  • msg.payload.prevModel - Previous State

The combination of objects provides, the complete current state of the machine; - what changed with the machine; - and what the previous machine state was.

msg.payload.fullModel

This object always holds a copy of the full Model which is always up-to date with the latest information.

msg.payload.patchModel

Contains the latest changes to the Model sent by Moonraker. It is a fragment of the full Model containing only the data that has changed. The patchModel has already been merged into the fullModel object.

msg.payload.prevModel

This object holds the last version of the fullModel prior to receiving the latest update from Moonraker. It is provided to enable comparative functions within flows.

Important

Each moonNode-Monitor node you deploy creates a new connection to Moonraker, which consumes additional resources. A single Node-Red instance should only require one moonNode-Monitor node to be deployed for each Moonraker instance. The inbuilt 'node-out' and 'node-in' nodes in node-red enable a single moonNode-Monitor node to be used in multiple flows.