WebRelay X-401 Overview


date desc
20 Aug 2024 initial

1.0 Introduction

This document is specifically focused on the ControlByWeb X-401, which has two optically-isolated digital inputs and two relays.

The previous version of the document also dealt with older devices which are no longer sold. A link to the previous document is at the top of this page.

The main reason for an X-401-specific document is to discuss more details about the X-400 series firmware which is present in most, if not all, webrelay devices supporting dry contact functionality.

We almost always use the X-401-E, which is the PoE version of the device. There is no functional difference between PoE and non-PoE models, but there are differences based on firmware versions.

With the X-401 and all other 400-series ControlByWeb devices, we use Remote Services functionality to send data to the ICON Signals server.


1.1 Security

One useful feature of the X-401 is IP address filtering to control which hosts can send commands to the device.

1.2 Important Notes!

  1. ICON Signals has no visibility into WebRelay device settings and assumes they are configured as described in this document.

  2. Other WebRelay products will not work with ICON Signals until we write software to support them.

This document will include screenshots of the WebRelay interfaces when discussing their use within ICON Signals, but will not describe all features of those products.

Product documentation is available at: https://www.controlbyweb.com

2.0 ICON Signals "Standard Device Interface"

ICON Signals supports different families of sensor devices, each of which can be enabled or disabled in the Workflow > Sensor Modules page. The Standard Device Interface is used for devices which are not directly configured by ICON Signals itself. Examples include passive environmental sensors, webcams, and other devices which are configured outside of ICON Signals and which simply send data to ICON Signals.

The WebRelay devices are handled within the Standard Devices Interface. When this interface is enabled, Signals does the following with respect to webrelay devices:

(Note: Changing the Remote Services port from 6506 to another value is not recommended and should only be done in consultation with ICON support.)

X-401 devices will be configured to enable Remote Services and send data to the Signals server on port 6506.

sensor modules


3.0 WebRelay Setup

Configure the WebRelay device to be on the same network as the ICON Signals server. Refer to the manual for details.

For all devices, the setup page is {ip-address}/setup.html

Follow the "Quick-Start Guide" shipped with the device to get it on the same network as the ICON Signals server. Then continue reading this section.

The screenshots below show the changes needed to work with Signals.

When making any changes, you must click the Submit button at the bottom of the page.

3.1 Networking

x401 general info

x401 netwok

x401 adv network

When Remote Services is enabled, the WebRelay makes a TCP connection to the given IP address and port and sends the connection string. After that it periodically sends the connection string to the destination server. ICON Signals expects to find the MAC address in the connection string, so please configure it as shown in the above screenshot.


3.2 Passwords & DateTime

x401 password

x401 datetime


3.3 Remote Devices

No changes are needed in this section for interoperation with Signals.

3.4 IO Setup

Each section of IO Setup is briefly covered below.

Two different types of buttons may be connected to an X-401: latched and momentary contact.

For latched buttons, no changes are needed. However a control flags register may be useful depending on specific system details.

(3.4.1) Relays

No changes needed in this section.

(3.4.2) Digital Inputs

For momentary buttons, consider reducing the default Hold Time from 20ms to something shorter (e.g. 10ms or 5ms). This parameter is under Advanced Features.

(3.4.3) Registers

NOTE: Registers are used with momentary buttons. If your site is using latched buttons, you can ignore this section.

Register 1 is pre-defined on the X-401. Create Register 2 and Register 3 as well.

register list

You can name the registers anything you want, but the local register numbers must be 1, 2 and 3.

Configure all three registers with:

register 2


As shown in the register list, Register 3 is used to hold flag bits. It may have a non-zero Initial Value.

register 3


Control bits are shown in the table below.

bit name desc
0x8 NADR non-addressible device (cannot be polled by Signals)
0x4 UREG use register1 and register2 values in place of digitalInput1 and digitalInput2 respectively
0x2 URS use relay1 and relay2 values in place of digitalInput1 and digitalInput2 respectively
0x1 DBG internal debugging flag

For momentary buttons, Register3 should have an initial value of 4. Add 8 if the device is non-addressible.


(3.4.4) Vin

No changes needed in this section.

(3.4.5) Timers

Timers are used for momentary buttons. If your site has latched buttons you can ignore this section.

Otherwise, create two timers. They do not need to be configured.


3.5 Control/Logic Setup


The Control/Logic Setup > Tasks/Functions page is critical to the integration with Signals.

We configure the X-401 to send state information to the Signals server both periodically and whenever either digital input has a change of state (ON or OFF).

(3.5.1) Latched Buttons

The following screenshots show a configuration suitable for latched buttons.

Basically we want to send the state data to Signals via Remote Services whenever an input changes.

x401 tasks functions

x401 tasks functions dialog

x401 tasks scheduled


NOTE: The screenshots above include a conditional task to send data to Signals for relay state changes, but that is not strictly necessary.


(3.5.2) Momentary Contact Buttons

This is a more complicated configuration scenario. We want to guard against repeated button presses.

The basic idea is use register values in place of input values. For example, when a button is pressed and digitalInput1 changes from 0 to 1:

  1. Set register1 value to 1
  2. Set timer1 to 30 (30-second countdown timer)
  3. Send the state data push to Signals via Remote Services

The register1 value of 1 is sent in the state data push to ICON Signals - which uses it as the input 1 value.

When timer1 expires (reaches 0), register1 is set back to 0 and the state data which now indicates a clear condition is pushed to Signals again.

The following screenshot encapsulates this logic and also guards against the use case of a momentary button held down as well as a scheduled periodic state push occurring in the middle of an alarm condition.

momentary logic


4.0 ICON Signals Device Config

If the X-401 is sending data to ICON Signals, then a new device will appear in the Sensor Grid.

sensor grid

Click on the device to set name and location as well as to define which state(s) represent an alarm condition.

dd ident

dd params

dd config

dd actions


When the WebRelay device goes into an out of alarm state, ICON Signals raises the signals shown in the Actions tab. If we were using Web Relay devices to trigger a lockdown, we would likely create a rule with the expression WR-ON (which would match against all WebRelay devices) and redirect it to our LOCKDOWN rule.


5.0 ICON Signals Special Actions in Rules

The WebRelay device relays can be configured to mirror the associated input state. (e.g. Switch closes, relay turned on, stobe light is lit). But what if you need programmatic control of the relay? For example, the relay is not turned off until a lockdown command is received.

Special actions are very short scripts included in a rule to perform actions outside of what's available in the user interface.

In this case, a new signals script API function called stddev.webrelay() can be used to do anything allowed by the WebRelay device. The script can turn either relay on or off, toggle the value, or pulse a relay for a specified duration.

Example screenshots follow.

spec action

spec action2

stddev.webrelay() parameters for WebRelay-Dual (X-301 and X-401)

ID Device ID
relay1 0=off, 1=on, 2=pulse, 5=toggle
pulse1 pulse time (secs) for relay 1 in pulse mode
relay2 0=off, 1=on, 2=pulse, 5=toggle
pulse2 pulse time (secs) for relay 2 in pulse mode

If a pulse duration is not provided as a parameter, the device uses its configured default value.


stddev.webrelay() parameters for WebRelay (X-WR-1R12)

ID Device ID
relay 0=off, 1=on, 2=pulse, 5=toggle

Unlike the X-301, pulse duration can only be configured in the device itself.


Appendix A: X-401 Dry Contact Wiring

                  +----------------+
                  |                |
                  +                |
         o+------+o Vout           |
Contact 1           Gnd  o+----+   |
         o+------+o In1+       |   |
                    In1- o+----+   |
                               |   |
         o+------+o In2+       |   |
Contact 2           In2- o+----+   |
         o+--+                     |
             +---------------------+


2024 ICON Voice Networks