There looks to have been a bug sending integers as payloads. Not sure what version you’re running.
I’m not 100%, but you could try removing the “| int” conversion at the end of the command_payload_on. Not sure it will make much of a difference if pysnmp is converting it to an integer anyway…but worth a shot.
It looks like this was merged into 0.101.2, so not 100% sure what the issue is…unless you’re still running 0.101.0
Thank you for the prompt reply.
Removing the “| int” conversion reproduces the same error.
Using a constant (for example command_payload_on: “123”) works well.
My version is 0.104.3:
Maybe some other conversion is needed for this case ?
All switches I’ve seen all take a fixed on/off command. Not a template. But, since you are setting brightness…could you use a template light?
To call snmp from the command line, maybe define a shell command (assuming you can run the same command in cmd line.
You could leave your snmp_switch. Just define the command_payload_off (hard coded) and use these as the turn_on and turn_off in the template light. Then use the shell command to set brightness.