Tinca/Docs/Widgets/Toggle Switch

Toggle Switch

FREE
CONTROL · 17 FIELDS · 1×1 DEFAULT
OFFON

On/off switch for boolean topics

When to reach for it

Toggle Switch latches a boolean over a topic: lights, pumps, a manual/autonomous mode flag. For a button that flips between two arbitrary JSON payloads with per-state labels and colors, Custom Button has a Toggle mode, but selecting it is Pro-only; Toggle Switch does the same job for free when the underlying state really is a bool.

Worked example: cabin lights

Topic /lights/cabin, schema std_msgs/msg/Bool. ON Message { "data": true }, OFF Message { "data": false }. On Pro, set ON Text to Lights On, OFF Text to Lights Off, and ON Color to Gold so the dashboard reads as state, not as a switch.

Watch out for
  • A malformed ON Message or OFF Message payload fails silently: invalid JSON is caught and the publish is skipped with no error shown anywhere. The switch still flips, animates, and fires a haptic, so it looks like it worked while nothing reaches the robot. Validate the JSON before trusting this on real hardware.
  • On Pro, Use Threshold Comparison turns a numeric feedback value into a bool by comparing it against Threshold Value. Pair it with ON when Below Thresholdwhen low values mean "on" (battery below 20% as a low-battery toggle, for example).

Configuration fields

Topictopic

The topic this widget publishes to. While connected, tap to pick from the topics the robot advertises.

Message Typestring

The ROS message type for this topic, e.g. sensor_msgs/msg/Image. Usually auto-filled when you choose a topic.

ON Messagejson
OFF Messagejson
Track Robot StatePROboolean

Show the robot's actual value as a ghost indicator alongside your command.

WITH PROThe widget subscribes to a feedback topic and renders the live state as a ghost on the track. The thumb stays at your commanded value, so you see command and state diverge during motion. On first connect, the thumb snaps to the actual value so the first interaction starts from where the robot is.

Feedback TopicPROtopic

Topic carrying the robot's actual value, drawn as a ghost alongside your command.

Feedback FieldPROfield-path

Field path on the feedback topic to read as the actual value.

Use Threshold ComparisonPROboolean

Turn the ghost into an on/off state by comparing the feedback against a threshold.

Threshold ValuePROnumber

The value the feedback is compared against.

ON when Below ThresholdPROboolean

Treat readings below the threshold as ON instead of above.

Show Labelboolean

Show a name on the widget.

Labelstring
ON TextPROstring

Custom label shown when the switch is ON.

WITH PROFree shows the configured Label in both states. Pro lets you swap the wording per state, like "Armed" vs "Safe" or "Pump On" vs "Pump Off", so the operator never has to wonder which way is which.

OFF TextPROstring

Custom label shown when the switch is OFF.

WITH PROPairs with ON Text. Leave empty to fall back to the main Label.

ON ColorPROselect

Background color when the switch is ON.

GoldGreenRedBlue

WITH PROUseful for fast visual scanning across a dashboard with many toggles, like green for safe, gold for armed, red for emergency systems. Stays themed if you leave it on default.

OFF ColorPROselect

Background color when the switch is OFF.

GoldGreenRedBlue
Orientationselect
AutoHorizontalVertical