Controlling GUDE power switching from uOS

This guide explains how to control your GUDE PDU from uOS, uControl App and uControl Remote. Here is a full overview of GUDE’s API.

Gude power switching in uOS

What this guide will cover:

  1. Understanding switching outputs, batches, ports and their status.
  2. How to create a GUDE API so that you can control power in the property.
  3. How to add that API into uOS.

Important: you must have the IP for GUDE first

You can get the IP address of your GUDE by:

  • Using an mDNS application like Fing on your mobile phone to scan your network.
  • Log into your wireless router and look up Gude in the DHCP table.

For the purposes of this guide we are going to pretend that your GUDE PDU is on IP address 192.168.1.15 and your uOS device (MHUB, MZMA or Zone Processor) is on 192.168.1.196. We will use this to illustrate all examples moving forward.

GUDEs ports are simple, port 1 is equal to 1 (p=1) and port 2 is equal to 2 (p=2) and so on. When typing your commands, make sure to follow this logic.

What a typical GUDE API looks like

http://user:secret@192.168.1.15/ov.html?cmd=1&p=1&s=1

The command above switches an output on or off (cmd=1). More specifically it switches/powers output 1 (p=1) on (s=1).

user:secret@
This is user definable and can be changed to the name of the device owner on the GUDE web UI.

Understanding what those numbers in the API above mean:

cmd=1, 2, 5, 12
This is the command which decides what kind of switch occurs:

  • cmd=1 switches the output.
  • cmd=2 cancels a batch switch.
  • cmd=5 starts a batch switch.
  • cmd=12 performs a reset.

p=1, 2 …, N
This is the number of the output which is being switched.

s=1
This is the state of the switch. 0 being off and 1 being on.

“&”
This sign allows you to add parameters to your command, every command must be linked by it.

How to Batch Switch using GUDE

Batch switching allows for multiple power outputs to be switched on or off simultaneously with a delay in between each switch if wanted. Below is an example of a batch switch, let’s break it down:

http://user:secret@192.168.1.15/ov.html?cmd=5&p=1&a1=0&a2=1&s=5

  • cmd is equal to 5 signifying a batch switch.
  • p is 1 so port number 1 will be switched.
  • a1 means action followed by a sequential number which increases with each additional action.
  • s in a batch switch is different to a normal switch. s is the delay in seconds between each action. As a defines whether an output is on or off a replaces s.

Testing your APIs

We recommend that you test every API before you enter them into uOS. All IP based APIs have different requirements when it comes to testing but the GUDE API is great because it is super simple.

To test your API, open a web browser and enter the full API in the URL window and hit enter.

Screenshot-2023-05-12-121405

Testing your GUDE API is as easy as entering it into your favourite browser and hitting enter. If the GUDE device does what you expected it to then you’re good to enter it into uOS.

If the GUDE device responds as you expected then your API is working and you can proceed adding it into uOS.

If it doesn’t work then try the following:

  • Make sure the IP address is correct.
  • Make sure that you do not have any typos.
  • Ensure that your IDs are correct and that you’re observing the correct PDU switch.
  • Make sure that the structure of the API matches our example no spaces, no special characters, data is in the correct case (often lowercase).

How to add your APIs into uControl

Need more help with the API? Get in touch.

All HDA staff are able to help with any API questions you might have including any advanced features. Get in touch for help or assistance.