Skip to content

Switch

πŸ’‘ Object: Switch (The Binary State Actuator)

Represents a fundamental state actuator, such as: - Smart light switch. - Connected outlet. - Relay controlling a device.

Its function: maintain one of two persistent states: - on β†’ Turned on. - off β†’ Turned off.


πŸ“– Concept

It is the "digital hand" of the system.
Responsible for performing the most common physical action: opening or closing a circuit.

πŸ”Ή Difference from a Button:
The Switch has memory. If it's turned on, it remains on until receiving an order to turn off.


βš™οΈ Operation

  • As an actuator, the Switch doesn't measure the environment.
  • Receives orders from:
  • Sensors.
  • Buttons.
  • Scheduled timers.
  • A rule sends the command β†’ the Switch changes its state property (on / off) and transmits the signal to the physical device.

✨ Key Point

It is the most basic and essential action component.
Converts the system's logical decisions into tangible changes in the physical world.


πŸ“Š Fundamental Properties and States

Simplicity is its strength.
Based on a single property:

  • state β†’ Defines if the device is on or off.

Possible values: - on β†’ Device activated; circuit closed. - off β†’ Device deactivated; circuit open.

πŸ“Œ Persistent state: maintains its condition until receiving a new command.


πŸ”„ Typical Workflow

Example: Automatic light by motion detection

  1. Event β†’ A Motion sensor changes its state to detected.
  2. Rule β†’ The "automatic light" automation activates.
  3. Command β†’ Send order to Switch_Room_Light object to set state = on.
  4. Action