Node-red http request and led connection

Hello I have a stream and when I send an http request in my stream, if the result is successful, the green light will light up if it fails, the red light will light up how can I do

[
    {
        "id": "0c977f0b2a123938",
        "type": "function",
        "z": "2aa19786181ce4dd",
        "name": "function 6",
        "func": "msg.condition = msg.payload\nmsg.ip = global.get(\"config.fm_settings.fm_ip\");\nmsg.headers = {\n    \"x-api-key\": global.get(\"config.fm_settings.fm_api_key\")\n};\n\nmsg.payload = {}\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 280,
        "y": 260,
        "wires": [
            [
                "b4280dcafd42a600"
            ]
        ]
    },
    {
        "id": "26005ee8a5306186",
        "type": "http request",
        "z": "2aa19786181ce4dd",
        "name": "",
        "method": "POST",
        "ret": "obj",
        "paytoqs": "ignore",
        "url": "http://{{{ip}}}/{{{api}}}/v5/{{{title}}}",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "credentials": {},
        "x": 670,
        "y": 260,
        "wires": [
            [
                "8de9175d5a40aa55",
                "3b6b8591834cd069"
            ]
        ]
    },
    {
        "id": "8de9175d5a40aa55",
        "type": "debug",
        "z": "2aa19786181ce4dd",
        "name": "debug 9",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 820,
        "y": 260,
        "wires": []
    },
    {
        "id": "b4280dcafd42a600",
        "type": "file in",
        "z": "2aa19786181ce4dd",
        "name": "read",
        "filename": "C:\\Users\\canoz\\.node-red\\config.yaml",
        "filenameType": "str",
        "format": "utf8",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 410,
        "y": 260,
        "wires": [
            [
                "ccbdb9cab3cd245c"
            ]
        ]
    },
    {
        "id": "ccbdb9cab3cd245c",
        "type": "yaml",
        "z": "2aa19786181ce4dd",
        "property": "payload",
        "name": "",
        "x": 530,
        "y": 260,
        "wires": [
            [
                "26005ee8a5306186"
            ]
        ]
    },
    {
        "id": "a829ebc20ea5c78f",
        "type": "inject",
        "z": "2aa19786181ce4dd",
        "name": "",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 110,
        "y": 260,
        "wires": [
            [
                "0c977f0b2a123938"
            ]
        ]
    },
    {
        "id": "3b6b8591834cd069",
        "type": "ui_led",
        "z": "2aa19786181ce4dd",
        "order": 0,
        "group": "41394b97354e5aba",
        "width": 0,
        "height": 0,
        "label": "",
        "labelPlacement": "left",
        "labelAlignment": "left",
        "colorForValue": [
            {
                "color": "#ff0000",
                "value": "false",
                "valueType": "bool"
            },
            {
                "color": "#008000",
                "value": "true",
                "valueType": "bool"
            }
        ],
        "allowColorForValueInMessage": false,
        "shape": "circle",
        "showGlow": true,
        "name": "",
        "x": 830,
        "y": 320,
        "wires": []
    },
    {
        "id": "41394b97354e5aba",
        "type": "ui_group",
        "name": "callboxvirtual",
        "tab": "5fba2751aacc5a8a",
        "order": 2,
        "disp": true,
        "width": "6",
        "collapse": false,
        "className": "index"
    },
    {
        "id": "5fba2751aacc5a8a",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Hello @cano.

What does this mean?

How do you define successful/unsuccessful? Maybe you can use a Status node to track the status of your HTTP node.

What are these red and green lights?
How are they connected to your Node-Red PC?
Do you have transistors/relays to control them?

I created a virtual led on node-red and I'm testing on that led. I don't have a physical led for now.

FYI: It looks like this user is continuing from this thread:

No, I'm done with the button side, now all I have to do is turn on the red warning led if the http request is successful if it is successful.

Do you know how to turn the LED red or green with an inject node?

No, unfortunately I don't know, I would appreciate if you could make a sample node structure.

I assume you want to change the color of a ui-led.
So what have you tried?

You should read this about the node:

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