Char values all the same in ArduinoJson output

This is most likely a basic question but I’m used to Python, PHP and JS where strings and other data types are really easy to work with.

For some reason this bit of code produces the output below where all three char values output as intended but, when added to JSON via the ArduinoJson library, the three values always present as the last temp_3 value-. What did I do wrong?

  char fValue[16];
  char *temp_1 = dtostrf(sensors.getTempC(sensor1) + temp_offset_1, 3, 2, fValue);
  TelnetStream.print("Outgoing Temp(*C): ");
  TelnetStream.println(temp_1);

  char *temp_2 = dtostrf(sensors.getTempC(sensor2) + temp_offset_2, 3, 2, fValue);
  TelnetStream.print("Incoming Temp(*C): ");
  TelnetStream.println(temp_2);

  char *temp_3 = dtostrf(sensors.getTempC(sensor3) + temp_offset_3, 3, 2, fValue);
  TelnetStream.print("Outside Temp(*C): ");
  TelnetStream.println(temp_3);


    // publish stuff
    StaticJsonBuffer<300> JSONbuffer;
    JsonObject& JSONencoder = JSONbuffer.createObject();
  
    JSONencoder["outgoing_temp"] = temp_1;
    JSONencoder["incoming_temp"] = temp_2;
    JSONencoder["outside_temp"] = temp_3;
    char JSONmessageBuffer[108];
    JSONencoder.printTo(JSONmessageBuffer, sizeof(JSONmessageBuffer));
    TelnetStream.print("Publishing to MQTT: ");
    TelnetStream.println(JSONmessageBuffer);

    char *topic = "heat_exchange"; // Topic to subcribe to

    client.publish(topic, JSONmessageBuffer);

Outputs this. Sensor values are unique. JSON values all use the last sensor value.:

Requesting temperatures ...... DONE
Outgoing Temp(*C): 18.78
Incoming Temp(*C): 18.75
Outside Temp(*C): 18.69
Publishing to MQTT: {"outgoing_temp":"18.69","incoming_temp":"18.69","outside_temp":"18.69"}

when you do

    JSONencoder["outgoing_temp"] = temp_1;
    JSONencoder["incoming_temp"] = temp_2;
    JSONencoder["outside_temp"] = temp_3;

your temp_x pointers all point to the same fValue buffer (which holds the last conversion to float). You only allocated one buffer…

  char outgoingTempString[16];
  char incomingTempString[16];
  char outsideTempString[16];

  dtostrf(sensors.getTempC(sensor1) + temp_offset_1, 5, 2, outgoingTempString);
  TelnetStream.print("Outgoing Temp(*C): ");
  TelnetStream.println(outgoingTempString);

  dtostrf(sensors.getTempC(sensor2) + temp_offset_2, 5, 2, incomingTempString);
  TelnetStream.print("Incoming Temp(*C): ");
  TelnetStream.println(incomingTempString);

  dtostrf(sensors.getTempC(sensor3) + temp_offset_3, 5, 2, outsideTempString);
  TelnetStream.print("Outside Temp(*C): ");
  TelnetStream.println(outsideTempString);

// publish stuff
    StaticJsonBuffer<300> JSONbuffer;
    JsonObject& JSONencoder = JSONbuffer.createObject();
  
    JSONencoder["outgoing_temp"] = outgoingTempString;
    JSONencoder["incoming_temp"] = incomingTempString;
    JSONencoder["outside_temp"]  = outsideTempString;