Mqtt split json data to variables

OK, so the topic is sending data for id 31 and updating the 31 sensor, then when it sends for id 2, the 31 sensor goes blank? Try this:

    - name: "FDRS Node 31 data"
      state_topic: "fdrs/data"
      value_template: >
        {% set fdrs_list = value_json|selectattr('id','eq',31)|list %}
        {% if fdrs_list %}
          {{ fdrs_list[0]['data'] }}
        {% else %}
          {{ this.state }}
        {% endif %}

and similarly for the other sensor(s).

The this.state in the else carries over the prior state if the list of items with id 31 is empty.