Skip to main content

Bridge Widget

✦ Special

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

PropertyTypeDefaultDescription
Source DevicedeviceDevice whose pin value is forwarded
Source PinV0V255Pin to read from on the source
Target DevicedeviceDevice to forward the value to
Target PinV0V255Pin to write on the target
Transformnone | scale | invert | customnoneOptional value transformation
LabelstringWidget 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

Single direction

A Bridge is unidirectional. To create a two-way sync, add a second Bridge widget with source and target swapped.

Loop prevention

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.