Universal Devices · eisy · IoX · PG3x

HTTP Control

Complete configuration, command, response parsing, and troubleshooting guide for the HTTP Control node server.

Version 1.5.0 · Beta Store · Free
Getting started

What HTTP Control Does

HTTP Control lets Universal Devices IoX programs send HTTP requests to devices and services, and exposes numeric response values as ordinary IoX node status fields.

16 endpointsIndependent URLs, methods, headers, bodies and field mappings
4 HTTP methodsGET, POST, PUT and DELETE
8 values per endpointNumeric data from JSON or plain-text responses
IoX integrationSend Request commands, success status and response diagnostics

Common applications include querying a temperature sensor, retrieving values from a REST API, triggering a device's HTTP action, or invoking a webhook.

Key distinction: HTTP Control is a configurable HTTP client. It does not host a web server, accept incoming webhooks, or automatically convert arbitrary text responses into IoX text fields.

Installation & First Setup

  1. Open the PG3x interface for your Universal Devices eisy.
  2. Find HTTP Control in the Beta Node Server Store and install it into an available slot.
  3. Open the installed node server's Custom Parameters page.
  4. Add at least url1_name and url1_url; optionally configure the method, response fields, and polling.
  5. Save the parameters and restart the node server to create or update endpoint nodes.
  6. Open the IoX Admin Console. If the new nodes or profile labels do not appear, fully close and reopen the console.
  7. Select the endpoint node and use Send Request to test it.
First test: Use a simple GET endpoint that returns a numeric value. The plain-text example below is suitable for verifying the installation.

Requirements: eisy with PG3x and IoX, plus network connectivity from the eisy to each configured endpoint. The installation script installs the Python dependencies udi-interface and requests.

Custom Parameters

Each endpoint uses a numbered prefix, url1_ through url16_. For example, the second endpoint uses url2_name, url2_url, and so forth.

ParameterPurposeDefault / notes
urlN_nameName shown on the IoX endpoint nodeRequired
urlN_urlFull HTTP or HTTPS destination URLRequired
urlN_methodGET, POST, PUT, or DELETEDefaults to GET; case-insensitive
urlN_headersJSON object of HTTP request headersDefaults to {}
urlN_bodyOptional request bodyValid JSON is sent as JSON; other text as raw data
urlN_intervalAutomatic GET polling interval, in seconds0 disables polling
urlN_field1 … urlN_field8JSON property path, or text for numeric plain textOptional; unmapped fields are not updated

Replace N with an integer from 1 through 16. A node is created only when both its name and url are present. Its IoX node address is url1, url2, etc.

Configuration changes: Saving Custom Parameters alone does not rebuild endpoint nodes. Restart the node server after adding, removing, or changing endpoints. Avoid assigning the same number to two endpoints.

Entering headers

The header value must be a valid JSON object. For example:

Parameter: url1_headers
Value:     {"Authorization":"Bearer YOUR_TOKEN","Accept":"application/json"}

Header names and values must be enclosed in double quotes. A malformed JSON object causes the request to fail before it is sent.

HTTPS & Authentication

Use https:// in urlN_url for an encrypted connection. The HTTPS server must have a certificate trusted by the eisy, matching the URL hostname.

Username and password (HTTP Basic Authentication)

If the API uses HTTP Basic Authentication, encode the username and password separated by a colon. Run on the eisy (replace these sample credentials):

printf '%s' 'admin:mypassword' | base64 | tr -d '\n'

This example produces YWRtaW46bXlwYXNzd29yZA==. Enter the following as separate PG3x Custom Parameters. The equals signs separate names and values; do not include them in the parameter names.

url1_name = Secure Device
url1_url = https://device.example.com/api/status
url1_method = GET
url1_headers = {"Authorization":"Basic YWRtaW46bXlwYXNzd29yZA=="}
url1_interval = 0

For your actual account, set the url1_headers value to:

{"Authorization":"Basic YOUR_BASE64_VALUE"}
Header formatting: Enter valid JSON directly. Do not add backslashes or enclose the entire JSON object in extra quotes. Use url2_ through url16_ for other endpoints. Map response fields only when numeric response values are needed.

Other API authentication headers

AuthenticationurlN_headers value
HTTP Basic{"Authorization":"Basic YOUR_BASE64_VALUE"}
Bearer token{"Authorization":"Bearer YOUR_TOKEN"}
API key (API-dependent){"X-API-Key":"YOUR_API_KEY"}
None{}

These are header-based authentication methods. Digest authentication and web-form/session logins are not automatically handled by these examples. Consult the device or API documentation for its requirements.

HTTPS certificates and troubleshooting

Certificate verification is normally enabled. Self-signed, expired, untrusted, or hostname-mismatched certificates may produce an SSL error. The documented Custom Parameters do not include a per-endpoint certificate-verification switch. Prefer a valid certificate or an appropriately trusted certificate authority.

An HTTP 401 generally means credentials are missing or invalid; 403 means access is forbidden. TLS errors occur before an HTTP status is received; inspect the PG3x log.

Protect credentials: Base64 is encoding, not encryption. HTTPS protects credentials in transit, but Custom Parameters may be visible to PG3x administrators. Never publish real passwords, tokens, or Authorization headers in screenshots, logs, or GitHub.

Save Custom Parameters and restart the node server after changing endpoint configuration.

HTTP Methods & Request Bodies

MethodTypical useAutomatic polling?
GETRead a device state or query a serviceYes, when interval > 0
POSTTrigger an action or submit dataNo — Send Request only
PUTUpdate or replace a resourceNo — Send Request only
DELETERemove a resource or invoke a delete actionNo — Send Request only

JSON request body

url1_method = POST
url1_headers = {"Content-Type":"application/json"}
url1_body = {"enabled":true,"level":42}

If the body contains valid JSON, HTTP Control parses it and passes it to the Python requests library as JSON. A non-JSON body is passed as raw request data instead.

Plain-text request body

url1_method = POST
url1_headers = {"Content-Type":"text/plain"}
url1_body = start
The request method and body are fixed by the endpoint configuration. The IoX Send Request command executes that configured request; it does not prompt for a different URL or body at runtime.

Reading HTTP Responses

On an HTTP success response (status 200–299), HTTP Control attempts to parse JSON and updates any configured response fields that can be converted to numbers.

Simple JSON object

Response:

{"temperature":35,"humidity":62}

Field mappings:

url1_field1 = temperature
url1_field2 = humidity

IoX Field 1 becomes 35; Field 2 becomes 62.

Nested objects and arrays

Response:

{
  "sensors": [
    {"temperature":35.5,"humidity":62},
    {"temperature":29.0,"humidity":54}
  ]
}

Use dot-separated property names and zero-based array indexes:

url1_field1 = sensors.0.temperature
url1_field2 = sensors.1.humidity

Field 1 becomes 35.5; Field 2 becomes 54. The path starts at the top level of the JSON response; no leading $. is needed.

Plain-text numeric response

If the response body is simply 72.5, use:

url1_field1 = text

The reserved mapping text means “use the entire response body,” strip surrounding whitespace, and convert it to a number. It does not extract a number from a sentence or HTML page.

Numeric conversion rules

  • JSON numbers and numeric strings such as "35.5" are supported.
  • JSON booleans convert to 1 (true) or 0 (false).
  • Missing keys, invalid indexes, objects, arrays, and nonnumeric text cannot populate numeric fields.
  • If one field fails to parse, the plugin logs a warning and retains that field's prior value; other valid fields can still update.
Important: “Last Request Successful = True” means the HTTP response status was 2xx. It does not guarantee that every configured field was found or parsed correctly.

Worked Configuration Examples

Enter each line below as a separate Custom Parameter name and value. The = separates the name from the value in these examples; do not include it in the parameter name.

1. Public test: JSON temperature and humidity

url1_name = Temperature Monitor
url1_url = https://httpbin.org/anything?temperature=35&humidity=62
url1_method = GET
url1_field1 = args.temperature
url1_field2 = args.humidity
url1_interval = 60

The test service echoes the URL's query arguments as JSON. Field 1 should read 35 and Field 2 should read 62. This is an example service, not a live sensor.

2. Public test: plain-text number

url2_name = Plain Text Test
url2_url = https://httpbin.org/base64/NzIuNQ==
url2_method = GET
url2_field1 = text
url2_interval = 0

Select the Plain Text Test node and issue Send Request. Field 1 should read 72.5.

3. POST JSON and read the echoed values

url3_name = POST Test
url3_url = https://httpbin.org/anything
url3_method = POST
url3_headers = {"Content-Type":"application/json"}
url3_body = {"temperature":47,"humidity":81}
url3_field1 = json.temperature
url3_field2 = json.humidity
url3_interval = 0

Issue Send Request. The test service echoes the submitted JSON under its json property, so Fields 1 and 2 should read 47 and 81.

4. Local device action or webhook

url4_name = Patio Device On
url4_url = http://192.168.1.50/api/power
url4_method = POST
url4_headers = {"Content-Type":"application/json"}
url4_body = {"state":"on"}
url4_interval = 0

This is a template: replace the example address, path, headers, and body with those required by your actual device. An IoX program can invoke the endpoint's Send Request command to trigger the action. If the device returns no numeric data, response fields can remain unconfigured.

5. Second sensor on the same API

url5_name = Equipment Status
url5_url = http://192.168.1.60/api/status
url5_method = GET
url5_field1 = measurements.temperature
url5_field2 = measurements.pressure
url5_interval = 120

This is also a template. The field paths must match the JSON returned by your device.

Automatic Polling

For a GET endpoint, set urlN_interval to a positive integer number of seconds. A value of 0 disables automatic polling.

url1_method = GET
url1_interval = 60

Polling is evaluated on PG3x Short Poll events (the supplied node server metadata specifies a 30-second Short Poll). Therefore, the configured interval is a minimum elapsed time, not a precise timer. For example, a 45-second interval may not be checked until the next Short Poll.

Each endpoint tracks the time of its most recent request, including manually triggered requests. Manual requests can therefore shift the next scheduled poll.

Action safety: POST, PUT, and DELETE are never automatically polled, even if a nonzero interval is entered. Use explicit IoX commands for actions that change device state.

HTTP Scene Controllers

Each numeric response field can create an independent IoX scene-controller node.

Configuration example

url1_field1 = temperature
url1_field1_controller = true
url1_field1_on = 75
url1_field1_on_operator = >=
url1_field1_off = 70
url1_field1_off_operator = <=

Add the resulting Field 1 node to an IoX scene as a Controller.

Supported operators: ==, !=, >, >=, <, <=.

Operators default to ==. ON and OFF thresholds default to 1 and 0.

The first matching reading sends an ON or OFF event. Further events occur only when the state changes.

Values between thresholds retain the previous state. Before either condition matches, the state is Unknown.

If both conditions match, no event is generated. Failed HTTP requests and invalid fields do not trigger scenes.

Scene Controller Parameters

ParameterPurposeDefault
fieldX_controllerEnable controllerfalse
fieldX_onON threshold1
fieldX_on_operatorON comparison==
fieldX_offOFF threshold0
fieldX_off_operatorOFF comparison==

Use the endpoint prefix urlN_ and field number X (1-8). For example: url2_field3_on.

Hysteresis Example

With ON >= 75 and OFF <= 70:

  • 75 or higher: ON
  • 70 or lower: OFF
  • Between 70 and 75: retain previous state

IoX Scene Setup

  1. Enable the desired field controller in Custom Parameters.
  2. Save the parameters and restart the node server.
  3. Reopen the IoX Admin Console if necessary.
  4. Add the new Field controller node to an IoX scene as Controller.
  5. Configure the scene responders.
Important: A scene event is sent on the first matching reading after startup and whenever the state changes. Repeated readings in the same state do not resend the event.

IoX Nodes, Status & Programs

The node server creates a controller node and up to 16 endpoint nodes. Each configured endpoint has a stable address such as url1 and its configured display name.

Endpoint commands

CommandBehavior
Send RequestImmediately executes the endpoint's configured HTTP request.
QueryReports the stored IoX driver values; does not perform an HTTP request.

Endpoint status fields

IoX displayDriverMeaning
Last Request SuccessfulSTTrue for HTTP 2xx, False for an error or unsuccessful HTTP status
HTTP Status CodeGV1Most recent received HTTP status code (for example, 200 or 404)
Response Time (ms)GV2Elapsed time for the most recent received HTTP response, in milliseconds
Field 1 … Field 8GV3 … GV10Numeric values extracted from configured response paths

Using a node in an IoX program

In the IoX Admin Console, create a program and use the endpoint's Send Request command in its Then section. For example, a motion or schedule condition could execute the Patio Device On endpoint. To react to returned measurements, add conditions referencing the endpoint's Field 1–8 values.

Reliable automation: When a decision depends on current data, check Last Request Successful and account for the age of the last successful measurement. A successful status does not establish that every individual field parsed correctly.

What happens after errors?

When an HTTP response is received, the HTTP status and response time are updated. An HTTP status outside 200–299 sets Last Request Successful to False and leaves measurement fields unchanged. Connection errors, timeouts, and invalid header configuration set Last Request Successful to False; the code does not reset the prior HTTP status code, response time, or measurements in those cases.

Troubleshooting

SymptomLikely cause / next step
Endpoint node missingConfirm both urlN_name and urlN_url exist; save parameters, restart the node server, and reopen the Admin Console.
Last Request Successful = FalseCheck the HTTP Status Code and PG3x logs. HTTP 4xx usually indicates a request/authentication problem; 5xx indicates a server-side failure.
HTTP status still shows an older valueA connection failure or timeout may not produce an HTTP response, so the old status code can remain visible. Consult the plugin log.
Field stays at 0 or its previous valueConfirm the JSON path exactly matches the response, or use text for a plain numeric body. Check logs for “Could not parse field”.
GET polling does not runConfirm urlN_interval is positive, the method is GET, and PG3x Short Poll events are occurring.
POST / PUT / DELETE does not repeatExpected behavior: these methods are command-only. Trigger them using Send Request.
Request times outConfirm DNS, routing, firewall rules, port, and reachability from the eisy itself. The request timeout is five seconds.
HTTP 301 / 302 responseRedirects are not followed. Configure the final URL directly.
Invalid headers errorurlN_headers must be a JSON object, e.g. {"Accept":"application/json"}.
Unexpected or old node labelsClose and reopen the IoX Admin Console to reload the profile.

Useful diagnostic sequence

  1. Temporarily test the endpoint with a known working GET URL.
  2. Issue Send Request manually.
  3. Check Last Request Successful, HTTP Status Code, and Response Time.
  4. Check the node server's PG3x log for request failures or field parsing warnings.
  5. Restore your target URL and add response-field mappings one at a time.

Security & Current Limitations

  • Prefer HTTPS. Plain HTTP can expose request data and credentials on the network.
  • Protect API tokens. Custom Parameters and plugin logs should be accessible only to trusted administrators. Do not put credentials in public GitHub commits or shared screenshots.
  • Limit device permissions. Use narrowly scoped tokens and avoid configuring destructive DELETE endpoints unless needed.
  • Timeout: each HTTP request uses a five-second timeout.
  • No redirect following: configure the final URL instead of relying on 301/302 responses.
  • Numeric fields only: response mappings populate numeric IoX drivers; arbitrary strings cannot be displayed in those fields.
  • No dynamic command payloads: request URL, method, headers, and body come from saved Custom Parameters.
  • Polling is approximate: it depends on the PG3x Short Poll cadence, not a separate per-endpoint scheduler.
This plugin initiates outbound requests from the eisy. It does not require opening an inbound port on your router for normal use.

Quick Reference

Setting / behaviorValue
Endpoint countUp to 16 (url1_ … url16_)
Required per endpointurlN_name, urlN_url
Supported methodsGET, POST, PUT, DELETE
Automatic pollingGET only, urlN_interval > 0
Numeric response fields8 per endpoint
JSON pathsDot notation, numeric zero-based array indexes
Plain-text numberSet a field mapping to text
Success definitionHTTP 200–299
Request timeout5 seconds
Redirect handlingDisabled
Configuration changesSave and restart node server

Project: github.com/lovintexas/udi-http-control
License: MIT
Documented release: 1.5.0

↑ Back to top