zwave: value changed : msg : Objectobjecttopic: "zwave: value changed"payload: objectnodeid: 3cmdclass: 38cmdidx: 0instance: 1oldState: 1currState: 50label: "Level"units: ""value: objectvalue_id: "3-38-1-0"node_id: 3class_id: 38type: "byte"genre: "user"instance: 1index: 0label: "Level"units: ""help: ""read_only: falsewrite_only: falsemin: 0max: 255is_polled: falsevalue: 50zwave: value changed : msg.payload : string[372]"{"nodeid":3,"cmdclass":38,"cmdidx":0,"instance":1,"oldState":44,"currState":99,"label":"Level","units":"","value":{"value_id":"3-38-1-0","node_id":3,"class_id":38,"type":"byte","genre":"user","instance":1,"index":0,"label":"Level","units":"","help":"","read_only":false,"write_only":false,"min":0,"max":255,"is_polled":false,"value":99},"uuid":"12312344412341234"}"Given your original message (forget about converting it to a single string... that makes it unnecessarily harder) you can access the two properties as:
msg.payload.oldState
and
msg.payload.currState
So if you have a function with two outputs, you can do:
var M1 = {
payload: msg.payload.oldState
};
var M2 = {
payload: msg.payload.currState
};
return [M1, M2];
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/ddd546fe-ae21-4f20-97e8-64f9a5c4b80d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
That makes sense.
My apologies Nick, didn't see your reply. Went to spam for some reason.
I'm taking a few Java scripting classes, and won't be asking these easy questions here. Appreciate you taking the time to reply. I'll give it a go when I get home.
Phone added an extra space.