Controlling Shelly devices from uOS

This guide explains how to pull data from Shelly’s API so you can control it directly from uOS.

Shelly in uOS

Please note: this guide covers how to execute a command for a Shelly light, if you are using a different device the same logic applies, you only need to change the parameters. Please find the link to Shelly’s API document below for commands relating to different devices.

What this guide will cover:

  1. How to control Shelly lighting in your home.
  2. How to add that API into uOS.

Important: you must have the IP addresses first

There are a few ways you can get the IP address if your Shelly device:

  1. Use an mDNS discovery app like Fing to find Shelly on your network.
  2. Log into your wireless router and look for Shelly in the DHCP table.

What a typical Shelly command looks like

/color/0?turn=on&red=0&blue=0&green=255

This only shows the logic of a Shelly command, you may be controlling a relay and therefore need to use different parameters. There will be a link at the bottom which will take you to Shelly’s API documentation where you can find all their codes.

/color/0?
This is the mode of the device and declares it is an RGBW2 controller. If you were writing a command for an automated blind it would be /relay/0?.

turn=on
This affects the state of the device.

red=0&blue=0&green=255

Testing your APIs

You can test your Shelly command in the URL to see if it works. Make sure to include http:// for it to work properly.

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 a light in the correct room and location.
  • 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.