Aside from its standard methods of control (using the web GUI and Cloud4UIS) the two-outlet Remote Power Switch (UIS-522B, UIS523*, and UIS-622B) also offers a more advanced option for experienced users. The IP switch has built-in HTTP script commands that can be used in a wide variety of scenarios for manually or automatically controlling the unit.
These script commands can be used for simply sending a command by HTTP URL over your network, but that is not their main draw. Programmers will be able to use them in combination with other applications to automate the Switch to its fullest potential. The possibilities are vast, so let’s take a look at just a few.
- Office Equipment Management: In an office setting, the Remote Power Switch can be employed to control and schedule the power supply to various electronic devices. For example, you can set up a script command to turn off all non-essential equipment, such as printers, scanners, and monitors, during non-business hours. This not only saves power but also reduces the risk of electrical hazards.
- Server Room Temperature Control: Data centers and server rooms require precise temperature management to prevent equipment overheating. With the Remote Power Switch, you can integrate temperature sensors and programmatically control cooling devices, such as fans or air conditioners. The script commands can trigger cooling measures when the temperature reaches a certain threshold, ensuring optimal performance and device longevity.
- Home Entertainment Center: Managing multiple entertainment devices in a home theater setup can be cumbersome. The Remote Power Switch simplifies this by allowing you to create custom scripts to control the power supply to different components. For example, a single script command can turn on the projector, AV receiver, and speakers simultaneously, creating a seamless movie-watching experience.
- Energy-efficient Lighting: The Remote Power Switch can be integrated into smart lighting solutions to control and schedule the operation of lights in homes or commercial spaces. By automating the lights to turn off when a room is unoccupied or dimming them during specific hours, you can reduce energy consumption and lower utility bills.
- IoT Device Management: With the rise of the Internet of Things (IoT), there is an increasing number of connected devices in homes and businesses. The Remote Power Switch can act as a central hub to manage and automate various IoT devices. For example, you can create script commands to turn on smart plugs, adjust thermostat settings, or even water your plants using IoT-enabled devices.
If the concept of writing scripts is overwhelming for you, I’ll attempt to break it down step-by-step. Let’s start with simply formulating an HTTP URL command to reset Outlet 1 on our switch here at the 5Gstore warehouse. I have set up the switch locally at the IP address 192.168.1.14. The following command will allow me to manually reset my router which is plugged into outlet one on the switch:
http://192.168.1.14/control.cgi?user=admin&passwd=ipswitch&target=1&control=3
Let’s take a closer look at each segment of the command to understand exactly what information is being sent.
http://192.168.1.14
This is the local address of my IP switch. Starting with this address directs where to send the command. On your network, your switch will most likely be at a different address, so be sure to check this using either Cloud4UIS, the Utility software or by accessing your router’s client list.
/control.cgi?user=admin&passwd=ipswitch
This segment uses a Common Gateway Interface (CGI) that allows us to establish control over the switch. The user=____ and passwd=_____ will be unique to your personal login information when accessing the Web GUI of your switch. It is important to make sure these are entered correctly. The username and password can be changed by accessing the Web GUI and clicking on the “Account” tab.
&target=1&control=3
Here we are identifying which outlet we are controlling, and what we wish to do with that outlet. In our scenario, we have selected target=1, from a list of 4 options.
- 0: UIS*
- 1: outlet 1
- 2: outlet 2,
- 3: All outlets
*UIS is a feature that allows the switch to automatically reset when an internet connection is lost.
Control=3 tells the outlet to simply reset. However, there are 4 total commands that can be used by implementing the numbers 0, 1, 2, and 3.
- 0: Off
- 1: On
- 2: Toggle Power (i.e. from On → Off, or from Off → On)
- 3: Reset (Outlet only)
So again, in our example – http://192.168.1.14/control.cgi?user=admin&passwd=ipswitch&target=1&control=3 – the outcome would be that Outlet 1 is reset.
Although it is the case in our scenario, the script commands do not require the user to be on the same local network as the Switch. By configuring port forwarding through your router, you can use these same commands remotely by adding the proper port to the IP address section.
Think back to how your IP switch is being used, and try to put together a HTTP command that would do what you are looking for in your application. If you have questions, simply run them by the 5Gstore team!