Http request for web relay

i am new to this and trying to use a http request to get the status of a multi 8-ch web relay.
i get the below and the "output" is what i am interested in "10010100" one digit per relay first digit is 1 so the relay is on second digit is 0 relay 2 is off and so on. i want to split all 8 digits into there own output to turn a led on on the dashboard or get a true or false for each relay. how or what would be the best way for me to do what i am looking to do?

msg.payload : Object
object
cmd: "state"
output: "10010100"
input: "00000100"
sn: "618e79"

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path/value for any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

I recommend watching this playlist: Node-RED Essentials. The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

As you are new start with low code methods, as you advance and feel more confident you can introduce code.
here is a low code example, but take Steve's advise and watch the essential videos.

[{"id":"f916b186a40d0ca1","type":"inject","z":"d1395164b4eec73e","name":"","props":[{"p":"payload.output","v":"10010100","vt":"str"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":210,"y":7540,"wires":[["7e19471fa95e50e1"]]},{"id":"7e19471fa95e50e1","type":"split","z":"d1395164b4eec73e","name":"","splt":"1","spltType":"len","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","property":"payload.output","x":350,"y":7540,"wires":[["da7d9d98a29c3151","24e9e6c7ef8caee9"]]},{"id":"da7d9d98a29c3151","type":"switch","z":"d1395164b4eec73e","name":"","property":"payload.output","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":470,"y":7540,"wires":[["4c6218d6960c47ca"],["bac4a41f2fe99b7d"]]},{"id":"24e9e6c7ef8caee9","type":"debug","z":"d1395164b4eec73e","name":"lsee full message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":464.2021179199219,"y":7489.7333984375,"wires":[]},{"id":"4c6218d6960c47ca","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":7520,"wires":[["c4a9adb6ee24b8e7"]]},{"id":"bac4a41f2fe99b7d","type":"change","z":"d1395164b4eec73e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":7560,"wires":[["c4a9adb6ee24b8e7"]]},{"id":"c4a9adb6ee24b8e7","type":"switch","z":"d1395164b4eec73e","name":"","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"}],"checkall":"false","repair":false,"outputs":3,"x":490,"y":7660,"wires":[["958cf7df0bfeaa37"],["a80d474f6bde337d"],["63328b91ba3adb0a"]]},{"id":"958cf7df0bfeaa37","type":"debug","z":"d1395164b4eec73e","name":"led 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":7640,"wires":[]},{"id":"a80d474f6bde337d","type":"debug","z":"d1395164b4eec73e","name":"led 2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":7680,"wires":[]},{"id":"63328b91ba3adb0a","type":"debug","z":"d1395164b4eec73e","name":"led 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":630,"y":7720,"wires":[]}]

How to import/export a flow

The others have said how to get to the data you want but not how to split that data into the individual digits.

Because the data is a STRING, you can use JavaScript in a function node to split - something like:

msg.relayStatus = msg.payload.output.split('')
return msg

Which gives you the split data that looks like this:

The status of relay 1 would be msg.relayStatus[0]

I beleive my flow shows how to -

I could not get any of this to work.
TotallyInformation just gave me the same output.
E1cid i am not sure about any of this.
i was able to get it into a array but still do not know if this will help me get to the end goal.
msg.payload : array[8]
array[8]
0: "1"
1: "0"
2: "0"
3: "0"
4: "0"
5: "1"
6: "0"
7: "0"

and i can a path of payload[0],payload[1],,, out of that

relay 0 and 5 is on.
i will try reading more and go from there.

You could do something like this:

in a function node:

const states = []
function checkRelays(state) {
    
    for (let i = 0; i < state.length; i++) {
        const relayState = state[i] === '1' ? true : false;
        states.push({payload:relayState})
    }
}

const input = checkRelays(msg.payload)

return [...states]

example flow:

[{"id":"256efbf179ac9630","type":"inject","z":"c8d44844ba5acdbd","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"10010100","payloadType":"str","x":540,"y":3920,"wires":[["e1447b35ef93b036"]]},{"id":"4ef253c26a0aa929","type":"debug","z":"c8d44844ba5acdbd","name":"debug 670","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3800,"wires":[]},{"id":"e1447b35ef93b036","type":"function","z":"c8d44844ba5acdbd","name":"function 312","func":"const states = []\nfunction checkRelays(state) {\n    \n    for (let i = 0; i < state.length; i++) {\n        const relayState = state[i] === '1' ? true : false;\n        states.push({payload:relayState})\n    }\n}\n\nconst input = checkRelays(msg.payload)\n\nreturn [...states]","outputs":8,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":730,"y":3920,"wires":[["4ef253c26a0aa929"],["a5d8b089ba2a42ea"],["5a7e2b01179f6f96"],["ada2265851f99f40"],["161b03708cfe9666"],["20cb51b2f2bd0ace"],["1e9e1d8ae17ca8ef"],["34e2304bd12fd1a2"]]},{"id":"a5d8b089ba2a42ea","type":"debug","z":"c8d44844ba5acdbd","name":"debug 671","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3840,"wires":[]},{"id":"5a7e2b01179f6f96","type":"debug","z":"c8d44844ba5acdbd","name":"debug 672","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3880,"wires":[]},{"id":"ada2265851f99f40","type":"debug","z":"c8d44844ba5acdbd","name":"debug 673","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3920,"wires":[]},{"id":"161b03708cfe9666","type":"debug","z":"c8d44844ba5acdbd","name":"debug 674","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":3960,"wires":[]},{"id":"20cb51b2f2bd0ace","type":"debug","z":"c8d44844ba5acdbd","name":"debug 675","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":4000,"wires":[]},{"id":"1e9e1d8ae17ca8ef","type":"debug","z":"c8d44844ba5acdbd","name":"debug 676","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":4040,"wires":[]},{"id":"34e2304bd12fd1a2","type":"debug","z":"c8d44844ba5acdbd","name":"debug 677","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":990,"y":4080,"wires":[]}]

bakman2
Yes, that did it Thank you.
Thank you everyone for your help and merry Christmas.
I am new and this looks to be a powerful thing and it is great to have a place where everyone helps with what they can. I still have a lot to learn.

Come to think of it; it could even be a one-liner:

return [...msg.payload.split("").map(x => x == '1' ? {payload:true} : {payload:false})]

yes, that works as well.