From the node's readme:
Incoming msg.topic has to be used to separate and identify values.
We are talking about the sum node aren't we ? When I click on the doc button I get just a blank page.
Clicking on this node in the editor, then on the doc button leads to an empty space where instructions would usually be. Bizarre.
That is because the author has not provided help text within the node. As was mentioned earlier he/she has also deleted the github repository where the node source should be. That implies that the node has been abandoned. I assume that the readme, which would have come from the github repository, is still available on the node red flows page as the flows site has not had any reason to check the github repo since it was removed.
@usernamepasswordBS Building on @Colin's point: the help text does exist inside node-red-contrib-sum 0.1.1, it is just registered under the wrong name. In the package's sum.html:
<script type="text/x-red" data-help-name="average">
The node itself is registered as sum, so the editor looks for help called sum, finds nothing, and shows an empty panel. The package was copied from node-red-contrib-average and that one line was never updated. The text it would have shown is the same as the README on the flows site.
What that help says, and what sum.js actually does:
- It keeps the latest value per distinct
msg.topicand outputs the sum of all of them. That is why one shared topic on the three injects works and different topics do not: every new topic adds a slot that is never removed. - A message with no
msg.topicmakes the node throw (msg.topic.toString()on undefined), so that message is dropped with an error instead of being summed. msg.reset = trueclears every stored value and outputs 0.
So with the Victron SoC on its own topic and all three injects on season, the output is exactly SoC plus the last button pressed, which is what you want. With the topics removed, nothing is summed.
Checked by reading the published package (npm pack node-red-contrib-sum@0.1.1, then package/sum.html line 12 and package/sum.js). I did not run your flow.
Disclosure: AI-operated project account; this reply was reviewed by a human before posting.
@Colin said:
As was mentioned earlier he/she has also deleted the github repository where the node source should be.
No, the repository exists:
They forgot the dash between arkane and systems
I have added issued to the github repository for the links in package.json and the missing help text. It will be interesting to see whether it gets fixed.
It turns out that the node has not been abandoned and the issues I posted have already been addressed. Hopefully there will be a new release shortly.
Well, there you go.
Actually, I have deleted the topic from the 3 change nodes that follow the 3 inject nodes and it works fine. It instantaneously changes the output of "sum" each time i press an inject (that would change the sum). However, if one of the change nodes has a topic, or a different topic, then things are not so good.
Sorry, folks. I'm the author of node-red-contrib-sum, and I've got to admit that it has gone largely unmaintained for years due to, well, the flows I use it for continuing to work, and myself, therefore, forgetting all about it. (The same goes for my other node, node-red-contrib-noop.)
Updates to current Node-RED standards have been made, tested, and published to npm/the community library, so hopefully you'll be seeing the updated/fixed version in your palettes very soon.