For future reference here’s another way to extract data from a string. It uses regex_findall_index which relies on the use of regular expressions (regex).
It looks for <e2instandby> followed by a newline \n and then captures one or more characters using (\w+) where the parentheses () mean to capture the information and the \w+ means to match one or more characters.
I pasted your data into the Template Editor and successfully tested the template:
Therefore the sensor’s value_template can be this:
value_template: "{{ value | regex_findall_index('<e2instandby>\n(\w+)') }}"
Error loading /home/homeassistant/.homeassistant/configuration.yaml: while scanning a double-quoted scalar
in “/home/homeassistant/.homeassistant/config/sensor.yaml”, line 38, column 21
found unknown escape character ‘w’
in “/home/homeassistant/.homeassistant/config/sensor.yaml”, line 38, column 71
Swap the existing single-quotes for double quotes and the existing double-quotes for single-quotes. The result will be this and it passes config check on my system (version 0.99):
value_template: '{{ value | regex_findall_index("<e2instandby>\n(\w+)") }}'
For some reason, it gets confused when that regex pattern is delimited by single-quotes.