Add semantic to the Node-RED msg payload with JSON-LD

Posted on Updated on

In the NODE-Red ecosystem, many nodes are built and published.
When someone creates a node that produces geo coordinates (this is an example), and another a node that consumes geo coordinates, it is very important that these two nodes can be linked together in NODE-Red. To achieve that, the former should produce a payload that the latter can read.

Using JSON or msg is not enough:

{
 "latitude" : "40.75",
 "longitude" : "73.98"
 }

Also consider another example:

{
"temperature" : "40"
}

What does it refer to? degrees Celsius or Fahrenheit?

We must agree on the content of the JSON object in the payload.

TheThingBox choice

In the ThingBox project (theThingbox.io) we decided to use JSON-LD to format the payload.

JSON-LD allows to uniquely define the content of a JSON object.

{
 "@type" : "http://schema.org/GeoCoordinates",
 "http://schema.org/latitude" : "40.75",
 "http://schema.org/longitude" : "73.98"
 }

When a node finds an object containing:

"@type" : "http://schema.org/GeoCoordinates"

then the semantic of the object is uniquely defined.

The members are also uniquely defined.

The previous object can be “compacted” by factoring paths into a context:

{
 "@context": "http://schema.org",
 "@type": "GeoCoordinates",
 "latitude": "40.75",
 "longitude": "73.98"
 }

Many objects are already defined in schema.org.
Find more about JSON-LD at http://json-ld.org  and use it in Nodes!

Rainbow, the connected toothbrush for children

Posted on Updated on

rainbow2
Tooth brushing is essential for a good hygiene and good health. This is something that we try to teach our children, but it is not always easy. Not easy to understand how to properly brush your teeth, not always easy to convince a child to go to the bathroom after eating …
Rainbow tries to answer this problem by proposing a toothbrush designed for children. With attractive colors (those of a rainbow) and fun application, Rainbow send information on your children’s brushing to a dedicated application. You can see the effectiveness of brushing, which will be compared to a “perfect” brushing and then share it with friends and family.
Source : http://www.usvigilant.com/rainbow/

Air France, KLM: finally solutions to track your luggage at the airport!

Posted on Updated on

If you have ever flown, you know how much baggage checking is stressful: afraid to miss the plane or worse, the baggage is lost … So many fears even more stressful when you are already lost baggage, which had so far no solution. Air France KLM is designeing two moduls to solve these two problems. First, a e-Tag, a label to hang on the bag to record his luggage from home. Second, a e-Track, GPS position sensor to track your luggage from your smartphone. Both equipment may be the salvation of many travelers. A consumer test is provided at the end of the year, and the baggage handler Samsonit plans to manufacture bags incorporating two similar modules.

KISI, Smart Lock

Posted on

Kisi1Kisi2

 

KISI, the new connected lock, controlled by your smartphone

Kisi is a new connected lock controlled by your smartphone. At home or office, set opening and closing times, give access to different people by email, remotely control the opening and closing of your doors.
With its application (Android and iOS), you keep control of your doors. And if you lose your smartphone? Do not panic, Kisi does not block the mechanical system, you can still use your key!

Source : http://www.getkisi.com/

How to : make a node-RED node

Posted on Updated on

A node is composed by two files : a .js and a .html file. They must have the same name.
Nodes are loaded from a folder in alphanumeric order. So you can prefix the name with a number to control a node, e.g 42-example.js an 42-example.js.

We will create a node example which display message in console.
In node-red/nodes, create a folder ‘example’.
Then create in this folder an example.js and an example.html file. Create a folder ‘icons’ and place a picture in it if you want to have one.

JS File

The .js contain the code of the node, that is to say it indicates what the node has to do.

example.js :

red is required for create the node. It’s better to write Require at the top as synchronous function.

var RED = require(process.env.NODE_RED_HOME+"/red/red");

Then, we implement the main function, called at the launch of node-RED, the parameter ‘n’ contains the data filled by the user in the user interface (UI).

function ExampleNode(n) {RED.nodes.createNode(this,n); // Create a RED node this.on("input", function(msg) { // when a message arrive var name = n.name; console.log(name+" receive : "+msg.payload); });

finally, we match the name “example” with the ExampleNode function

RED.nodes.registerType("example",ExampleNode);

HTML File

The .html file is used to describe the node in the UI.

example.html :

We begin with the form filled by the user

<script type="text/x-red" data-template-name="example">

Add a div for each properties.The for and id attributes identify the corresponding property (with the ‘node-input-‘ prefix)

<div class="form-row">
    <label for="node-input-topic"><i class="icon-tasks"></i> Topic</label>
    <input type="text" id="node-input-topic" placeholder="Topic">
</div>

By convention, most nodes have a ‘name’ property.

<div class="form-row">
     <label for="node-input-name"><i class="icon-tag"></i> Name</label>
     <input type="text" id="node-input-name" placeholder="Name">
 </div>

To finish this part of code, close the script tag :

 </script>

Next, we add the documentation displayed on the right of node-RED

<script type="text/x-red" data-help-name="example">
<!-- The first <p> is used as the pop-up tool tip when hovering over a node in the palette -->
<p>Example Node : display payload in console.</p>

And close again the script tag :

</script>

Finally, the node type is registered along with all of its properties

 <script type="text/javascript">
 RED.nodes.registerType('example',{ // match "example" with these properties
     category: 'input',      // the palette category - palette are define in public/index.html
     defaults: {             // defines the editable properties of the node
         name: {value:""},   //  along with default values.
         topic: {value:"", required:true}
     },
     inputs:1,                // set the number of inputs - only 0 or 1
     outputs:0,               // set the number of outputs - 0 to n
     color:"#FFCD45"          // "rgb(231, 231, 174)" can be used too
     icon: "arrow-in.png",    // set the icon (have to be in a icons folder, public/icons is priority)
     label: function() {      // sets the default label contents
         return this.name||this.topic||"example";
     },
     labelStyle: function() { // sets the class to apply to the label
         return this.name?"node_label_italic":"";
     }
 });
 </script>

 

Now, launch or reboot node-RED and you will see the example node on the left. If not, be sure your .js and .html have the same name, and check your .html. A node is displayed if there is a .html and a .js with the same name in the same folder, the .js has to exist but can be empty

.

Lupo by Lopu Team

Posted on

Lupo2

Lupo device comes in the form of a keyfob/ tag that can be attached to your keys, handbag, travel bags and other such valuable items you do not want to lose.

The Lupo fob connects with the Lupo smartphone App to offer:

1. FIND: Ring and find your keys/ tagged items from your phone and vice-vise;
2. OUT of RANGE Alert: Get alerted on your smartphone as soon as a tagged item goes out of range;
3. ANTI-THEFT: Enable anti-theft feature when you want to be notified if someone touches your valuable;
4. LOCK: Securely screen lock your computer and save power as you walk away from it;
5. TRACK-BACK: If some how a tagged item is lost, you can enable Lupo App to show on Google Maps where it could be. It’s like you can now do ‘Find my Handbag’, etc. with the Lupo same way in which ‘Find my iPhone’ is used;
6. REMOTE CONTROL APPS: Control the smart devices around you with Lupo’s remote controller. Now you can control Music, Presentation, Games and more on Bluetooth Smart devices with your Lupo.

Lupo is designed to offer ‘peace of mind’ on the go and offer freedom and flexibility in everyday life.




Source : http://www.mylupo.com/

Video call with the Bee-Wall

Video Posted on

Making a video call with a Bee-Wall. We tried it at Laval Virtual, it works !