If that is exactly what the data looks like, you could do this:
mqtt:
sensor:
- name: Office temperature
unique_id: e9ffd35d-dd9d-4f32-a365-900d1de8250c
state_topic: "sensors"
unit_of_measurement: "°C"
device_class: temperature
value_template: >
{% if "source=office" in value %}
{{ value|regex_findall("temperature=(\-?\d+\.?\d*)")|first }}
{% else %}
{{ states('sensor.office_temperature') }}
{% endif %}
- name: Office humidity
unique_id: d2a27225-b2eb-41b1-a280-45da1a981e96
state_topic: "sensors"
unit_of_measurement: "%"
device_class: humidity
value_template: >
{% if "source=office" in value %}
{{ value|regex_findall("humidity=(\d+\.?\d*)")|first }}
{% else %}
{{ states('sensor.office_humidity') }}
{% endif %}
…and so on with replacements for the source=office check. These update when a new message is published, but if they don’t see their source location they retain the prior value.
It is a DIY sensor, but changing the format there would mean I also would need to change a few other things, which I currently do not want to do. In general, you are right, JSON would have been the much wiser choice a couple of years back when I build these things