Get the state value using the telnet switch

I have an Atlona HDMI matrix switcher that I am controlling via network. The good news is Im able to turn the unit on and off using the following:

switch:
  - platform: telnet
    switches:
      atlona_matrix:
        resource: 172.16.0.197
        name: "Power Switch"
        command_on: "PWON"
        command_off: "PWOFF"
        command_state: "PWSTA"
        value_template: '{{ value == "\r\nPWOFF\r\n"}}'

Im trying to now grab the value of the state and use that to determine if the device is on or off. Im not really understanding how the command_state/value_templating works. I used packet sender and I see the atlona responding back with the status of the unit, but I dont understand how to put that as an attribute to then turn it into a state.

How about:

value_template: '{{ value.strip() == "PWON"}}'

no unfortunately the toggle switched back to the off position after I turned the unit on.

have you been able to solve this? i have the same problem with my atlona sw51…