This page is retained for historical reference and may not reflect the current MOSH/IMC/MTRP architecture. See architecture_map for the current model.
Before an element can communicate with other elements, it must be placed on a Virtual Wire. A Virtual Wire in MOSH is a logical connection between two or more elements—similar to a physical wire that connects a switch to a light, but defined entirely in software. Virtual wires allow input elements (like buttons or sensors) to send signals to output elements (like LEDs or relays), regardless of where those elements reside on the network.
Virtual wires are transport-agnostic, meaning they can connect elements across different nodes, transports (e.g., ESP-NOW, Serial), or even across bridges.
Virtual wires are declared in element configuration using the `virtual_wire` parameter. When an input element triggers a status message (e.g., `PRESS`, `STATE_ON`), the virtual wire automatically forwards that message to all connected outputs.
This allows you to create automation logic without hard-coding behavior into individual element classes.
Virtual wires transmit:
The Element Manager handles virtual wire delivery internally, ensuring messages are routed to all subscribed elements—locally or remotely.