Node msg Conventions
Clone this wiki locally
There are a few reserved properties within the structure of the msg objects being passed around in node-RED.
msg.payload - contains the main body of the message. For example, the text of a Tweet, the content of a webpage or a sensor reading.
msg.title - a title giving a good representation of what the message contains.
msg.description - a brief explanation of what data is contained within the message.
msg.data - some APIs provide large responses. For example, the Twitter api returns a huge object for each tweet containing many properties beyond just the text. This property can be used to store the original response - allowing access to all of the properties, not just those that get pulled out into
msg.location - an object containing properties representing location information.
- msg.location.lat - Latitude
- msg.location.lon - Longitude
- msg.location.name - the name of a location
For Fitness/activity based nodes/flows:
- msg.payload.id - The ID of the activity in the given fitness system/API
- msg.payload.type - The type of the activity, example: run/cycle ride
- msg.payload.duration - Duration of the activity in seconds
- msg.payload.distance - Distance of activity in metres
- msg.payload.calories - Calories burned during activity in kilocalories