Announcement

Collapse
No announcement yet.

Digital Loggers Web Power Switch - request for help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Digital Loggers Web Power Switch - request for help

    I am trying to do some basic scripting to control the Digital Loggers Web Power Switch.
    http://www.digital-loggers.com/lpc.html
    It is a great device which serves a web page that allows the user to reboot devices that are plugged into it. There are 8 controllable power plugs.
    The web power switch support site says the device can be controlled by scripting. I was hoping to have HS do that for me. According to the FAQs there are programming examples using Python, C++, .NET, Java, and compiled Windows Command Line.
    http://www.digital-loggers.com/lpc3_faqs.html


    Perl script and compiled Perl script examples
    Usage: UserUtil <HOST>[ip addressort] <USERNAME;P<LOGINassword> <[n]{on|off|pulse|status}>
    Examples:
    UserUtil 192.168.0.100:80 admin:1234 5on


    & UserUtil 192.168.0.100:80 admin:1234 5on
    But it logged an error: Running script, init error: Syntax error

    Thanks
    Jono


    <O

  • #2
    From looking at it very quickly on the online test version the URL to control them is;

    http://lpc.digital-loggers.com/outlet?6=OFF

    (which you would replace with your IP address) which looks on the face of it very simple as you could get away with just putting that URL into a hs.geturl command and it might work. The problem is going to be that logon page as its not like a normal web logon page where you might be able to pass the username/password in the headers.

    Upon looking at that utility though it looks possible to use just use that with a hs.launch command, you would launch the app using something like this and then pass the parameter with the other details. I am not sure how this is going to work in practice though as you might end up with console windows popping up everywhere...

    hs.launch("C:\UU.W32.exe", "UserUtil 192.168.0.100:80 admin:1234 5on")
    My Plugins:

    Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
    Yeelight 3P | Nanoleaf 3P

    Comment


    • #3
      Originally posted by mrhappy View Post
      From looking at it very quickly on the online test version the URL to control them is;

      http://lpc.digital-loggers.com/outlet?6=OFF

      (which you would replace with your IP address) which looks on the face of it very simple as you could get away with just putting that URL into a hs.geturl command and it might work. The problem is going to be that logon page as its not like a normal web logon page where you might be able to pass the username/password in the headers.

      Upon looking at that utility though it looks possible to use just use that with a hs.launch command, you would launch the app using something like this and then pass the parameter with the other details. I am not sure how this is going to work in practice though as you might end up with console windows popping up everywhere...

      hs.launch("C:\UU.W32.exe", "UserUtil 192.168.0.100:80 admin:1234 5on")
      Thanks mrhappy. The method you suggested does run without errors, but it doesn't turn the outlets on or off. I do notice that a command window appears briefly....perhaps that is the uu.w32.exe running.

      I'm not there yet but you have given me some things to think about. Thanks

      Comment


      • #4
        mrhappy,
        You set me on the right course. It turns out the script you suggested needs to be modified just a touch to remove "UserUtil" so it ends up as:

        hs.launch("C:\UU.W32.exe", "192.168.0.100:80 admin:1234 5on")

        Thanks also to Scott12v, where I got the hint to remove the "UserUtil by looking at this thread:
        http://board.homeseer.com/showthread.php?t=143426
        Now it works perfectly! Thanks very much.

        So for anyone following this, download UU.W32.exe from the webpowerswitch website (I have attached it to this entry) and put it on your c:drive. Then run the script above, modified for your powerswitch LAN location and port; username and password; and the command you want to use.
        Jono
        Attached Files
        Last edited by jono; January 16th, 2012, 08:04 AM.

        Comment


        • #5
          Just an update for those running HS3 and using the Digital Loggers Web Power Switch. In HS3 the way to make it work is to select under THEN "Run Another Program or Process". Then choose UU.W32.exe (see prior post to get this program which should be installed on your HS3 computer C: drive).
          Then fill in "Enter any command parameters to be appended to the program or file being lauched" with ipaddressort usernameassword 5pulse
          where ipaddressort usernameassword are the ip address, port, username and password of your Web Power Switch, and 5 pulse will cycle plug number 5. You could also use 1off, 1on, 1pulse to control plug 1, etc.

          for some reason colon followed by p shows up as the smiley face above. replace the smiley with colon followed by p.

          Comment


          • #6
            I'm having absolutely no luck controlling the Web Power Switch using the following steps:

            * Downloaded the latest UU app found here: http://www.digital-loggers.com/cex.html
            * Uploaded the UU.exe to my HomeTroller Zee S2 tmp folder via WinSCP
            * Made this little test event: Click image for larger version

Name:	test.PNG
Views:	79
Size:	20.4 KB
ID:	1339339

            But it's not working.

            Maybe this .exe is windows only? What would be the steps neccesary to make this work on a HomeTroller Zee S2?

            PS: I can ping the digital logger PDU just fine. So there shoudn't be any issues networking-wise.

            Attached Files

            Comment


            • #7
              Originally posted by dchramcow View Post
              Maybe this .exe is windows only? What would be the steps neccesary to make this work on a HomeTroller Zee S2?
              Yes, the exe looks to be Windows only. There's a perl script included in the download (UU.pl) which should work from the Zee.
              HS 3.0.0.548: 1990 Devices 1172 Events
              Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

              Comment


              • #8
                Originally posted by sparkman View Post

                Yes, the exe looks to be Windows only. There's a perl script included in the download (UU.pl) which should work from the Zee.
                Thanks for the response mate.

                Unfortunately that didn't work either, here's what I did:

                Click image for larger version  Name:	Capture.PNG Views:	0 Size:	22.7 KB ID:	1339540

                I did try this under HS3 (installed on my Windows PC) and it worked perfectly, just like jono mentioned. Using the UU.exe instead of the UU.pl.

                I can't seem to make this work under HS3 Linux.

                EDIT: Here's the URL I get when clicking on one of the Outlets directly from the Power Switch web server:

                Click image for larger version  Name:	Capture2.PNG Views:	0 Size:	148.5 KB ID:	1339547

                http://192.168.1.150/outlet?4=ON

                So shouldn't I be able to send a HTTP SET/POST string/command consisting of:

                Credentials: admin:1234
                Address:Port: 192.168.1.150:80
                Parameters: outlet?4=ON

                ?

                Comment


                • #9
                  Try using putty or another ssh tool to connect to the Zee and then run the command manually to see if it spits out any errors. Make sure the file attributes are set to be executable. Yes, the HTTP set/post should work as well.
                  HS 3.0.0.548: 1990 Devices 1172 Events
                  Z-Wave 3.0.1.262: 126 Nodes on one Z-Net

                  Comment


                  • #10
                    Code:
                    hs.GetURL("http://admin:1234@192.168.1.150","outlet?4=ON",TRUE,80)
                    Returns with:

                    Code:
                    -bash: syntax error near unexpected token `"http://admin:1234@192.168.1.150","outlet?4=ON",TRUE,80'
                    What am I doing wrong here?

                    Comment


                    • #11
                      I think your event action is confused. Looks like you're trying to execute hs.GetURL in a 'Run Another Program or Process' action, rather than a 'Run a Script or Script Command' action.

                      Furthermore, hs.GetURL doesn't support passing username/password credentials like that. You'll need to use hs.URLAction instead.

                      Comment


                      • #12
                        Originally posted by zwolfpack View Post
                        I think your event action is confused. Looks like you're trying to execute hs.GetURL in a 'Run Another Program or Process' action, rather than a 'Run a Script or Script Command' action.

                        Furthermore, hs.GetURL doesn't support passing username/password credentials like that. You'll need to use hs.URLAction instead.
                        Thanks!

                        Unfortunately this didn't work either, changed the event to "Run a Script or Script Command"... nothing.

                        Also moved from hs.GetURL to hs.URLAction... and nothing.

                        Click image for larger version

Name:	Capture.PNG
Views:	86
Size:	17.5 KB
ID:	1340044

                        I'm kinda losing hope with this, on Windows it just works so well (as well as from a Crestron controller). There must be something obvious that I'm missing.

                        Comment


                        • #13
                          Sorry my answer was incomplete. Neither hs.GetURL nor hs.URLAction support parsing of username: password@address. You'd have to generate the appropriate Authorization header as described here: https://forums.homeseer.com/forum/ho...58#post1337858

                          Comment

                          Working...
                          X