baumi's blog

baumi's personal blog … Linux, OS X, Windows, Random things, …

LINDY IP Power Switch Classic 8 – SNMP cheat sheet (ipower, remote power)

LINDY’s IP Power Switch Classic 8 is a wonderful device that i really like. Not only does it offer a http Administration (the https panel doesn’t really work for me though, due to ssl protocol fuckup – hopefully they will fix this in a firmware upgrade soon).

Anyways, the more beautiful alternative to the HTTP admin is SNMP as it can be integrated more easily into bash scripts for automation etc.

SNMP short info:

snmpwalk -v1 -c public 192.168.1.9 system

SNMP long info:

snmpwalk -v1 -c public 192.168.1.9 .
#or:
snmpwalk -v1 -c public 192.168.1.9 iso

SNMP power outlets:

snmpwalk -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.13.0

Screen Shot 2016-06-17 at 10.50.08

snmpset data types:

snmpset -h |& tail -4

Screen Shot 2016-06-17 at 11.12.00

snmpget example (get power state for all 8 power outlets):

snmpget -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.13.0

snmpset example (rename outlet F to “OutletFnew”):

snmpset -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.14.6.0 s "OutletFnew"

snmpget example (get current total power usage for all ports. Value 1 represents 0.1 Ampere)

snmpget -c public -v 1 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.11.0

Screen Shot 2016-06-17 at 18.08.38
=> int 5 = 0.5 Ampere, 0.5*240V = 120 Watts power usage currently. Value updates every few seconds.

lindy_get_power_usage.sh:

#!/bin/bash
intval=`snmpwalk -v1 -c public 192.168.1.9 iso.3.6.1.4.1.17420.1.2.9.1.11.0 | cut -d ':' -f 2 | tr -d ' '`
mamp=$((intval * 100))
watt=$((intval * 240 / 10))
echo "Ampere: $mamp mA"
echo "Watt: $watt W"

Screen Shot 2016-08-04 at 09.23.47

For reading out the photovoltaic values, see also https://blog.b-nm.at/2016/04/28/linux-prozesse-pausierenresume-durch-solar-photovoltaik-pv-controller-piko-5-5-kostal/

Comments are currently closed.