Bridge Widget
The Bridge widget creates a device-to-device connection through the VWire server. When a source device writes a value to a pin, the Bridge automatically forwards it to a target device and pin — without any custom server-side code. Use it to sync two devices, cascade commands, or build simple automation chains.
Default size: 4 × 2 grid cells
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
| Source Device | device | — | Device whose pin value is forwarded |
| Source Pin | V0–V255 | — | Pin to read from on the source |
| Target Device | device | — | Device to forward the value to |
| Target Pin | V0–V255 | — | Pin to write on the target |
| Transform | none | scale | invert | custom | none | Optional value transformation |
| Label | string | — | Widget label |
How it works
Source Device → Vwire.virtualSend(V0, value)
→ VWire Server sees V0 update
→ Bridge widget rule activates
→ VWire Server writes value to Target Device V5
→ Target Device VWIRE_RECEIVE(V5) fires
The bridge is evaluated server-side every time the source pin receives a new value.
Use cases
Master light switch
Source: ControlPanel V0 (Switch widget: 0/1)
Target: LightDriver V0 (controls relay)
A switch on the control-panel device directly turns the light driver relay on/off.
Temperature relay between sensors
Source: OutdoorSensor V0 (temperature in °C)
Target: DisplayHub V3 (Value Display: outdoor temp)
Replicate a temperature reading from a sensor device onto a separate display device.
Inverted control
With Transform: invert, a 1 from source becomes 0 on target and vice versa.
Use to control an active-low relay or to invert a switch behavior.
Scale transform
With Transform: scale, map the source range to a different target range:
Source: 0–100 (slider percent)
Target: 0–255 (PWM duty cycle)
Scale: ×2.55
Firmware: target device
The target device receives values via its normal VWIRE_RECEIVE handler — it doesn't need to know it's being bridged:
VWIRE_RECEIVE(V5) {
int val = param.asInt();
analogWrite(PWM_PIN, val);
}
Notes
A Bridge is unidirectional. To create a two-way sync, add a second Bridge widget with source and target swapped.
Do not bridge A→B and B→A on the same pins — this creates an infinite loop. VWire detects simple loops and drops repeated values, but complex chains may still misbehave.