How to reset add node

How do I reset a add node, Ideally I want it to reset on the 28th of every month?

What add node? Are you talking about a contrib node that you have installed?

yes, under function nodes

I believe @Colin is asking you what is th full name of the node? i.e. node-red-contrib-?????

Even more helpful would be to create a small flow demonstrating your problem and exporting it and attaching it to a reply. Then people can see what you are doing and help you out.

Do you mean you have written a function node and you want to reset it in some way? We are not telepathic so we have no idea what you have written in the function node, so have no way of knowing how to reset it. If that is what you are trying to do then post the contents of the function node here.

I want to be able to have it start over at some interval like 7 days or 28 days:

[
    {
        "id": "b05ed350cffaa8ab",
        "type": "add",
        "z": "f672d0ac69fd5b97",
        "name": "",
        "topic": "",
        "x": 330,
        "y": 1140,
        "wires": [
            [
                "79181d172ce19f5b"
            ]
        ]
    },
    {
        "id": "79181d172ce19f5b",
        "type": "ui_text",
        "z": "f672d0ac69fd5b97",
        "group": "8ee0bb75fa4e2113",
        "order": 21,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "Display",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": 16,
        "color": "#000000",
        "x": 480,
        "y": 1140,
        "wires": []
    },
    {
        "id": "ccf318f969b984e9",
        "type": "inject",
        "z": "f672d0ac69fd5b97",
        "name": "inject",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "5",
        "crontab": "",
        "once": true,
        "onceDelay": "1",
        "topic": "",
        "payload": "1",
        "payloadType": "num",
        "x": 170,
        "y": 1140,
        "wires": [
            [
                "b05ed350cffaa8ab"
            ]
        ]
    },
    {
        "id": "8ee0bb75fa4e2113",
        "type": "ui_group",
        "name": "Main",
        "tab": "9d03c9290d696c27",
        "order": 1,
        "disp": false,
        "width": 12,
        "collapse": false,
        "className": ""
    },
    {
        "id": "9d03c9290d696c27",
        "type": "ui_tab",
        "name": "Solar Power Stats",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

I think, as @zenofmud suggested, you have installed a package that provides the add node. You need to tell us what it is. Look in Manage Palette to see what you have installed.

Assuming that the "add node" is node-red-contrib-add, it can be reset by sending a message including. msg.reset.

You could use node-red-contrib-cronplus to send a message on the 28th of the month.
I think the cron expression for this would be 0 30 1 28 * ? * (at 01:30 on 28th of every month) but there is an "Easy expression builder" available from the dropdown.

Send the output from cronplus through a change node to give msg.reset a value.
image

[{"id":"83b6ded529191494","type":"cronplus","z":"412898c785d3620d","name":"","outputField":"payload","timeZone":"","storeName":"","commandResponseMsgOutput":"output1","defaultLocation":"","defaultLocationType":"default","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"default","payload":"","expressionType":"cron","expression":"0 30 1 28 * ? *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":280,"y":360,"wires":[["bce07f70997c5477"]]},{"id":"bce07f70997c5477","type":"change","z":"412898c785d3620d","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":360,"wires":[["1b2560b974c05c1f"]]}]
1 Like

Mystic @jbudd to the rescue :wink:

2 Likes

Pah.

I just went to flows.nodered.org, searched for add and worked through the 12 pages of results to find one which might be an "add node, yes contrib and under function node".
Then I installed it and edited my flows file to verify that the node-type is shown as "add".
Anybody could have done it.
And here it is, under Function!

Simples, though possibly erroneous.

1 Like

Thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.