Create Physical & Logical Interfaces
IoT device data must be mapped from physical devices that are reading the metrics on assets to a logical interfaces that represent that whole asset or system you will monitor. Physical Interfaces are what are used to save the device data into the Monitor. Logical Interfaces are what Monitor uses to create asset types and assets with their corresponding metric values. In this exercise you will use Monitor to create:
Create the Physical Interface
Note
Alternate option for step 5 is to click Use Last Event Cache
enter the name of the device ID 111137F8
. Which ever you
have in your data. pump_co
event will appear if you already have the simulator running. This corresponds to the Python
device simulator script you will run in the next exercise. See image for Event cache
-
Still in the Watson IoT Platform, go to the
Device Types
tab menu, search then selectpump_co
, -
Click on the
Interface
tab menu and clickCreate Physical Interface
button. Enter the namepump_co_pi
, ClickNext
. -
Click
Create event type
button -
If your pump simulator is sending data you can wait for the dialog to fill in with your event data. Otherwise you can set the payload by click on
Create event type
button. AddDevice Event Type
to thePhysical Interface
by uploading a json file that contains a payload similar to the one below. Replaceco
with your initials for your eventID.{ "EventName": "event", "EventDescription": "Device event", "EventID": "pump_co", "Payload": { "evt_timestamp": "2020-01-19T03:59:53.03Z", "speed": 1124, "head": 54.424, "pump_mode": "a", "flow": 115.934, "voltage": 274, "POWER": 2.664, "CURRENT": 8.69 } }
-
In the dialog click on
Import
link and drag the event_template.json file into the dialog. -
Click the
Add
button -
Click the
Add Property
button. You must change thetype
from string totimestamp
for theevet_timestamp
. ClickSelect
button.
-
click the
3 dots
on theevet_timestamp
row. -
Click edit
pencil icon
-
Click select box for
Event
named. -
Click the check box next to
evt_timestamp
and change theEvent
,Data Type
toString(Date Time)
-
Click
Done
. -
Click
Done
. Again.
You now are able to save the device data that is sent from any device to this Device Type physical interface named
pump_co_pi
. Stay on the current page and continue to the next exercise below.
Create the Logical Interface
Logical interfaces allow you to map the metrics from the physical device types into a single Entity Type for Monitor.
-
Click
Create Logical Interface
button. -
Change the default name
pump_co_li
, clickNext
. -
Tick the
Allow Additional Properties
toON
and then ClickAdd Property
button. -
Click the
Select
button for theevt_timestamp
. -
In the dialog
Type
field, selectString (date-time)
and clickSave
button. -
Click
Add Property
again for all the remaining metrics leaving the values as is shown below. ) ) -
Click
Next
, click linkNo event notifications
-
change to
All events
and click thex
to close the dialog box. -
Click
Apply
, thenDone
. -
Click
Activate
twice. -
Click
Done
.
You now are able to create dashboards and calculated metrics using the device data that is sent by any device into Monitor. You must wait upto 10 minutes to start seeing your devices show up in Monitor.