Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Node msg Conventions

zobalogh edited this page Dec 10, 2014 · 7 revisions

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.payload.

  • 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
    • msg.location.city
    • msg.location.country
  • msg.time - a time. The time should be either JavaScript Date object, or a number of milliseconds since epoch.

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
  • msg.payload.starttime - JavaScript Date object representing the start time of the activity

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.