1.0.1 • Published 8 years ago

node-red-contrib-thingrest v1.0.1

Weekly downloads
22
License
Apache-2.0
Repository
github
Last release
8 years ago

node-red-node-thingrest

A Node-RED node to talk to ThingWorx using HTTP REST protocol.

Install

Run the following command in the root directory of your Node-RED install, usually this is ~/.node-red .

    npm install node-red-node-thingrest

    or direct from github at

    npm install git+https://git@github.com/obiwan314/node-red-node-thingrest.git

Usage

Provides a single node - It accepts a msg.payload containing an object whose property names will be applied to the Thing the node is configured for.

###Input

This node acts as an output node. It expects to receive an msg object with a property of payload that maps directly to the Thing you are trying to update.

Example:

If the Thing you are trying to update has a String property called stringProperty and a Number property called numberProperty, the following payload would update these property values.

msg.payload = { stringProperty:"Hello World", numberProperty:345 };

The node contains a property, ThingName, which can be set when it is created. ThingName can be overridden by providing a msg.thingName property along with your payload.

Below is a simple example flow:

A sample flow updating two properties on the RedThing in a ThingWorx server.

The Update Property Values is a simple Inject Node to start the property update.

This is the configuration of the Function Node that sets the propoerty names and values to be updated.

The configuration for the Property Updates function.

This is the configuration of the ThingRest node that performs the update.

The configuration for the RedThing node.