Everynet JSON Payload Parser

Everynet JSON Payload Parser

@Ronaldo Oliveira

Hi,

In my application I receive a Everyney JSON like this:

{
  "type": "uplink",
  "meta": {
    "network": "358b679dd88d47948f6e108677b4b79a",
    "packet_hash": "59a23fd7ac449263f7b56ed81830fde0",
    "application": "9405bbc000000002",
    "device_addr": "20aaaa02",
    "time": 1582039955.29871,
    "device": "9405bbc000000002",
    "packet_id": "47670fddfef3979e4f633dede36a2d02",
    "gateway": "b0fd0b7003d80000"
  },
  "params": {
    "payload": "AAAdAAAdAAAkAAAhAAARAAAL",
    "port": 2,
    "duplicate": false,
    "radio": {
      "hardware": {
        "status": 1,
        "chain": 1,
        "tmst": 3646173580,
        "snr": -2.5,
        "rssi": -108,
        "channel": 4,
        "gps": {
          "lat": -23.480249404907227,
          "lng": -46.80305862426758,
          "alt": 919
        }
      },
      "datarate": 0,
      "modulation": {
        "bandwidth": 125000,
        "type": "LORA",
        "spreading": 12,
        "coderate": "4/5"
      },
      "delay": 0.10613870620727539,
      "time": 1582039955.1759844,
      "freq": 916,
      "size": 31
    },
    "counter_up": 10,
    "lora": {
      "header": {
        "ack": false,
        "adr": true,
        "confirmed": true,
        "version": 0,
        "type": 4
      },
      "mac_commands": []
    },
    "rx_time": 1582039955.1759844,
    "encrypted_payload": "qeaEOgQcL6zqv/h0a5Yf1xrS"
  },
  "_id": 1582039954554
}

I want to show on dashboard some variables of this JSON like “payload”, “rssi”, “snr”, etc. For “payload” its working with this:

payload.find(item => item.variable === 'payload');

and this:

payload.push({ variable: 'payload', value: payload });

But the same code doesn’t work for “rssi”, “snr” and others. I realized that this variables no show on Device - Live Inspector. I can use this variables on dashboards?

Tks