1 means set port on
0 means set port is off
u don’t change port status
i means if the port is on turn it of and on again (reset after 5 seconds)
After inserting the command on the browser and if PDU executes the command successful it replays on the browser = 250 OK
At any time i can request the status of the ports with the fowling command: http://IP:port/cgi/control.cgi?login=p:username:password&p=list
PDU Reports the port status on the following format - 1001 (means only port 1 and 4 are on)
1 means port is on
0 means port is off
In the Develop Apps i started to mess with the Test Luup code (Lua) and was able to control de PDU with a command like:
luup.inet.wget(“http://192.168.100.23:2323/cgi/control.cgi?login=p:teste:test&p=0101”)
it executes the task and reply is “Failed to test code, please try again”
The objective is to get a 4 way switch on the dashboard that controls the ports on the PDU and checks the status of the ports from time to time for locally made changes (set by a timer in seconds).
I was looking on similar pulg-ing link the WOL with ping. But the problem is that i don’t have the thinness clue how to make a plug-in with luup for UI7.
You could actually use the Multiswitch plugin to set/show status of the ports as it has 8 virtual switches. Use scenes for regular checks and when a button changes status. You are on the right way with the LUA but did you put in the delay loop to give the PDU a chance to respond?
Example code (source Vera wiki) using GET
[code]require(‘ltn12’)
local http = require(‘socket.http’)
– 5 Second timeout (change if more time for PDU to respond us needed)
socket.http.TIMEOUT = 5
– The return parameters are in a different order from luup.inet.wget(…)
result, status = http.request(“http://192.168.0.113/runprocess.htm”, “run=run”)
[/code]
@BOFH sorry for the ignorance but form the code you provided changing “http://website/page?parameter1=value¶meter2=value” to the right string should be enough to make the code roll correctly on Test Luup code (Lua)? because I get “Failed to test code, please try again” what else am i not seeing right?
@garrettwp Allredy installed the app what is the best way to analyse and edit it’s code?
@garrettwp LOL just found out you are the developer of the web power switch plug-in. Kudos! If you have the time and the will i would like to have your help to make it compatible with Netio PDU.