Running Automapping Script
API automapping scripts enable data passed via API ingest to be automatically mapped to items on a room by room basis.
Each automapping script is custom for each client and clients may have multiple automapping scripts created.
To run the script you must first determine the room ID that the automapping is targetting.
Follow these steps:
Enter Admin area of EkkoSoft Critical
Select Administration > Rooms to bring up the list of available rooms
Click Edit for the room that you wish the automapping script to run
Note in the URL at the top, the ID of the room you have selected
Open the console. In Chrome this is Ctrl+Shift+I
In the console, paste the full 3 lines of the automapping script required. Making sure to change the ID value to the room ID from step 4.
Click Enter when ready and the script will start:

During Run Process
During the run process the console will indicate sensors that are added and items that are skipped. This will give an indication of any errors.

At the end a summary overview will be displayed indicating the result of the automapping - an example is shown below:

API Shadow Sensors -
“existing” - indicates the number of shadow sensors that are in existence prior to the automapping script,
“skipped” - how many have been skipped due to the automapping script not being designed to handle them.
“failed” - how many shadow sensors were not able to be promoted to active sensors
API Sensors - indicates the number of shadow sensors that have been promoted to active sensors.
“existing” - the existing number of API sensors that have been created prior to the process running.
“created” - Any newly mapped sensors will appear in “created”
“updated” - any existing sensors that have updated attributes will appear in “updated”
Mappings - indicates the number of mappings that were created as part of the script.
“skipped” indicates the number of API sensors for which an automapping rule does not exist, so has been skipped.
“failed” indicates the mapping already exists or there is a genuine failure that took place. If it is the first time running the script and failures >0 it is suggested to rerun the script.
“created” indicates the number of successful automappings created.
If there are any mappings failures indicated then it is suggested to run the script a 2nd time (repeat step 6)
Available Scripts
The following scripts can be run from the JS console in EkkoSoft Admin area
For G-Research
(new APIIngestBulkMapper.GRBulkMapper("/storage"))
.run({ type: "room", id: "1" })
.then(() => console.log("Finished"), () => console.log("Failed"))
Guide to using this script
The format needs to be:
<mapping_prefix>-<item_label>-<room_name>-<site_name>
Mapping Prefix options
PDU1
PDU2
PDU3
PDU4
PDU5
PDU6
PDU7
PDU8
BB
BB1
BB2
Notes:
PDUs dont include the prefix label
Busbar items do include the prefix label
Site name does not need to match
Room name must match
item labels can include hypens
e.g.
PDU8-Rack1-Room1-Site1 Current Inlet_pole 2 maps to
Rack1 in Room1
PDU8-R67-YH-Room4-Site1 maps to
R67-YH in Room4
BB1-4RT-Room2-Site2 Active_power maps to
BB1-44T in Room 2
For NorthC
(new APIIngestBulkMapper.NCBulkMapper("/storage"))
.run({ type: "room", id: "1" })
.then(() => console.log("Finished"), () => console.log("Failed"))
