• Protocols
  • Getting vehicle.mileage in meters instead of KM

HI Everyone I have configured concox wetrack2 device into my flespi and while testing the data found out that the vehicle.mileage is coming in meters instead of KM. where it is supported for device to send the data only in KM as per the protocol document from concox. please anyone help me with this @namo

    Hello. You can use expression plugin.

    {
      "required": false,
      "enabled": true,
      "validate_message": "vehicle.mileage",
      "item_type": 11,
      "name": "mileage m->km",
      "configuration": {
        "expressions": [
          {
            "expression": "vehicle.mileage / 1000",
            "parameter": "vehicle.mileage.km"
          }
        ]
      },
      "priority": 0,
      "type_id": 7,
      "timezone": "UTC"
    }

    Yeah I got it I can use plugin to fix this, thank you dexif .

    one more thing I am getting two set of messages packets like this from the device.
    {"channel.id":94881,"device.id":2868921,"device.name":"concox we track","device.type.id":206,"external.powersource.voltage":14.22,"ident":"358735078744140","peer":"223.180.224.142:51545","protocol.id":13,"protocol.number":148,"server.timestamp":1646314194.807815,"timestamp":1646314194.807815}

    and one more packet as
    {"channel.id":94881,"device.id":2868921,"device.name":"concox we track","device.type.id":206,"engine.ignition.status":true,"gnss.realtime.status":true,"gsm.cellid":48233,"gsm.lac":20270,"gsm.mcc":"404","gsm.mnc":"49","ident":"358735078744140","peer":"223.180.224.142:51545","position.direction":283,"position.latitude":17.442879,"position.longitude":78.369529,"position.satellites":15,"position.speed":26,"position.valid":true,"protocol.id":13,"protocol.number":18,"server.timestamp":1646314197.821796,"timestamp":1646314197,"vehicle.mileage":4729}

    I want to merge both the data into a single message packet so that it supports the validation that is build at my end platform where it look for both 'external.powersource.voltage : 14.22' and 'engine.ignition.status : true' in a single message packet to push it to the front end.
    can you please help me with this.

      You can't merge messages, but you can try adding options from telemetry using the item telemetry plugin:

      {
        "required": false,
        "enabled": true,
        "validate_message": "",
        "item_type": 11,
        "name": "Add powersource voltage and ignition status from telemetry",
        "configuration": {
          "parameters": [
            "external.powersource.voltage",
            "engine.ignition.status"
          ]
        },
        "priority": 0,
        "type_id": 11,
        "timezone": "UTC"
      }

      You can also configure the parameter validate_message: "engine.ignition.status" (for example) to filter messages without this parameter.

      dexif won't be able to use this since in every data packets sent from device "external.powersource.voltage" and "engine.ignition.status" are coming alternatively in each packet.

        Write a Reply...