table of contents
sispmctl(1) | User Manuals | sispmctl(1) |
NAME¶
sispmctl - manage EnerGenie and Gembird USB controlled power strips
SYNOPSIS¶
sispmctl -s
sispmctl [ -q ] [ -n ] [ -d 0... ] [ -D ... ] -b <on|off>
sispmctl [ -q ] [ -n ] [ -d 0... ] [ -D ... ] < -o | -f | -t | -g | -m > <1..4|all>
sispmctl [ -q ] [ -n ] [ -d 0... ] [ -D ... ] < -a | -A > <1..4|all> [ --Aat '...' ] [ --Aafter ... ] [ --Ado <on|off> ] ... [ --Aloop ... ]
sispmctl [ -d 0... ] [ -D ... ] [ -i <ip>] [ -p <#port> ] [ -u <path> ] -l
DESCRIPTION¶
sispmctl is a tool to switch the outlets of USB controlled powerstrips. Supported models include:
- EnerGenie
- EG-PM, EG-PMS, EG-PM2, EG-PMS2
- Gembird Silver Shield
- MSIS-PM, SIS-PM, SIS-PMS
The tool requires the libusb 0.1 userspace USB programming library.
OPTIONS¶
- -h
- print usage information
- -s
- scan for supported GEMBIRD devices
- -l
- daemonize and start listening as a simple http webserver (default port: 2638)
- -L
- start listening as a simple http webserver without daemonizing
- -p
- IP network port (default: 2638) for listener. There is no authentication implemented yet.
- -u
- give the directory path where pages lie, that are served (default: /usr/local/share/doc/sispmctl/skin. The Web path component is completely ignored for security reasons.
- -b
- switch the buzzer on and off
- -o
- switch the given outlet(s) to "ON"
- -f
- switch the given outlet(s) to "OFF"
- -t
- toggle the state of the given outlet(s)
- -g
- show the status of the given outlet(s)
- -m
- get power supply status for the given outlet(s)
- -d
- Use not the first but the given device in the sequence of detected devices, starting with "0" for the first device (see scan option)
- -D
- Same as -d, but choose by serial number (see scan option)
- -U
- Same as -d, but choose by USB Bus:Device the device is connected to (e.g. 001:003)
- -n
- do not print "ON" and "OFF", but "1" and "0" instead
- -q
- do neither print explanations nor disclaimers except it is requested
- -a
- get schedule for given outlet
- -A
- set schedule for given outlet
--Aat date - sets an event time as a date '%Y-%m-%d %H:%M' in the current local time zone (not considering day light saving time switches)
--Aafter N - sets an event time as N minutes after the previous one
--Ado <on|off> - sets the current event's action
--Aloop N - loops to 1st event's action after N minutes - -v
- print version & copyright
WEB INTERFACE¶
The sispmctl program provides a web interface when started with the -l option. No additional http server is needed. Each selected usb device is blocked by sispmctl while running.
After installation, the first of two web-interfaces is selected. The default location of the HTML files is /usr/local/share/doc/sispmctl/skin which is a symbolic link to /usr/local/shared/doc/sispmctl/httpd/skin1.
The HTTP capabilities of sispmctl are limited. Technically speaking, only the first line of each HTTP request is parsed. The terminating path component, i.e. file name, is looked up in the repository directory. If present the file is parsed and in absence of control sequences sent as is. The files must include the HTTP header portion.
Control sequences start and end with double dollar `$$'.
To display the version of the software use $$version()$$. Other control sequences consist of a command portion separated by a question mark `?' from alternative outputs which are separated by the first colon `:'. The command portion is a token followed by an embraced number that references the outlet, e.g. $$command(1)?positive:negative$$ while command is one of status, toggle, on or off. It is advisable to avoid the on/off/toggle commands in pages that may be reloaded. Best is to redirect to other pages that only include status requests.
SCHEDULING¶
The sispmctl allows to define schedules. Schedules can be used to turn given outlets of the device "ON" or "OFF" at or after a given time. Schedules can also be set to loop after a given number of minutes.
To show the schedule for a given outlet use the option -a and specify the wanted outlet(s). The option -A plus any of the options --Aat , --Aafter , --Ado and --Aloop will create a new schedule for the given output. If only -A plus an outlet is called, the schedule for the outlet will be deleted.
EXAMPLES¶
Switch off the first outlet of the first SiS-PM and the third outlet of the second SiS-PM:
sispmctl -f 1 -d 1 -f 3
Print the status of the forth outlet as zero or one:
sispmctl -nqg 4
Set a schedule so outlet 2 on the first device gets turned "ON" on the given date and time:
sispmctl -A 2 --Aat '2011-07-27 20:45' --Ado on
Set a schedule so outlet 3 on the second device gets turned "ON" after 2 minutes and "OFF" after another 10 minutes. The schedule will loop after 1 hour:
sispmctl -d 1 -A 3 --Aafter 2 --Ado on --Aafter 10 --Ado off --Aloop 60
Run sispmctl on the second device as a web server:
sispmctl -d 1 -l
You can connect to it from the same machine by pointing to http://localhost:2638 with your web browser.
Run sispmctl as a web server on the interface with address 192.168.1.42, port 4242 using skin2:
sispmctl -i 192.168.1.42 -p 4242 -u /usr/local/share/doc/sispmctl/httpd/skin2/ -l
BUGS¶
For bug reports and feature requests please refer to https://sourceforge.net/projects/sispmctl/support.
Your contribution to this software this is highly appreciated. The easiest approach is a pull request for the Git repository located at https://sourceforge.net/p/sispmctl/git/ci/master/tree/.
AUTHOR¶
First version by Mondrian Nuessle, web integration and man page by Andreas Neuper, scheduling by Olivier Matheret, further contributors see Git log.
Apr 2020 | Linux |