Dynamic counter

Hi there,

I search for a node or a function which counts from 0 - 100 in different speed depends on the distance of the last input value.
For example the input range is between 0-1500 the output from 0-100. If there's an input about 1000 it should be count really fast up to 1000. Then the next incoming value is 900 it should count slowly downwards. If the next is only 100 then quickly down and so on ...

My first try is a PID controller but the range is not to set, and it's not possible to reset.

Any other ideas?

Thx in advance
Felix

What are you trying to control?

Are the input values coming in at a constant rate?

Hi, it's for a heating rod. I'd like to set a Power management which is more dynamic.
Actually it more a static range for power up and down.

The input signal is in a constant timerate, actually 1msg/s but it's possible to max 1msg/250ms.

[
    {
        "id": "394b90dd0f76e1eb",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "30",
        "payloadType": "num",
        "x": 710,
        "y": 3680,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "5cd54232cf19a43d",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "40",
        "payloadType": "num",
        "x": 710,
        "y": 3740,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "5c80f73f0335850b",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "50",
        "payloadType": "num",
        "x": 710,
        "y": 3800,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "512e3b7c11aa5c56",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "60",
        "payloadType": "num",
        "x": 710,
        "y": 3860,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "7273dcbf3e4c3224",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "70",
        "payloadType": "num",
        "x": 710,
        "y": 3920,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "329694499f1b0d71",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "80",
        "payloadType": "num",
        "x": 710,
        "y": 3980,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "1261dcc3c2f5fbb9",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "90",
        "payloadType": "num",
        "x": 710,
        "y": 4040,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "08982fa878da5df7",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "20",
        "payloadType": "num",
        "x": 710,
        "y": 3620,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "1be571d3c12523f9",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "10",
        "payloadType": "num",
        "x": 710,
        "y": 3560,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "12858cf00763e2a2",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "num",
        "x": 710,
        "y": 3500,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "d14404b6bac28543",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "-10",
        "payloadType": "num",
        "x": 710,
        "y": 3440,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "74256f09c8dc0619",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "-20",
        "payloadType": "num",
        "x": 710,
        "y": 3380,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "cf2ff1c36fd7fae9",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "-30",
        "payloadType": "num",
        "x": 710,
        "y": 3320,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "c1ddd4997a1f7a84",
        "type": "switch",
        "z": "6f607e7be4f8184e",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 930,
        "y": 3600,
        "wires": [
            [
                "f1fa5335c50eb855"
            ]
        ]
    },
    {
        "id": "25b6280d.1ecf6",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "decrement -",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1870,
        "y": 3640,
        "wires": [
            [
                "8a41c1.6006b64"
            ]
        ]
    },
    {
        "id": "285e0e19.b9680a",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "increment +",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1870,
        "y": 3560,
        "wires": [
            [
                "ce8d952f.18666"
            ]
        ]
    },
    {
        "id": "fda0a334.bc9588",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "reset",
        "repeat": "",
        "crontab": "",
        "once": false,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 1850,
        "y": 3600,
        "wires": [
            [
                "17cce981.975686"
            ]
        ]
    },
    {
        "id": "ce8d952f.18666",
        "type": "function",
        "z": "6f607e7be4f8184e",
        "name": "msg object",
        "func": "msg.increment = 3;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 2030,
        "y": 3560,
        "wires": [
            [
                "ac65bf94.6e609"
            ]
        ]
    },
    {
        "id": "17cce981.975686",
        "type": "function",
        "z": "6f607e7be4f8184e",
        "name": "msg object",
        "func": "msg.reset = true;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 2030,
        "y": 3600,
        "wires": [
            [
                "ac65bf94.6e609"
            ]
        ]
    },
    {
        "id": "8a41c1.6006b64",
        "type": "function",
        "z": "6f607e7be4f8184e",
        "name": "msg object",
        "func": "msg.decrement = 3;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 2030,
        "y": 3640,
        "wires": [
            [
                "ac65bf94.6e609"
            ]
        ]
    },
    {
        "id": "ac65bf94.6e609",
        "type": "counter",
        "z": "6f607e7be4f8184e",
        "name": "",
        "init": "0",
        "step": "1",
        "lower": "0",
        "upper": "100",
        "mode": "increment",
        "outputs": 2,
        "x": 2220,
        "y": 3600,
        "wires": [
            [
                "9bc803da88d7a81c"
            ],
            []
        ]
    },
    {
        "id": "f1fa5335c50eb855",
        "type": "switch",
        "z": "6f607e7be4f8184e",
        "name": "Eingang",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 1080,
        "y": 3600,
        "wires": [
            [
                "0ddbe65e8ee6dc7f"
            ]
        ]
    },
    {
        "id": "0ddbe65e8ee6dc7f",
        "type": "switch",
        "z": "6f607e7be4f8184e",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "gt",
                "v": "50",
                "vt": "num"
            },
            {
                "t": "btwn",
                "v": "50",
                "vt": "num",
                "v2": "100",
                "v2t": "num"
            },
            {
                "t": "lt",
                "v": "50",
                "vt": "num"
            },
            {
                "t": "lt",
                "v": "0",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 4,
        "x": 1290,
        "y": 3600,
        "wires": [
            [
                "8f457e3b4483feca"
            ],
            [
                "285690d8d097abcd",
                "98fc2e2e39d81a53"
            ],
            [
                "6b7bdc93c4810e47"
            ],
            [
                "98fc2e2e39d81a53",
                "285690d8d097abcd",
                "045b51a0549a85c3"
            ]
        ]
    },
    {
        "id": "8f457e3b4483feca",
        "type": "trigger",
        "z": "6f607e7be4f8184e",
        "name": "größer als",
        "op1": "true",
        "op2": "",
        "op1type": "bool",
        "op2type": "nul",
        "duration": "-250",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "stop",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1500,
        "y": 3520,
        "wires": [
            [
                "285690d8d097abcd",
                "ce8d952f.18666"
            ]
        ]
    },
    {
        "id": "6b7bdc93c4810e47",
        "type": "trigger",
        "z": "6f607e7be4f8184e",
        "name": "kleiner als",
        "op1": "true",
        "op2": "",
        "op1type": "bool",
        "op2type": "nul",
        "duration": "-250",
        "extend": false,
        "overrideDelay": false,
        "units": "ms",
        "reset": "stop",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 1500,
        "y": 3680,
        "wires": [
            [
                "98fc2e2e39d81a53",
                "8a41c1.6006b64"
            ]
        ]
    },
    {
        "id": "98fc2e2e39d81a53",
        "type": "change",
        "z": "6f607e7be4f8184e",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "stop",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1530,
        "y": 3640,
        "wires": [
            [
                "8f457e3b4483feca"
            ]
        ]
    },
    {
        "id": "285690d8d097abcd",
        "type": "change",
        "z": "6f607e7be4f8184e",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "stop",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1530,
        "y": 3560,
        "wires": [
            [
                "6b7bdc93c4810e47"
            ]
        ]
    },
    {
        "id": "9bc803da88d7a81c",
        "type": "rpi-gpio out",
        "z": "6f607e7be4f8184e",
        "name": "",
        "pin": "12",
        "set": "",
        "level": "0",
        "freq": "100",
        "out": "pwm",
        "bcm": true,
        "x": 2420,
        "y": 3580,
        "wires": []
    },
    {
        "id": "045b51a0549a85c3",
        "type": "switch",
        "z": "6f607e7be4f8184e",
        "name": "<0",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 1490,
        "y": 3600,
        "wires": [
            [
                "17cce981.975686"
            ]
        ]
    },
    {
        "id": "eca29a029066e63f",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "150",
        "payloadType": "num",
        "x": 710,
        "y": 4100,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "c459ebe4f79c0824",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1000",
        "payloadType": "num",
        "x": 710,
        "y": 4160,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "d7eb897f7fc06209",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "1700",
        "payloadType": "num",
        "x": 710,
        "y": 4220,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    },
    {
        "id": "2b0818ca6e61637d",
        "type": "inject",
        "z": "6f607e7be4f8184e",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "-2000",
        "payloadType": "num",
        "x": 710,
        "y": 3260,
        "wires": [
            [
                "c1ddd4997a1f7a84"
            ]
        ]
    }
]

Yes, 1msg/s but not fixed

Is this any help to you. The trigger node is to simulate the messages coming in every seoncd. If you want a smoother change you can, for example, change the trigger to 100msec then you will get intermediate messages 10 times/second.

[{"id":"394b90dd0f76e1eb","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"30","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3820,"wires":[["ada378c4e02b070e"]]},{"id":"5cd54232cf19a43d","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"40","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3880,"wires":[["ada378c4e02b070e"]]},{"id":"5c80f73f0335850b","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3940,"wires":[["ada378c4e02b070e"]]},{"id":"512e3b7c11aa5c56","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"60","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":4000,"wires":[["ada378c4e02b070e"]]},{"id":"7273dcbf3e4c3224","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"70","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":4060,"wires":[["ada378c4e02b070e"]]},{"id":"329694499f1b0d71","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"80","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":4120,"wires":[["ada378c4e02b070e"]]},{"id":"1261dcc3c2f5fbb9","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"90","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":4180,"wires":[["ada378c4e02b070e"]]},{"id":"08982fa878da5df7","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"20","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3760,"wires":[["ada378c4e02b070e"]]},{"id":"1be571d3c12523f9","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"10","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3700,"wires":[["ada378c4e02b070e"]]},{"id":"12858cf00763e2a2","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3640,"wires":[["ada378c4e02b070e"]]},{"id":"d14404b6bac28543","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-10","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3580,"wires":[["ada378c4e02b070e"]]},{"id":"74256f09c8dc0619","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-20","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3520,"wires":[["ada378c4e02b070e"]]},{"id":"cf2ff1c36fd7fae9","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-30","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3460,"wires":[["ada378c4e02b070e"]]},{"id":"eca29a029066e63f","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"150","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":4240,"wires":[["ada378c4e02b070e"]]},{"id":"c459ebe4f79c0824","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1000","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":4300,"wires":[["ada378c4e02b070e"]]},{"id":"d7eb897f7fc06209","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1700","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":4360,"wires":[["ada378c4e02b070e"]]},{"id":"2b0818ca6e61637d","type":"inject","z":"bdd7be38.d3b55","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"-2000","payloadType":"num","_mcu":{"mcu":false},"x":130,"y":3400,"wires":[["ada378c4e02b070e"]]},{"id":"c84c6986c5972fd6","type":"function","z":"bdd7be38.d3b55","name":"5 sec low pass filter","func":"// Applies a simple RC low pass filter to incoming payload values\nconst tc = 5*1000;       // time constant in milliseconds\nconst resetTime = 5*1000   // resets if no input for this time (msec)\n\nlet lastValue = context.get('lastValue');\nif (typeof lastValue == \"undefined\") lastValue = msg.payload;\nconst lastTime = context.get('lastTime') || null;\nconst now = new Date().getTime();\nconst currentValue = msg.payload;\nlet newValue;\nif (lastTime === null) {\n    // first time through\n    newValue = currentValue;\n} else { \n    const dt = now - lastTime;\n    if (dt > resetTime) {\n        // too long has elapsed since last input so reset\n        newValue = currentValue\n    } else {\n        if (dt > 0) {\n            const dtotc = dt / tc;\n            newValue = lastValue * (1 - dtotc) + currentValue * dtotc;\n        } else {\n            // no time has elapsed leave output the same as last time\n            newValue = lastValue;\n        }\n    }\n}\ncontext.set('lastValue', newValue);\ncontext.set('lastTime', now);\n\nmsg.payload = newValue;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"_mcu":{"mcu":false},"x":590,"y":3880,"wires":[["1dc66e8c5f7edb4d"]]},{"id":"1dc66e8c5f7edb4d","type":"debug","z":"bdd7be38.d3b55","name":"debug 95","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","_mcu":{"mcu":false},"x":600,"y":3800,"wires":[]},{"id":"ada378c4e02b070e","type":"trigger","z":"bdd7be38.d3b55","name":"","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"-1","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"_mcu":{"mcu":false},"x":400,"y":3880,"wires":[["c84c6986c5972fd6"]]}]

Thx, but it's more a PI controller with a reset by pausing the incomming signal.
In my case I control a heating rod with the overpower Watt from my PV system.
I can read the power consumption of my house positiv and negativ (overpower). So, if i can read the there're 250 Watt of overpower i can send the signal to my heater to set nearby 250 Watt, but then my system recognize that there's no overpower an shut down the heater ... and so on.
My solution now is to trigger the heater slowly (with fixed speed) to power up the Watt consuption till the Overpower is betwen 50-100 Watt to pause the trigger (counter). If it's less then 50 Watt then it triggers the counter fast down to (best case) 50-100 Watt and very importend is if there´s a positiv consumption of my house i reset all triggers (up & down counter) to 0 to get no power consumption of the heater. My only problem is that the trigger node is in a fixed speed. It's much better if there´s a higher different between the last and the newest value it should be a fast trigger, NOT a higher value. And i need to stop/reset this trigger.

Hopefully it's now better to understand my "problem".

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