Toggle Switch
FREEOn/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
The topic this widget publishes to. While connected, tap to pick one the robot advertises.
The ROS message type, like sensor_msgs/msg/Image. Fills in when you pick a topic.
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.
Topic carrying the robot's actual value, drawn as a ghost alongside your command.
Field path on the feedback topic to read as the actual value.
Messages per second this widget takes from the feedback topic. Lower saves data, higher tracks closer.
0.1 to 60, step 0.1Turn the ghost into an on/off state by comparing the feedback against a threshold.
The value the feedback is compared against.
Treat readings below the threshold as ON instead of above.
Show a name on the widget.
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.
Custom label shown when the switch is OFF.
WITH PROPairs with ON Text. Leave empty to fall back to the main Label.
Background color when the switch is ON.
WITH PROColor each state so a dashboard full of toggles reads at a glance. Stays themed on default.
Background color when the switch is OFF.