Tinca/Docs/Widgets/Toggle Switch

Toggle Switch

FREE
CONTROL · 18 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, Message Type 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 one the robot advertises.

Message Typestring

The ROS message type, like sensor_msgs/msg/Image. Fills in when you pick a topic.

ON Messagejson
OFF Messagejson
Track Robot StatePROboolean

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

WITH PROSee the robot's actual value as a ghost next to your command, live as it moves.

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.

Max Message Rate (Hz)number

Messages per second this widget takes from the feedback topic. Lower saves data, higher tracks closer.

0.1 to 60, step 0.1
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 PROPro lets you name each state, like Armed and Safe, so nobody wonders 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 PROColor each state so a dashboard full of toggles reads at a glance. Stays themed on default.

OFF ColorPROselect

Background color when the switch is OFF.

GoldGreenRedBlue
Orientationselect
AutoHorizontalVertical