How can I combine sensor data and time on a mqtt temperature/humidity sensor?

Dear HomeAssistant assistants,

I am having trouble getting the configurations right for my temperature and humidity sensors. The issue with me is, that I cannot connect sensor time to each temperature or humidity value.

Apologies, if this question was already asked or is explained in the documentation. I just couldn’t find it.

Here is what I receive via mqtt:

{"time" : "2024-10-15 12:49:12", "model" : "Ambientweather-F007TH", "id" : 29, "channel" : 6, "battery_ok" : 1, "temperature_C" : 20.722, "humidity" : 63, "mic" : "CRC"}

My non-working configuration looks like:

sensor:
  - name: "Time Balcony"
    unique_id: "time_balkon"
    state_topic: "mqtt/sensors/balcony"
    value_template: "{{ value_json.time | as_datetime | as_local }}"
  - name: "Temperature Balcony"
    unique_id: "temperature_balcony"
    state_topic: "mqtt/sensors/balcony"
    state_class: "measurement"
    unit_of_measurement: "°C"
    value_template: "{{ value_json.temperature_C }}"
  - name: "Humidity Balcony"
    unique_id: "humidity_balcony"
    state_topic: "mqtt/sensors/balcony"
    state_class: "measurement"
    unit_of_measurement: "%"
    value_template: "{{ value_json.humidity }}"
  - name: "battery balcony"
    unique_id: "battery_balcony"
    device_class: "binary_sensor"
    state_topic: "mqtt/sensors/balcony"
    value_template: "{{ value_json.battery_ok }}"

Can someone please guide me on how to set this up properly?

Let me try to explain this better.

My json-data from the physical temperature/humidity sensor

{"time" : "2024-10-15 12:49:12", "model" : "Ambientweather-F007TH", "id" : 29, "channel" : 6, "battery_ok" : 1, "temperature_C" : 20.722, "humidity" : 63, "mic" : "CRC"}

contains time, temperature and humidity values among others. In my current settings, my entities in home assistant use the reception time for their time axes. This is not what i want. I would rather like to use the actual time values from json-data.

How can i achieve this?