Digital Loggers Web Power Switch

I’m new to automation. Surprised that no one has thought to control this device yet as the IT community likes to use them to restart modems, switches, pc’s etc remotely. It’s the basic, “Have you turned it off and on again?” except you can do it yourself via the web.

http://www.digital-loggers.com/lpcfaqs.html

Be nice if Hass could control it too. I have no idea how to get started. Help is appreciated.

There doesn’t need to be specific support for this device as it can already be controlled by GET API calls, as stated on the FAQ you linked to:

To turn Outlet 2 ON:
http://192.168.0.100/outlet?2=ON 

To turn Outlet 5 OFF:
http://192.168.0.100/outlet?5=OFF

To cycle Outlet 7:
http://92.168.0.100/outlet?7=CCL

To start a script on line 90 at the default IP after authenticating admin with password 1234:
http://admin:[email protected]/script?run090

I’m not sure you need to pass the admin and password on every call or just when running scripts on the device, but I added it in there for all calls just in case. So you should just create a command_line switch for each of the outlets, and maybe even one to toggle all the outlets:

# Example configuration.yaml entry
switch:
  platform: command_line
  switches:
    power_outlet_1:
      command_on: curl http://admin:[email protected]/outlet?1=ON
      command_off: curl http://admin:[email protected]/outlet?1=OFF
      friendly_name: 'Outlet #1'

    power_outlet_all:
      command_on: curl http://admin:[email protected]/outlet?a=ON 
      command_off: curl http://admin:[email protected]/outlet?a=OFF
      friendly_name: 'All Outlets'

You can even use the command for cycling an outlet rather than explicitly turning it on or off, by creating a shell_command and using it in a script and then placing the script directly within a group, then you can just hit the ACTIVATE button shown to power cycle the outlet:

# Example configuration.yaml entry
shell_command:
  power_cycle_outlet_1: curl http://admin:[email protected]/outlet?1=CCL

script:
  cycle_outlet_1:
    sequence:
      - service: shell_command.power_cycle_outlet_1

group:
  actions:
    name: Actions
    entities:
      - switch.power_outlet_all
      - switch.power_outlet_1
      - script.cycle_outlet_1

With the above, you would have a group called “Actions” (just an example, you can call it anything you like) that has 3 items in it… The first being a switch to turn on/off all outlets, the second being a switch to turn on/off outlet 1, and the third will show as an ACTIVATE button to power cycle outlet 1

1 Like

Thank you for this! I was also looking for the same kind of control options.

Is it possible to set a script that would turn on only a select number of outlets? Say I wanted to be able to turn on and off 1, 2, and 3 on at the same time, would that just be:

group:
actions:
name: Actions
entities:
- switch.power_outlet_1
- switch.power_outlet_2
- switch.power_outlet_3
- script.power_outlet

THANK YOU!!! THANK YOU!!

This is my first device on Hass and you made it look so easy jbardi!!

I guess this device and several other devices on Digital Loggers website can be listed as controllable by Hass.

Thanks,
Scott