How to split multiple MQTT Values from one subscription to create multiple sensors?

I’m receiving an MQTT from my first tank using a Reef Angel controller. It provides multiple parameters all from an “out” channel. I’ve gotten it to flow in, but it shows T1, T2, T3, or PH whenever any of those values change. Ideally I get it to filter as they come in to the correct parameter for quick status and graphing. For example, PH flows is constantly, but temperatures (T1, T2, and T3) change less frequently. How do I make this into 4 states and send the appropriate value to that state?

Example feed:
PH:765
T2:681
PH:766
PH:765
PH:764
T1:702
T3:720
PH:765

So if going from top to bottom, I’d love 4 sensors here keeping stats with these end values and a graph available for PH:

PH: 7.65
T1: 70.2 F
T2: 68.1 F
T3: 72.0

Can you post the complete payload?

This is from listening to the topic:

Here is an idea that should get you started (I don’t know if this actually works).
It uses a template and in particular the split method to divide the message (based on :) into two halves, a key and value pair. It checks to see if the key is equal to the string “PH”, and if it does it will use its value (assumes the value is not a string), otherwise it will retain the same state it had before.

sensor:
  - platform: mqtt
    name: "Tank PH" #this should create a sensor named sensor.tank_ph
    state_topic: "wolfpack/out"
    value_template:>-
      {% if value.split(':')[0] == "PH" %}
        {{ value.split(':')[1] }}
      {%- else -%}
        {{ states("sensor.tank_ph") }}
      {%- endif %}

If this works for “PH”, you can repeat this for “T1”, “T2”, and “T3”.

Thanks for the reply. I got it to work with a mix of what you provided and another post I found when I couldn’t get the split to work.

This works:

  - platform: mqtt
    name: "Tank PH" #this should create a sensor named sensor.tank_ph
    state_topic: "wolfpack/out"
    value_template: >-
      {% if 'PH' in value %}
        {{value.split(':')[1]|float/100 }}
      {% else %}
        {{states('sensor.tank_ph')}}
      {% endif %}