IoT

How to load Maximo meter readings via IBM Watson IoT platform

How to load Maximo meter readings via IBM Watson IoT platform
How to load Maximo meter readings via IBM Watson IoT platform

The best way to approach to the IoT world it’s for fun , the other way to approach to the IoT is to connect devices and build applications that learn from the physical world and analyze data from any source. The IBM Watson IoT platform scaling through cloud-based services and using rich analytics, it provides organizations with new insight for innovation and transformation.

In this articles I’m going to provide the code developed to implement the End-to-End Scenario: how to load Maximo meter readings via IBM Watson IoT platform.

For a theoretical point of view I suggest to read previous posts.

I used the ESP8266, a microcontroller Arduino compatible, as IoT device, and IBM Maximo asset manager as application and industry solution. If you’re just starting out, read Connect an ESP8266 to IBM Watson IoT Platform with Arduino SDK.

There are three stages:

First the IoT device sends data to IBM IoT platform by MQTT protocol. Here is the sketch to connect an ESP8266 to IBM Watson IoT Platform with Arduino SDK, using the WiFiClient library and the MQTT and PubSubClient library

You have to register the device on IBM Watson IoT platform with your ORGID, DEVICE_TYPE, DEVICEID and TOKEN

Then a nodeRED flow handles the data and updates the Maximo’s meter:

How to load Maximo meter readings via IBM Watson IoT platform
How to load Maximo meter readings via IBM Watson IoT platform

Here is my Node Red code, use the import from clipboard utility to copy and paste this flow into your Node Red environment:

You have to change the MAXIMOIP, SITEID and user PASSWORD inside the Maximo rest-API.

In the final stage you have to configure a location with a continuous meter called RANGE:

IBM Maximo asset manager continuos meter readings
IBM Maximo asset manager continuos meter readings

For more details contact me, your feedback is welcome.

 

 

 

Tags
Show More

Related Articles

2 Comments

  1. Thanks for the code and instructions Mario – really helped and I have my sensor passing meter readings to Maximo 🙂

    I do have a slight issue with dates though – what does this function do in node red? Is it re-formatting the date string from the MQTT stream into something Maximo can accept? I appear to have a date miss-match where Maximo is thinking the entered date is in the future. I tried hard-coding a date and it works fine – but obviously only the once as you can’t have 2 entries with the same date/time.

    function dateFormat (date, fstr, utc) {
    utc = utc ? ‘getUTC’ : ‘get’;
    return fstr.replace (/%[YmdHMS]/g, function (m) {
    switch (m) {
    case ‘%Y’: return date[utc + ‘FullYear’] (); // no leading zeros required
    case ‘%m’: m = 1 + date[utc + ‘Month’] (); break;
    case ‘%d’: m = date[utc + ‘Date’] (); break;
    case ‘%H’: m = date[utc + ‘Hours’] (); break;
    case ‘%M’: m = date[utc + ‘Minutes’] (); break;
    case ‘%S’: m = date[utc + ‘Seconds’] (); break;
    default: return m.slice (1); // unknown code, remove %
    }
    // add leading zero if required
    return (‘0’ + m).slice (-2);
    });
    }
    var dateNow = dateFormat (new Date (), “%Y-%m-%dT%H:%M:%S”, true);

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

HTML Snippets Powered By : XYZScripts.com