AnsweredAssumed Answered

Parsing json for IOT experimentation

Question asked by jpdeboosesrifrance-fr-esridist Employee on Apr 25, 2018
Latest reply on Jan 15, 2019 by vvchan93

Hi,

 

i need to parse this json with geoevent 10.5.0 (device send temperature, humidity and battery level).

 

SyntaxEditor Code Snippet

{   "measurements":   [     {       "doubleValue": 95.66929133858267,       "type": "Battery",       "unit": "%"    },     {       "doubleValue": 100,       "type": "Humidity",       "unit": "%"    },     {       "doubleValue": 11.375,       "type": "Temperature",       "unit": "�C"    },     {       "doubleValue": 11.375,       "type": "Temperature_Rosee",       "unit": "�C"    }   ],   "port": 3,   "deviceName": "Azay-Le-Rideau RD 751 - PR 56",   "deviceReference": null,   "deviceTypeRef": null,   "eui": "70b3d580a01034f1",   "gatewayEui": null,   "payloadHex": "03f3847c893000b668",   "rssi": 0,   "seqn": 1587,   "size": 0,   "datr": null,   "freq": null,   "snr": 0,   "latitude": 47.22267150878906,   "longitude": 0.49931803345680237,   "spreadFactor": 0,   "timestamp": "2018-04-04T13:59:36.871Z"}

I created an input :

geoevent definitation created by geoevent :


i use a field mapper

in my output i have this :

CD37synox-rest-json-in,"[{""doubleValue"":18.3125,""type"":""Temperature"",""unit"":""°c""},{""doubleValue"":18.3125,""type"":""Temperature_Rosee"",""unit"":""°c""},{""doubleValue"":100.0,""type"":""Humidity"",""unit"":""%""},{""doubleValue"":94.48818897637796,""type"":""Battery"",""unit"":""%""}]",3,Tork RD 7060 - PR 70,,,70b3d580a010353f,,03f086718930012567,0,3421,0,,,0,47.122864,0.43538886,0,2018-04-25T11:40:37.954+02:00

 

my problem is how to seperate all values from measurements array.

 

i try with this but i have the same results.

 

i try to put in input JSON Object Name = measurements, but geoevent definition is not ok :

i try to split with GitHub - Esri/field-splitter-for-geoevent: ArcGIS GeoEvent Server Sample Processor for Splitting fields with CSV values … 

but after i have 4 rows in my output.

 

Could you help me to understand how to recover unique value Battery, Humidity, Temperature, Temperature_Rosee and other fileds in the same record ?

(after i need to create a table to store data and send a notification when temperature is under 3°C)

Outcomes