# Traffic Lights / Web Switch

Traffic Lights work through Fast-Weigh via a Web Switch that allows the software to send a command to toggle the switches on and off. These Web Switches have one Ethernet Port for network connections, and two outlets for the Traffic Light to connect to.

## Traffic Light Network Configuration

*To use the Web Switch, it must be set to the same IP Scheme as your existing network so it can be reached by other devices your network. This typically involves setting specific IP/Network configuration settings on a computer that can reach the device to initially connect and set up the WebSwitch. If you are unsure how to do so, please consult an available IT professional.*

***A Quick-Start Guide with some relevant details to this can be found here:***\
[*https://controlbyweb.com/wp-content/uploads/2024/03/webswitch-plus-qsg\_v2.3-2x2-1.pdf*](https://controlbyweb.com/wp-content/uploads/2024/03/webswitch-plus-qsg_v2.3-2x2-1.pdf)

* *Additional Relevant Information:*
  * *Default Username: admin*
  * *Default Password: webrelay*
* *Switch Outlet 1: Green Light in Fast-Weigh*
* *Switch Outlet 2: Red Light in Fast-Weigh*

<figure><img src="/files/ITAjaLcSkzSzTduW1Pws" alt=""><figcaption></figcaption></figure>

Once the Web Switch is configured to your network, and your traffic light is connected to your webswitch, and given their relays are named, you can begin the process of configuring it in Fast-Weigh.

***

## Traffic Light Fast Weigh Setup

{% hint style="warning" %}
**ControlByWeb WebSwitches** has had some firmware changes that alter some of the integration steps between the device and fast weigh. Please check what firmware version of the WebSwitch you are using before proceeding further under the appropriate tab. For more information, please visit [ControlByWeb Firmware](https://controlbyweb.com/support/controlbyweb-firmware-updates/?srsltid=AfmBOopX6cqwm999kJ5paRS7o9uRSTB230ZoaSk122LaZTiReQplqB9N)
{% endhint %}

{% tabs fullWidth="true" %}
{% tab title="3.12+ Firmware" %}

## Firmware 3.12+

1. In Fast-Weigh Ticketing, go to **Server Settings.**

2. Under the **Manage Devices** area, select **Add Device**.<br>

   <figure><img src="/files/uTZbKNxlHn4FYqLW5kMr" alt=""><figcaption><p>Server Settings > Add Device > Traffic Light </p></figcaption></figure>

3. In the field labelled **Device Type**, choose **Traffic Light**.

4. Name the device.

5. Next insert these URLs in **\[ Green Light IP Address ]** & **\[ Red Light IP Address ]** , but replacing the \<ws-ip> with your web switch's IP Address.
   1. **Green Light**
      1. *http\://\<ws-ip>/state.xml?relay1State=1,http\://\<ws-ip>/state.xml?relay1State=0*
   2. **Red Light**
      1. *http\://\<ws-ip>/state.xml?relay2State=1,http\://\<ws-ip>/state.xml?relay2State=0*

6. Fill out remaining fields as needed:

   1. **Signal On Inbound:** Enable to signal the traffic light when an inbound ticket is created.
   2. **Signal On Tare:** Enable to signal the traffic light when a truck is Tared on the scale.
      1. Note, Ticket Creation will trigger the signal as well.
   3. **Light Delay (in Seconds):** Amount of seconds before the signal to trigger the light reaches the switch. If set to 5 seconds, it will take 5 seconds for the light to switch after signaling the input in Fast-Weigh.

   <figure><img src="/files/We8WWZPXbIgg8bVIKXG4" alt=""><figcaption><p>Fully configured example for a traffic Light.</p></figcaption></figure>

7. Assign device to the **Lane** in the **Manage Lanes** section with the drop-down selector labelled Light.\
   \\

   <figure><img src="/files/mhBryMbpYLnepiDgXcfD" alt=""><figcaption><p>Assigning the Traffic Light to the Lane.</p></figcaption></figure>

   The traffic light will automatically trigger if you have the **On Inbound** or **On Tare** settings enabled.

   If not, you can manually trigger the light from the ticketing menu using the indicator symbols on the bottom right. (Red and Green circles for each light respectively.)

   <figure><img src="/files/BSKF91teZLGx4O5RvuPN" alt=""><figcaption><p>Manual triggers for the traffic lights.</p></figcaption></figure>

{% endtab %}

{% tab title="Legacy Firmware" %}

## Legacy Firmware ( pre 3.12 )

1. In Fast-Weigh Ticketing, go to **Server Settings.**
   1. (You must have appropriate User Permissions to access these settings).&#x20;
2. Under the **Manage Devices** area, select **Add Device**.<br>

   <figure><img src="/files/uTZbKNxlHn4FYqLW5kMr" alt=""><figcaption><p>Server Settings > Add Device > Traffic Light </p></figcaption></figure>
3. In the field labelled **Device Type**, choose **Traffic Light**.
4. Name the device.
5. Next fill out all of the relevant fields and choose the options you wish to be enabled. The following is a breakdown of these fields:
   1. **Green Light IP Address:** IP/Network Address of the Web Switch. This is for Outlet #1.
   2. **Red Light IP Address:** IP/Network Address of the Web Switch. This is for Outlet #2.
      1. *This should be the IP/Network Address only, with no http\:// or https\:// in front of it.         &#x20;These two IP/Network Addresses will typically be the same unless you are running two independent Web-Switches.*
   3. **Signal On Inbound:** Enable to signal the traffic light when an inbound ticket is created.
   4. **Signal On Tare:** Enable to signal the traffic light when a truck is Tared on the scale.
      1. Note, Ticket Creation will trigger the signal as well.
   5. **Light Delay (in Seconds):** Amount of seconds before the signal to trigger the light reaches the switch. If set to 5 seconds, it will take 5 seconds for the light to switch after signaling the input in Fast-Weigh.<br>

      <figure><img src="/files/m02eC2ZId9pkTPLOIv0u" alt=""><figcaption><p>Fully configured example for a traffic Light.</p></figcaption></figure>
6. Assign device to the **Lane** in the **Manage Lanes** section with the drop-down selector labelled Light.\
   \\

   <figure><img src="/files/mhBryMbpYLnepiDgXcfD" alt=""><figcaption><p>Assigning the Traffic Light to the Lane.</p></figcaption></figure>

The traffic light will automatically trigger if you have the **On Inbound** or **On Tare** settings enabled.

If not, you can manually trigger the light from the ticketing menu using the indicator symbols on the bottom right. (Red and Green circles for each light respectively.)

<figure><img src="/files/BSKF91teZLGx4O5RvuPN" alt=""><figcaption><p>Manual triggers for the traffic lights.</p></figcaption></figure>

{% endtab %}
{% endtabs %}

## Additional Traffic Light Configuration

### Light Always Shows Red, Unless Green

There are additional settings that can be adjusted for the traffic light and Web Switch in order to have it stay Red and only show Green temporarily (for a set number of seconds). \
\
Setting this up requires uploading a text file to the Web Switch in a specific configuration area so it knows to function this way. \
The following steps will go over how to do this and also includes the text file needed:

1. Connect to the Web Switch via a web browser by inputting it's IP/Network Address ending with **"/setup.html".**
   1. If the Web Switch has an IP address of 192.168.0.150, then the web address will be **"192.168.0.150/setup.html"**.
2. Enter the Login information if prompted.
   1. *Default Username: admin*
   2. *Default Password: webswitch*
3. Navigate to the **Script** section in the settings menu.<br>

   <figure><img src="/files/fVJwls52ne7H9r1xPc1H" alt=""><figcaption></figcaption></figure>
4. Download the following .txt file below.

{% file src="/files/E41iNinqlieCD6RYyFZ9" %}

5. Edit the file with any text editor, and input your corresponding relay names where \<relay-name> appears. Then save.

```basic
DO
IF io.<GREEN-light-relay-name> = 1 THEN
  LET io.<RED-light-relay-name> = 0
ELSE
  LET io.<RED-light-relay-name> = 1
END IF
LOOP
END
```

6. Submit the edited file by selecting **\[ Choose File ]** and **\[ Submit ]**

<figure><img src="/files/mfGqK9wdNSy5nf5wrO8X" alt=""><figcaption></figcaption></figure>

6. Ensure that **RUN Script** is set to **Yes**.
7. Select **Submit** to finish uploading.

If these steps were done correctly, you should have something like this showing on the **Script** page:

<figure><img src="/files/0HPgWCmDuMoY2f7sakTM" alt=""><figcaption></figcaption></figure>

6. In order to finish this configuration, you **MUST** completely power off the Web Switch for a few seconds, then power it back on.

Now that it's powered off, you can use the Fast-Weight device settings to determine the length of time before the Green light turns off, which will switch it to Red.\
\
The Traffic Light device setting in Fast-Weigh labelled **Light Delay (in Seconds)** should now determine how long the light stays on Green before changing back to Red.

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.tacinsight.com/fast-weigh-knowledge-base/references/hardware/traffic-lights-web-switch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
