Working with context, need to save over redeploy

I can get my value to save and load when i inject, but the value does not survive a redeploy. How do i get it to keep the saved value over a redeploy so i can load the saved value when i inject?

[
    {
        "id": "988a0d08a4dcba79",
        "type": "debug",
        "z": "f672d0ac69fd5b97",
        "name": "debug 10",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 240,
        "y": 560,
        "wires": []
    },
    {
        "id": "414ad5e002a2286e",
        "type": "debug",
        "z": "f672d0ac69fd5b97",
        "name": "debug 11",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 540,
        "y": 620,
        "wires": []
    },
    {
        "id": "769e797974b60a9d",
        "type": "inject",
        "z": "f672d0ac69fd5b97",
        "name": "startup",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "0.5",
        "topic": "",
        "payload": "load",
        "payloadType": "str",
        "x": 240,
        "y": 620,
        "wires": [
            [
                "280abe9818b0100f"
            ]
        ]
    },
    {
        "id": "440231587bd9d712",
        "type": "change",
        "z": "f672d0ac69fd5b97",
        "name": "kwh save",
        "rules": [
            {
                "t": "set",
                "p": "kwh",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 240,
        "y": 520,
        "wires": [
            [
                "988a0d08a4dcba79"
            ]
        ]
    },
    {
        "id": "280abe9818b0100f",
        "type": "change",
        "z": "f672d0ac69fd5b97",
        "name": "load kwh",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "kwh",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 620,
        "wires": [
            [
                "414ad5e002a2286e",
                "95511d01a2955634"
            ]
        ]
    }
]

How have you defined the context to be saved in settings.js?
see: Working with context : Node-RED

I got it, it was that i needed a delay to save at startup, as my initial 0 overwrote my saved value before it was getting loaded.

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