Mastering HTTP Actions

HTTP actions are the workhorse of modern automation. They allow Control It to talk to virtually any smart device, web service, or API-enabled software.

Example: Controlling Philips Hue

In this tutorial, we will create a button that toggles a Philips Hue light.

1. Get your Bridge IP and API Key

Before starting, you need the IP address of your Hue Bridge (e.g., 192.168.1.50) and a valid username/API key.

2. Create the Action

  1. Create a new action and select HTTP.
  2. Host: Enter your bridge IP (e.g., 192.168.1.50).
  3. Port: 80 (Default for Hue).
  4. Path: /api//lights/1/state
  5. Method: Select PUT.

3. Define the Body

Hue expects a JSON body to tell it what to do. In the body field, enter:

{"on": true, "bri": 254}

This command turns the light ON at full brightness.

Pro Tip: To create a toggle, you'll need two actions (one for On, one for Off) or use Multistep Actions with logic, which is covered in the Advanced Logic tutorial.

Authentication

Many APIs require authentication. Control It supports standard headers.

Bearer Tokens

If an API requires a Bearer token, add a Header:

Basic Auth

For Basic Auth, you need to base64 encode your username:password. You can do this online or in terminal:

echo -n "user:pass" | base64

Then add the header:

Troubleshooting

"The Internet connection appears to be offline"
This usually means the app is blocked from the Local Network. Check iOS Settings > Privacy > Local Network > Control It.