I'm using working on project where I am simulating a bunch of MQTT messages to create a simulation of a device, i.e., a collection of commands to move a device around. These happen in a specific order and each message has specific contents.
Once I have all the needed messages, I create template nodes containing with the details, changing the stuff I want (to simulate a new device) and then replay the messages into MQTT.
Now, here's my scratch that needs itching, all the original messages go into the debug panel and I can investigate them there. But what I can't do is dump them from there into a large trace json file, i.e. the debug panel has no export functionality.
Is there something that adds something like an export feature to the debug panel, ideally after the application of any filters that might have been set? Is this something that is on the todo bucket?
If not, is there interest for such a feature? Or is my workflow unique to me and my problem solving approach?
Cheers!
EDIT: bonus points for creating an excel export for the manager class - basically "Export as CSV, JSON or XML"
Why export the debug console? It may contain messages from other irrelevant nodes.
Why not extend your flow and send the debug messages also to whatever storage & format you prefer - DB, file, XML, CSV, JSON, Excel etc?
See my described use case - because I'm simulating existing MQTT messages that are being pushed to debug panel and are being collected there. This is a one time kind of operation and its mostly fine just checking the messages in the debug panel.
But sometimes it would be nice to have a complete collection of steps.
So why go to the overhead of generating a flow that collects together output of various debug nodes when it's all there in the debug panel. But each to their own.
Indeed it might hence the filter suggestion. But it also might not. Who shall know what is contained in the debug panel.
Oh, well I'll go back to taking screenshots and using OCR to generate the JSON objects I need. That also works. The newest Macs have an automatic OCR built into Preview which is great for this.
Interesting use of OCR :-)....
But yes as omrid suggested I do similar - for that sort of case I have a single function node and file node to create a log file containing timestamp, topic and payload - normally I use # delimited rather than , but could as easily be JSONL instead.- and then have a replay that reads that file and outputs the mqtt at the appropriate intervals to replicate the timings etc.
I don't have a stream of events, we're talking about 5 to 10 per action, i.e., pause/unpause, move, rotate etc
So the number of messages is very small but each message is very detailed, i.e. 20 to 30 attributes on the payload. So in the debug it's a lot of uncollapse/collapse mouse clicks. (and taking screenshots for the OCR scans ;))
Plus there is a relationship between triggering an action and then the related status updates from the device - so messages are interrelated via UUIDs as part of their attributes. (for example a move from A to B is a series of status updates - from the device - for each step between A and B but all these messages are interrelated by a command id generated for the entire move.)
In describing this, what I'm really looking for is a tree structure generated from the interrelatedness of messages - i.e. a move command contains all corresponding status updates linked by the command id.
I'm probably missing something. Just put a junction node in front of the debug, and let it replicate all messages that go to the debug, to an additional destination of your choice. The number of messages is irrelevant.
You are asking to enhance the debug node with functionality which is already exists in Node-RED.
Not to mention the fact that the debug node truncates large messages, and continuously clears old messages FIFO style
Again: indeed yes debug panel gets truncated but what happens if the export is done before that truncation happens?
Indeed large messages are truncated but what if the message isn't too large?
What if tomorrow the sun doesn't come up? Yes, all these bad things can happen but what if they don't?
Yes exactly that extra work I don't want to do. What I want to go to the debug panel and click export or download. Done. I don't want to modify my flows. I know there are folks here and generally on the streets who enjoy the extra steps, I don't.
Not it doesn't : debug panel export does not exist. Yes I can do it differently and have the same result but that involves modifying flows - which I don't want to do. It's like saying that I could use a giant function node to replace all my switch and change nodes. Yes I can but I want to use builtin functionality.
It has absolutely nothing to do with the debug node, it's the panel I'm talking about.
Oh, and don't worry I'm not about to request valuable "developer" time to get this feature implemented, I'm asking whether this is something that others also have - if not, I don't much care. If I really want this, I'll implement it myself - the joys of knowing how to code.
Meanwhile, I'll go back to generating trees with OCR and AIs.
If you did happen to write them to a JSONL file - either via OCR, or copy value from debug (saves all that expanding) , or via a function/file node then there are several plugins for (eg) visual studio code (like JSONL-tools) that let you expand/collapse and edit the JSON tree within.
what i want to do is understand the workings of a automated device via the interactions of that device with a “brain” that controls it.
This completely happens via mqtt messages that i can “spy on” via the mqtt nodes within node red.
Once i have understood the messages, i want to emulate them but as a new fake device with a new id.
As i said, for that i copy the messages from the debug panel to a template node and then send them via mqtt out to the “brain” pretending to be a fake device.
That's the aim. So i setup these debug nodes that push real traffic to the debug panel and from there i want to take specific series of messages and understand them better.
As there are only two channels, messages are mixed up.
This might be a case for an Editor plugin? Maybe there is a way either to add an export to the debug panel or, to be able to intercept debug outputs before they get to the panel and optionally divert a copy?
I must be missing something because it does seem a little eccentric to have messages in Node-red, in some sort of json form, then dump them as strings to debug and re-obtain them via OCR, basically to save adding a link node to your flow.
I sometimes replace debug nodes with a link to a separate flow, which as well as outputting to the debug panel sends messages to sqlite.
and of course you can tick the option in the debug node to send to the main log also - no extra nodes - and then redirect that to a file and filter that with grep or whatever... but
I really hope you don't believe that I'm doing that - of course, I trained an AI to do it for me. It just needs the collapsed version - a mere fragment - of the debug message to recreate the entire message. ...
I think, in discussing this, I can think of a use case where an random, not very often occurring error happens and before gets truncated away, one could quickly do an export.
For my use case, it's probably the wrong approach because of the interrelatedness of messages (both control from the brain and response from the "body"). So I'll let the little grey cells continue their meditations.