Manual Override Control with Automatic Return
Takes an automated value off its schedule for a chosen time, shows who did it and when it returns, and hands it back with one click.
The deadline is a comparison your automation makes, not a timer this card runs — so an override left behind by a crash or a closed browser stops counting the moment it expires, with nothing to sweep and nothing to remember across a restart.
Who it’s for
A building operator whose guest turned the lobby up, a grower who needs a compartment held while they work in it, a street-lighting crew who need a segment on now and back on programme afterwards — all three ask the same question of the same value: is this coming from the automation or from a person, and when does it go back? The card is deliberately indifferent to what the value is, so the same one sits above a temperature setpoint, an irrigation pump, a damper or a lighting zone.
What it does
A lobby setpoint following its schedule at 21.5 °C is taken to manual for two hours at 16:21. The
card writes controlMode: manual and overrideUntil two hours ahead, shows Overridden by A.
Zaiko, counts down returns to automatic in 1 h 58 min · 18:21, and at 18:21 reads as automatic
again without writing anything to make that true.
- The time remaining in both forms. “in 47 min” and “18:00” answer different questions — one tells you whether to wait, the other tells you what to write on a work order.
- The mode, the deadline and the value they govern, all read back. The card shows what is in force rather than what was last sent.
- An override with no end, and never quietly. A commissioning engineer needs one, so the card offers it and then turns red and says it will not return on its own. That is the failure every operator describes: somebody took control in March and nobody noticed.
- Who took control, printed beside the mode and written on whichever path the card is on — the attribute on one, a third RPC command on the other.
- An override that survives an offline device. On the attribute path the pair is written to the platform rather than to the device: on server scope it never reaches the device at all, and on shared scope it arrives when the device next connects.
- Governs the authority over a value; it does not set the value. Choosing the level, the setpoint or the mode is the job of the control widget beside it.
Requirements
An automation that reads the two keys before it writes. This card records an override; it does not
enforce one. Where nothing consults controlMode and overrideUntil, the buttons work and the
countdown runs while the value carries on following its schedule. A rule chain, a calculated field or
your own service can be that reader — the filter is in How to set up.
How to set up
Data keys
The override card is a control widget and takes no datasource. Choose a target device in the widget configuration; everything below applies to that one entity.
| Attribute | Scope | Operation | Description |
|---|---|---|---|
controlMode (configurable name) | Server or Shared | Read + Write | Carries the value that means automatic or manual — auto and manual by default |
overrideUntil (configurable name) | Server or Shared | Read + Write | Epoch milliseconds. 0 or absent means an override with no end |
value (configurable name) | Server or Shared | Read | The reading shown on the face of the card. The card never writes it |
overrideBy (configurable name) | Server or Shared | Read + Write | The signed-in user’s name, written while Show who took control is on. On the RPC path the card reads it back here and sends the name as a command instead |
| Method | Direction | Parameters | Sent when |
|---|---|---|---|
setControlMode (configurable name) | One-way | The automatic or manual value, shaped by Payload function if one is written | A duration button, or Return to automatic now, is pressed |
setOverrideUntil (configurable name) | One-way | The deadline in epoch milliseconds, 0 for an override with no end | The same presses |
setOverrideBy (configurable name) | One-way | The signed-in user’s name, and an empty string on the way back to automatic | The same presses, while Show who took control is on |
With controlMode never written the card reads as automatic and every duration button stays enabled;
the first press sets it. With the value key unbound or never reported, the card names the key it is
waiting on rather than showing a bare dash. An overrideUntil in the past reads as automatic without
the card writing anything.
Command
| Setting | Default | Effect |
|---|---|---|
| Action | Write a device attribute | Attribute write or one-way RPC. The dialog shows one path at a time |
| Control-mode method | setControlMode | RPC handler carrying the mode |
| Override-until method | setOverrideUntil | RPC handler carrying the deadline |
| Override-by method | setOverrideBy | RPC handler carrying the operator’s name, sent only while Show who took control is on |
| Payload function | empty | Shapes the outgoing payload for a gateway. Left blank, each command carries its value bare |
| RPC timeout (ms) | 5000 | How long to wait before the command counts as failed |
| Queue the command for an offline device | Off | Holds the command until the device reconnects |
| Retries | 0 | Used only for a queued command |
Attributes
| Setting | Default | Effect |
|---|---|---|
| Control-mode key | controlMode | The attribute your automation reads to decide who is in charge |
| Override-until key | overrideUntil | The deadline your automation compares against the current time |
| Value that means automatic | auto | Match a convention your deployment already writes |
| Value that means manual | manual | The same |
| Key of the value being governed | value | The reading shown on the face of the card |
| Override-by key | overrideBy | Where the signed-in user’s name is written |
| Attribute scope to write | Server | Server keeps the pair off the device and visible to a rule chain; shared delivers it to the device as well |
| Read the card’s state from | Attribute | Read the keys from attributes, or from telemetry instead |
Values
| Setting | Default | Effect |
|---|---|---|
| Durations offered | 30 min, 2 h, 8 h | One button per row, in the order listed. A row with no minutes is dropped |
| Offer an override with no end | On | Adds an “open” button. The card turns red and says it will not return on its own |
| Show who took control | On | Records the signed-in user’s name alongside the mode, on both write paths |
| Caption above the value, Unit shown after the value | Value in force, empty | The words above and after the reading |
| Label when mode ‘automatic’, Label when mode ‘overridden’ | Following the schedule, Overridden | What the card calls each mode |
| Stale after (minutes, 0 = off) | 0 | A device silent this long is marked stale and the card stops asserting the value |
Teaching your automation to honour the override
Enrich the message with the originator’s server attributes controlMode and overrideUntil, then
put this in a script filter ahead of the node that writes to the device:
var mode = metadata.ss_controlMode || 'auto';var until = Number(metadata.ss_overrideUntil || 0);var overridden = mode === 'manual' && (until === 0 || until > Date.now());return !overridden;True means the schedule may act. False means a person is in charge and the deadline has not passed.
Put that check in front of every write. The override is honoured by whatever reads the two keys, so the comparison has to sit where the write happens — in a rule chain, in a calculated field, or in your own service. Automation that writes on a timer without consulting the mode will keep writing, and the card will then be correctly reporting that a person is in charge while the value moves anyway.
How to customize
- To offer different lengths — edit Durations offered. Each row is a number of minutes and a button label, and they are drawn in the order you list them.
- To require an end time on every override — turn off Offer an override with no end.
- To record who stepped in — Show who took control writes the signed-in user’s name into the Override-by key and prints it beside the mode.
- To reword the card — Caption above the value, Label when mode ‘automatic’ and Label when mode ‘overridden’ are the three phrases an operator reads first. A site that says “on programme” rather than “following the schedule” should say so.
- To show a unit after the value — set Unit shown after the value.
- To say when a reading has gone quiet — set Stale after (minutes, 0 = off). The card stops asserting the value, and taking control stays available, because the mode is still known.
- To label the panel — set Title and Subtitle. Left empty, the subtitle names what a write lands on, whether that is a device or an asset, and the write path.
- To match your dashboard’s palette — set Accent color and Keyboard focus outline color. The outline is drawn around a button reached with the Tab key, never on a mouse click, so a keyboard user can see which control has focus.
- To keep the controls a fixed size — turn off Auto-scale controls to widget size.
Tips
-
Keep the pair on server scope when the thing honouring the override is a rule chain. The device then never sees two keys it has no use for, and the override still survives a device that is offline, because the write lands on the platform either way.
-
The card and your automation have to agree on the epoch.
overrideUntilis milliseconds since 1970 UTC; a rule chain comparing it against a seconds-based clock releases every override immediately, and the card will keep counting down while the schedule writes over the top. -
An override with no end is the one worth auditing. Either report on the
overrideUntil = 0case in your own tooling, or turn off Offer an override with no end on sites where nobody should be able to take control indefinitely.
Share Your Widget with the Community
Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.