I’m currently trying to control an APC PDU with OpenHAB2 using SNMP.
Switching the Outlet does work, however fetching the current State of it is not.
I’m not sure if I am doing something wrong or the binding is just broken.
Debug log:
17:34:45.064 [DEBUG] [hab.binding.snmp.internal.SnmpBinding] - SNMP: Send PDU 192.168.*.*/161 GET[requestID=0, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.4.1.318.1.1.4.4.2.1.3.8 = Null]]
17:34:45.064 [DEBUG] [hab.binding.snmp.internal.SnmpBinding] - Item 'Uptime' is about to be refreshed
17:34:45.064 [DEBUG] [hab.binding.snmp.internal.SnmpBinding] - SNMP: Send PDU 192.168.*.*/161 GET[requestID=0, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = Null]]
17:34:45.103 [DEBUG] [hab.binding.snmp.internal.SnmpBinding] - Received PDU from '192.168.*.*/161' 'RESPONSE[requestID=1869399264, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.4.1.318.1.1.4.4.2.1.3.8 = 2]]'
17:34:45.124 [DEBUG] [hab.binding.snmp.internal.SnmpBinding] - Received PDU from '192.168.*.*/161' 'RESPONSE[requestID=1869399265, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = 8:04:13.00]]'
17:34:45.125 [TRACE] [hab.binding.snmp.internal.SnmpBinding] - PDU doesn't contain a variable with OID '1.3.6.1.4.1.318.1.1.4.4.2.1.3.8'
Item Configuration
Switch Switch_Foo "Test Switch [%s]" { snmp="<[192.168.*.*:public:1.3.6.1.4.1.318.1.1.4.4.2.1.3.8:10000:MAP(APCPDUOutletState.map)] >[OFF:192.168.*.*:private:.1.3.6.1.4.1.318.1.1.4.4.2.1.3.8:2] >[ON:192.168.*.*:private:.1.3.6.1.4.1.318.1.1.4.4.2.1.3.8:1]" } String Uptime "Uptime [%s]" {snmp="<[192.168.*.*:public:1.3.6.1.2.1.1.3.0:10000]"}
Querying the OID using snmpget works as you would expect it:
snmpget -v1 -c private 192.168.*.* 1.3.6.1.2.1.1.3.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (2941180) 8:10:11.80
snmpget -v1 -c private 192.168.*.* 1.3.6.1.4.1.318.1.1.4.4.2.1.3.8
iso.3.6.1.4.1.318.1.1.4.4.2.1.3.8 = INTEGER: 2
Any Ideas?