SNMP Plugin - working script

Python and python framework

Moderator: leecollings

Post Reply
boe666
Posts: 47
Joined: Thursday 19 January 2017 16:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

SNMP Plugin - working script

Post by boe666 »

Hello everyone.

Due to the fact that all the SNMP scripts (without TRAPs) simply didn't work on my 2024.7 version, I wrote my own script. It runs on standard Python3. It's not perfect and may require some modifications, but it works.


It appears as new hardware, where we define devices in the form, for example:

101,IN Voltage,.1.3.6.1.4.1.21111.1.1.6.3.1.2.0,5,Voltage,10
102,OUT Voltage,.1.3.6.1.4.1.21111.1.1.5.7.1.2.0,5,Voltage,10
103,Battery Voltage,.1.3.6.1.4.1.21111.1.1.3.5.0,5,Voltage,10
104,Other Time, .1.3.6.1.4.1.21111.1.1.3.3.0,5,Voltage,1
105,Batteries, .1.3.6.1.4.1.21111.1.1.3.4.0,5,Percentage,1
106,UPS Temperature, .1.3.6.1.4.1.21111.1.1.3.13.0,5,Temperature,10

(id),(name),(OID),(interval),(TypeName from Domoticz),{DIVIDER}

id - unique number
interval - time in seconds - but the script executes every 10 seconds anyway, so everything below 10 seconds executes the same
TypeName - name from Domoticz (predefined) - I checked Voltage, Custom, Percentage, Temperature - I don't know what else you can enter there
Divider - integer value by which the script divides the read data.

Works when you change NAME or OID but when you change TypeName - Device is not update but delete and create again (new IDX).

Due to Domoticz limitations, only the name and ID are stored in the database, the rest in the script's memory. It's also impossible to delete saved devices by deleting the configuration line and clicking update. These limitations are numerous, so the script also has problems with configuration changes, but once properly configured, it works very well.

https://github.com/boe666/Domoticz-SNMP-Reader/
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest