I got a PDU that I want to build up the payload of the SNMP set command with a template. See the code of current config that is not working that I want to get working. I will replace the 0 and 1 with the same if statement code if I get this to work. thanks for any suggestion
- platform: snmp
baseoid: 1.3.6.1.4.1.17420.1.2.9.1.13.0
command_payload_off: "{% if is_state('input_boolean.pdu_1_outlet','on') -%}1{%- else -%}0{%- endif %},{% if is_state('input_boolean.pdu_2_outlet','on') -%}1{%- else -%}0{%- endif %},{% if is_state('input_boolean.pdu_3_outlet','on') -%}1{%- else -%}0{%- endif %},0,0,0,0,0"
command_payload_on: "{% if is_state('input_boolean.pdu_1_outlet','on') -%}1{%- else -%}0{%- endif %},{% if is_state('input_boolean.pdu_2_outlet','on') -%}1{%- else -%}0{%- endif %},{% if is_state('input_boolean.pdu_3_outlet','on') -%}1{%- else -%}0{%- endif %},1,1,1,1,1"
community: xxxxx
version: "1"
host: 192.168.xx.xx
name: pdu set outlet
vartype: OctetString