Need help parsing SNMP sensor text

I am pulling a device list from my router with SNMP sensor.
Sensor works however, I have trouble parsing the information the way I want it.
If there is an easier way, I am open to suggestions.
I would like to track the status of my Aimesh network but Asuswrt integration doesn’t exactly help with this matter.
I would like to know if a node is using wired, wireless backhaul or totally offline.

The snmp sensor value for a working system is:

<RT-AC5300>192.168.1.1>34:97:F6:6C:AA:AA>1<Lyra>192.168.1.129>10:7B:44:CC:BB:BB>0<Lyra>192.168.1.195>10:7B:44:CC:CC:CC>0<Lyra>192.168.1.207>10:7B:44:CC:DD:DD>0	

if a node is offline, the node is removed from the text like below:

 <RT-AC5300>192.168.1.1>34:97:F6:6C:AA:AA>1<Lyra>192.168.1.195>10:7B:44:CC:CC:CC>0<Lyra>192.168.1.207>10:7B:44:CC:DD:DD>0

I have created 3 input_texts to store MAC addresses because they will not change at all.
How to parse this text to store ip addresses and status for each of the nodes.
I am still trying to create something but below is my draft code.

  # AIMESH STATUS
- platform: snmp
  host: 192.168.1.1
  baseoid: .1.3.6.1.2.1.25.1.28.3.1.1.6.97.105.109.101.115.104
  name: "Aimesh Devices"
  accept_errors: true
  default_value: 0
  version: 2c
  value_template: >-
    {% set lyra_o = false %}
    {% set lyra_m = false %}
    {% set lyra_s = false %}
    {% if states('input_text.lyra_o_mac') in (value | string) %}
      {% set lyra_o = true %}
      {{ (value | string ) }}
    {% elif states('input_text.lyra_m_mac') in (value | string) %}
      {% set lyra_m = true %}
    {% elif states('input_text.lyra_s_mac') in (value | string) %}
      {% set lyra_s = true %}
    {% endif %}
  scan_interval: 35

I am stuck here! Any help is really appreciated.

After struggling a lot, I have managed to get it work by creating separate template sensors. I will share my configuration in case someone might find this useful. The hard part was to figure out how to use the namespaces for loop operations.
Created two input texts for each nodes.
One for manually entering MAC address and the other is for saving ip address in case the node is offline.

#   #AIMESH STATUS
- platform: snmp
  host: 192.168.1.1
  baseoid: .1.3.6.1.2.1.25.1.28.3.1.1.6.97.105.109.101.115.104
  name: "Aimesh Devices"
  accept_errors: true
  default_value: 0
  version: 2c
  value_template: '{{ (value.replace("<", " ").replace(">", " ").lstrip()).split(" ") }}'
  scan_interval: 35

This formats the output as a list so it is easy to wok with.
Then creating template sensors.

- sensor:
    # Aimesh Status Sensor for Node 1
    - name: "Aimesh Node1 Status"
      unique_id: "Aimesh Node1 Status"
      icon: >-
        {% if is_state('sensor.aimesh_node1_status', 'Wireless Backhaul') %}
          mdi:wifi
        {%elif is_state('sensor.aimesh_node1_status', 'Ethernet Backhaul') %}
          mdi:ethernet
        {%else%}
          mdi:close-network-outline
        {%endif%}
      state: >-
        {% if states('input_text.node1_mac') in states('sensor.aimesh_devices') and is_state('device_tracker.node1_lan_asuswrt', 'home') %}
          Ethernet Backhaul
        {% elif states('input_text.node1_mac') in states('sensor.aimesh_devices') and is_state('device_tracker.node1_lan_asuswrt', 'not_home') %}
          Wireless Backhaul
        {%else%}
          Offline
        {%endif%}
      attributes:
        ip: >-
          {% if not is_state('sensor.aimesh_node1_status', 'Offline') %}
            {% set master_list = states('sensor.aimesh_devices').replace('[','').replace(']','').replace("\'",'').replace(' ', '').split(',') %}
            {% set master = namespace(device=[]) %}
            {% for x in master_list|batch(4)  %}
              {% set master.device = [x] + master.device %}
            {%endfor%}
            {% for x in master.device %}
              {% if states('input_text.node1_mac') in x %}
                {{master.device[loop.index0][1]}}
              {%endif%}
            {%endfor%}
          {%else%}
            {{ states('input_text.node1_ip') }}
          {%endif%}

      availability: >
        {{ not 'unavailable' in
            [ states('sensor.aimesh_devices') ] }}

    # Aimesh Status Sensor for Node 2
    - name: "Aimesh Node2 Status"
      unique_id: "Aimesh Node2 Status"
      icon: >-
        {% if is_state('sensor.aimesh_node2_status', 'Wireless Backhaul') %}
          mdi:wifi
        {%elif is_state('sensor.aimesh_node2_status', 'Ethernet Backhaul') %}
          mdi:ethernet
        {%else%}
          mdi:close-network-outline
        {%endif%}
      state: >-
        {% if states('input_text.node2_mac') in states('sensor.aimesh_devices') and is_state('device_tracker.node2_lan_asuswrt', 'home') %}
          Ethernet Backhaul
        {% elif states('input_text.node2_mac') in states('sensor.aimesh_devices') and is_state('device_tracker.node2_lan_asuswrt', 'not_home') %}
          Wireless Backhaul
        {%else%}
          Offline
        {%endif%}
      attributes:
        ip: >-
          {% if not is_state('sensor.aimesh_node2_status', 'Offline') %}
            {% set master_list = states('sensor.aimesh_devices').replace('[','').replace(']','').replace("\'",'').replace(' ', '').split(',') %}
            {% set master = namespace(device=[]) %}
            {% for x in master_list|batch(4)  %}
              {% set master.device = [x] + master.device %}
            {%endfor%}
            {% for x in master.device %}
              {% if states('input_text.node2_mac') in x %}
                {{master.device[loop.index0][1]}}
              {%endif%}
            {%endfor%}
          {%else%}
            {{ states('input_text.node2_ip') }}
          {%endif%}

      availability: >
        {{ not 'unavailable' in
            [ states('sensor.aimesh_devices') ] }}

and an automation to save the last known ip in case the node is offline.

alias: Store Aimesh Last Known IP Addresses
description: ''
trigger:
  - platform: state
    entity_id: sensor.aimesh_node1_status
    id: aimesh_node1_ip_change
    for: '00:00:20'
    to: Offline
  - platform: state
    entity_id: sensor.aimesh_node2_status
    id: aimesh_node2_ip_change
    for: '00:00:20'
    to: Offline
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: aimesh_node1_ip_change
        sequence:
          - service: input_text.set_value
            target:
              entity_id: input_text.node1_ip
            data_template:
              value: '{{trigger.from_state.attributes.ip}}'
      - conditions:
          - condition: trigger
            id: aimesh_node2_ip_change
        sequence:
          - service: input_text.set_value
            target:
              entity_id: input_text.node2_ip
            data_template:
              value: '{{trigger.from_state.attributes.ip}}'
    default: []
mode: parallel
max: 10