Helo everyone,
I’m having trouble with this switch code, the value returned by device has CR (\r) at the end, but this code isn’t working:
- platform: telnet
switches:
denon_avr:
resource: 192.168.1.218
port: 23
command_on: "PWON\n"
command_off: "PWOFF\n"
command_state: "PWR?"
value_template: '{{ value == "PWON\r" }}'
timeout: 0.9
Value returned sometimes has additional text, can be PWON\r or PWON\rZ2ON\r, for example, how do I make the condition to detect only PWON for example?