code: func (thingsboardjsonTr thingsboardJSONFormatter) Format(event *contract.Event) []byte {
  
  	type Device struct {
  		Ts     int64             `json:"ts"`
  		Values map[string]string `json:"values"`
  	}
  
  	values := make(map[string]string)
  	for _, reading := range event.Readings {
  		values[reading.Name] = reading.Value
  	}
  
  	var deviceValues []Device
  	deviceValues = append(deviceValues, Device{Ts: event.Origin, Values: values})
  
  	device := make(map[string][]Device)
  	device[event.Device] = deviceValues
  
  	b, err := json.Marshal(device)
  	if err != nil {
  		LoggingClient.Error(fmt.Sprintf("Error parsing ThingsBoard JSON. Error: %s", err.Error()))
  		return nil
  	}
  	return b
  }
docs: // ThingsBoard JSON formatter
  // https://thingsboard.io/docs/reference/gateway-mqtt-api/#telemetry-upload-api