Need flow to output messages based on input from dashboard

Hi, i am completely new in node red.
i need a help to create a flow which can output "cool" and "off" based on the value between range of 33 and 29 respectively but i should also be able to change the range from node red dashboard using ui_numeric node.
kindly help.
thanks

For the range you could use a switch node:

image

Maybe start with fixed values first and once this is working add the dashboard components / features.

What have you tried so far?

Edit: Reading my answer above is maybe not what you are trying to do. But I think the switch node can help to solve your problem.

so far i have figured out to output desired payload based on the reading received from temperature sensor, but i cant figure out how to change value range usingui_numeric node from nodered dashboard.

[
    {
        "id": "3254cce5cc258de7",
        "type": "change",
        "z": "dd8401f7cbde111a",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "",
                "fromt": "num",
                "to": "off",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 160,
        "wires": [
            [
                "238b5152daecfc19"
            ]
        ]
    },
    {
        "id": "04026bf364d23a06",
        "type": "switch",
        "z": "dd8401f7cbde111a",
        "name": "aircon",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "lt",
                "v": "29",
                "vt": "num"
            },
            {
                "t": "gt",
                "v": "33",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 190,
        "y": 180,
        "wires": [
            [
                "3254cce5cc258de7"
            ],
            [
                "325aadcf51871d90"
            ]
        ]
    },
    {
        "id": "325aadcf51871d90",
        "type": "change",
        "z": "dd8401f7cbde111a",
        "name": "",
        "rules": [
            {
                "t": "change",
                "p": "payload",
                "pt": "msg",
                "from": "",
                "fromt": "num",
                "to": "cool",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 200,
        "wires": [
            [
                "238b5152daecfc19"
            ]
        ]
    },
    {
        "id": "b451afc88035cde3",
        "type": "link in",
        "z": "dd8401f7cbde111a",
        "name": "temp state",
        "links": [
            "8eea095bbc88c434"
        ],
        "x": 55,
        "y": 180,
        "wires": [
            [
                "04026bf364d23a06"
            ]
        ]
    },
    {
        "id": "238b5152daecfc19",
        "type": "debug",
        "z": "dd8401f7cbde111a",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 180,
        "wires": []
    }
]

As a start you can try something like this:

[{"id":"3254cce5cc258de7","type":"change","z":"bbae5ac0bb4edd17","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":240,"wires":[["238b5152daecfc19"]]},{"id":"04026bf364d23a06","type":"switch","z":"bbae5ac0bb4edd17","name":"aircon","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"lower_level","vt":"flow"},{"t":"gt","v":"upper_level","vt":"flow"}],"checkall":"true","repair":false,"outputs":2,"x":550,"y":260,"wires":[["3254cce5cc258de7"],["325aadcf51871d90"]]},{"id":"325aadcf51871d90","type":"change","z":"bbae5ac0bb4edd17","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"cool","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":280,"wires":[["238b5152daecfc19"]]},{"id":"b451afc88035cde3","type":"link in","z":"bbae5ac0bb4edd17","name":"temp state","links":[],"x":315,"y":260,"wires":[["04026bf364d23a06"]]},{"id":"238b5152daecfc19","type":"debug","z":"bbae5ac0bb4edd17","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":930,"y":260,"wires":[]},{"id":"e9daf22993fa22f9","type":"ui_numeric","z":"bbae5ac0bb4edd17","name":"","label":"off below","tooltip":"","group":"ed481d8c.f9fed","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":0,"max":"30","step":1,"x":380,"y":120,"wires":[["070f2ec29a569294"]]},{"id":"ca14a8b062296ee9","type":"ui_numeric","z":"bbae5ac0bb4edd17","name":"","label":"on above","tooltip":"","group":"ed481d8c.f9fed","order":2,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"topic","topicType":"msg","format":"{{value}}","min":0,"max":"50","step":1,"x":380,"y":180,"wires":[["01758f1130c97e88"]]},{"id":"070f2ec29a569294","type":"change","z":"bbae5ac0bb4edd17","name":"","rules":[{"t":"set","p":"lower_level","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":120,"wires":[[]]},{"id":"01758f1130c97e88","type":"change","z":"bbae5ac0bb4edd17","name":"","rules":[{"t":"set","p":"upper_level","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":180,"wires":[[]]},{"id":"ed481d8c.f9fed","type":"ui_group","name":"Tab 1","tab":"1dca0b33.0ce725","order":1,"disp":true,"width":"6","collapse":false},{"id":"1dca0b33.0ce725","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

@rko thank you so much sir, that exactly what i needed and it perfectly worked for me after few configuration. thanks agaon

1 Like

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