Data sources (incoming)
Data sources are where live data enters Routix Dash. Create and manage them from the menu under Data sources.
Each source has a name and a type (HTTP, HTTP stream, Video, MQTT, WebSocket, or Timer). Every type except HTTP and Video can have optional transformers. An HTTP source uses an Actions / Transformers pipe instead: at least one HTTP request, plus optional expressions, JSONPath, Lua, JavaScript, Stop pipeline, or Debounce.
One source can feed many data pieces. Set it as a data piece root source so components inherit it, or pick a different source on a component.
On the Data sources screen, swipe a row right to left to delete a source. Inside a source's editor, swipe an action or transformer row right to left to remove it.
The editor is titled New data source when you add a source and Data source when you edit one. Once you type a Name, it appears as a subtitle under the Name field.
The last setting in a source editor is Data: your own notes or data, up to 5120 characters, as plain text or JSON. It is stored as is and not evaluated, and scripts cannot read it. Don't put secrets there. See Components.
Unlike destinations, sources don't send anything out — they receive data (or, for Timer, produce it on a schedule) and store it as value, which every linked data piece reads. A Video source is the exception: it has no value and passes pictures straight to Video components.
An HTTP source is incoming only: it runs an Actions / Transformers pipe (or Trigger data source(s) does). Sending from a component is a tap HTTP request, MQTT send, or WebSocket send on this component, or Trigger data destination for a reusable outbound setup. See Tap actions.
Types of sources
| Type | What it does |
|---|---|
| HTTP | Runs an Actions / Transformers pipe on a timer or on demand. At least one HTTP request (GET by default), plus optional expressions, JSONPath, Lua, JavaScript, Stop pipeline, or Debounce. Headers, query or body parameters, timeout, and TLS options live on each request. |
| HTTP stream | Keeps one response open and turns each line, JSON line, custom split, or raw chunk into the source value. Optional On prepare actions (under Events) run before each connection. |
| Video | Shows live video from a camera in a Video component. Reads an MJPEG stream over HTTP. Has no value, so labels and transformers do not use it. |
| MQTT | Subscribes to one or more topic filters through a shared MQTT connection. Detects whether the message is text, JSON, or an image automatically. |
| WebSocket | Receives messages through a shared WebSocket connection (raw WebSocket, SSE, or Socket.IO-style events). |
| Timer | Emits a fixed string you write, on a timer or on demand — handy for placeholders, test data, or driving component transformers with a clock. |
Auto or manual
HTTP and Timer sources have a Trigger setting:
| Mode | What happens |
|---|---|
| Auto (periodic) | HTTP polls and Timer ticks run in the background on their interval. |
| Manual | Nothing happens in the background. The source only refreshes when you trigger it yourself, or when a tap action runs Trigger data source(s). |
An HTTP stream has Keep connected instead: on, it stays open and connects again after it ends; off, it connects only on demand. A Video source has Keep connected too (see Video). MQTT and WebSocket sources receive messages whenever their shared connection is up — that connection's Keep connected decides whether it stays online.
Default value
Every source except Video has Default value. Linked data pieces show it until the source receives data. A value saved on your device from an earlier session is used instead, when one exists.
Leave it empty if you want data pieces to stay blank until live data arrives. You can type plain text or JSON.
HTTP in Auto (periodic) and Timer ticks always run the rest of the chain — source transformers (or the Actions / Transformers pipe), data pieces, and components, including interpolating {{ source_value("Name") }} on other data pieces. That happens even when Default value is empty or the result did not change.
MQTT, WebSocket, and Manual sources apply Default value once on load when it is set, so linked data pieces and components can start with a value. An empty Default value does not run that chain. After that, only a new message (or a manual trigger) updates them.
You can include {{ source_value("Name") }} or {{ env.my_key }} — a simple expression between double braces. Names here are value and raw for this source, plus source_value("Name"), source_raw("Name"), and env. Tap names transformed and ctx are not available.
If an expression can't be evaluated, HTTP, MQTT, and WebSocket skip the default; a Timer source skips that tick. When another source's value changes, this default is filled in again if this source still has no incoming data.
On a Timer source, Default value is the string sent on each tick — that is where interpolation happens.
Expressions in source fields
The same {{ }} syntax as tap send is available in:
- Default value (all types) —
valueandrawfor this source, plussource_value("Name"),source_raw("Name"), andenv(not tapctx) - HTTP action URL, headers, parameters, and body — those also see
ctx, includingctx.transportfrom the previous HTTP request in the same list - MQTT Topic filters (subscribe)
- WebSocket Rooms and Message events
The app keeps your template as you typed it. It fills in the expression when it fetches, subscribes, ticks, or applies the default. MQTT and WebSocket subscribe to the filled-in names and update them when the other source updates. App-wide variables work the same way: {{ env.my_key }}.
If an expression can't be evaluated in MQTT, WebSocket, or Default value, that fetch, subscribe, or tick is skipped; MQTT and WebSocket keep the last successful subscribe, and the source shows an error. If an HTTP action URL is empty or invalid after that, the rest of that list stops.
HTTP
An HTTP source has an Actions / Transformers pipe. Keep at least one enabled HTTP request. You can add more requests and optional Simple expression, JSONPath, Lua, JavaScript, Stop pipeline, or Debounce after them. HTTP sources do not have a separate transformer list — this list is fetch plus transform.
What you typically set:
- Default value — shown until the first successful fetch
- Trigger interval (ms) — how often to poll in Auto (periodic) mode (5000 ms by default)
- Actions / Transformers pipe — at least one request. The first is GET by default. You can insert
{{ source_value("Name") }},{{ env.my_key }}, or{{ ctx.transport… }}from a previous request in the same list
On each HTTP request you set:
- URL, HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, or OPTIONS), Headers, Parameters (sent in the address for GET, DELETE, HEAD, and OPTIONS, and in the body for the others), and Body. Leave Body empty on POST, PUT, or PATCH to send the current
value - Request timeout (ms) — 5000 ms by default on a source (10000 ms on a destination or tap action), from 500 to 120000 ms
- Allow bad certificates — accept self-signed or invalid TLS certificates
- Unchanged data — what to do when nothing changed since the last run:
- Reuse (the default) — the app asks the server whether anything changed (HTTP 304). If not, it reuses the last response. This saves traffic. A 304 still counts as a successful check: the last value is kept, and linked data pieces still update
- Always download — download the full response every time. Use it for servers that wrongly say nothing changed
- Download every N requests — usually reuse, but download in full every N requests (N is 2 or more)
- Apply result — what to do with the response: Ignore it, put it into the Pipeline value (the default on a source), or store it under a ctx key you name (for example
ctx.httpResponse) - Stop pipeline if failed — see below
Each poll (and each Trigger data source(s)) runs linked data pieces and components again even if the response is the same.
Login in the address: when a server or camera asks for a user name and password, put them in the URL before the host: http://{{ env.camera_login }}@192.168.1.20/picture. Create an ENV variable camera_login with the value user:password, so the password does not appear in the URL. A Video source also has its own Username and Password fields (see Video).
Basic and Digest login both work. Digest can use MD5, SHA-256, or SHA-512-256, whichever the server asks for. If the password contains @, :, /, or #, write them as %40, %3A, %2F, and %23. This works the same for HTTP requests, HTTP streams, and Video sources.
The app remembers a Digest login, so the next poll, picture, or reconnect logs in straight away without an extra request. The login goes only to the server in the address, never to another server it redirects to. If you set an Authorization header yourself, that header is sent instead.
Tip: the very first request sends the password with Basic login. On a plain http:// address it can be read on your network, so use https:// when the camera or server supports it.
When later requests need earlier data: add several HTTP requests to the list — for example multi-step login (fetch a token, then call a protected API with it). Requests run in order on each fetch. Pull fields out of the first response with JSONPath or Lua, then use them in the next request's URL, headers, or body — for example Authorization: Bearer {{ value.access_token }}.
Run if skips that row when the condition is not met. Do not run if skips it when the condition is met. If the condition cannot be evaluated, that row is also skipped, and the list continues.
Stop pipeline if failed is on unless you turn it off. A server error, a timeout, or a lost connection then stops the rest of the list. The request still replaces ctx.transport, and ctx.error is set. Turn it off for site monitoring so a later script can still run.
A Simple expression / JSONPath / Lua error stops the rest of the list. An empty or invalid URL, or an expression that can't be evaluated, also stops the rest of the list.
What gets stored: text responses are stored as text (JSON-looking strings are decoded when possible). Image responses are stored as raw image data. Leftover ctx.error after the list marks the source as failed.
Request details: every HTTP request overwrites ctx.transport:
method,url,requestHeaders,responseTime(milliseconds),receivedAt- When a response arrived:
statusCode,byteLength(response size in bytes),contentType,charset,responseHeaders,reasonPhrase(for exampleNot Found), andfinalUrl(the address after redirects)
Hyphenated header names stay as map lookups, for example ctx.transport.responseHeaders["set-cookie"]. Use ctx.transport.responseTime ?? 0 in an expression, or return ctx.transport.responseTime or 0 in Lua, to show how long the request took on a Label.
HTTP stream
An HTTP stream stays connected and reads the response as it arrives. Each line, JSON value, or chunk becomes the source value, then source transformers run. Use it when the server keeps sending. Use HTTP when each refresh is a normal request that finishes.
What you typically set:
- URL — the address that stays open. It can include
{{ env.my_key }}or{{ value }}from On prepare - HTTP method — GET (default) or POST, plus Headers, Parameters, and, for POST, Body
- Allow bad certificates — accept self-signed or invalid TLS certificates
- Framing — Lines (default), NDJSON (one JSON value per line), Custom delimiter, or Raw chunks
- On prepare (under Events) — optional actions that run before every connection. Requests and scripts are both allowed. The stream URL can use their result as an expression. The row's switch turns the list on or off. A list that is off, or has nothing enabled, is skipped
- Max frame size (bytes) — the largest single line or chunk accepted (1048576 bytes, 1 MB, by default)
- Connect timeout (ms) — how long to wait for the server to answer (15000 ms by default)
- Idle timeout (s) — if nothing arrives for this long, the connection is treated as dead and the app connects again. 90 s by default. 0 waits with no limit
- Reconnect delay (ms) and Max reconnect delay (ms) — how long to wait before trying again (2000 ms and 60000 ms by default). Repeated failures wait longer, up to the maximum
Connection on the source shows the state, the last close, and when the next try will happen. Reconnect now starts a fresh connection even when the current one looks healthy.
Use Keep connected to control whether the stream stays connected in the background:
- On: keep the stream online and reconnect automatically
- Off: connect only on demand
Connect and Disconnect do not move this switch. They hold the live stream until you restart the app or flip the switch. The data source list then shows Connected by action or script or Disconnected by action or script.
Trigger data source(s) does not drop a working stream. It refreshes data pieces from the last received value. It connects only when the stream is down, blocked, or Keep connected is off.
With Keep connected on, a stream that ends connects again. With it off, a trigger opens one session and then waits. If the address or an expression cannot be evaluated, the source stays blocked until you fix it or trigger it. After some server errors, such as not found, the app waits the maximum delay unless On prepare can fetch a new address. A bad NDJSON line is reported and the stream stays open.
Video
A Video source shows live video from a camera in a Video component. It reads an MJPEG stream over HTTP: the server keeps one response open and sends one JPEG picture after another. Many network cameras and phone webcam apps offer such an address.
This source has no value. Labels, transformers, and source_value("Name") do not see the pictures — only a Video component shows them. That is why it has no Default value and no transformers.
By default the source stays connected, whether or not a Video component shows it. Turn on Pause when not on screen to save network traffic and battery: the source then connects only while a Video component that uses it is on screen. When you leave that screen, or the app goes to the background, the stream closes about 2 seconds later. Several Video components on the same source share one connection.
What you typically set:
- URL — the stream address, for example
http://192.168.1.20:8080/video. It can include{{ env.my_key }}, and also the login (see Login in the address under HTTP) - Headers — for example an
Authorization: Bearer …header when the camera uses a token - Username and Password — for cameras that ask for a login. Put the password in an ENV variable and insert it as
{{ env.camera_password }}. Basic and Digest login both work. When the URL has its ownuser:password@, the URL login is used: both fields are greyed out and show From URL. Remove the login from the URL to use the fields - Allow bad certificates — accept self-signed or invalid TLS certificates
- Format — MJPEG (the only format for now)
- Max frames per second — 0 (the default) shows every frame. A lower number skips extra frames. This saves drawing work on your device, but not network traffic: the camera still sends every frame
- Connect timeout (ms) — how long to wait for the camera to answer (15000 ms by default)
- Reconnect delay (ms) and Max reconnect delay (ms) — how long to wait before trying again (2000 ms and 60000 ms by default). Repeated failures wait longer, up to the maximum
- Pause when not on screen — off by default. On: close the stream while no Video component that uses this source is on screen
Keep connected:
- On (the default): keep the stream connected and reconnect automatically
- Off: connect only when Trigger data source(s) runs. When that stream ends, the source waits for the next trigger
With Pause when not on screen on, both work only while a Video component that uses this source is on screen.
Connection on the source shows the state and when the next try will happen. With Pause when not on screen on, the source editor covers the screen with the Video component, so the state turns to Idle after a moment. That is expected.
If nothing arrives for 15 seconds, the app connects again. If the address answers but no pictures arrive, the source shows an error: check that the address returns an MJPEG stream. After some server errors, such as not found or a refused login, the app waits the maximum delay. An empty or invalid address, or an expression that cannot be evaluated, stops the source until you fix it.
When the camera refuses the user name or password, the source shows Login refused. Check the user and password. (HTTP 401). When the camera asks for a login and none is set, it shows This address asks for a login. Enter the user and password. (HTTP 401).
Pictures are decoded on your device. A 720p stream at 30 frames per second is fine; for very large streams, such as 4K, choose a smaller size in the camera settings.
Camera snapshot address
Many cameras also have an address that returns one JPEG picture, the current view, for example http://192.168.1.20/ISAPI/Streaming/channels/102/picture on Hikvision. Use a Video source for it too, not an HTTP source.
The app sees that each answer ends after one picture and asks for the next one after Reconnect delay (ms). So Reconnect delay (ms) sets how often the picture updates: 500 gives about 2 pictures per second, and the lowest value, 100, up to 10 if the camera answers that fast. Connection stays green between pictures. Between pictures the app reuses the network connection when the camera allows it, and sends a Digest login straight away, so each picture takes one request.
Why not an HTTP source with an Image component? A Video source keeps only the newest picture and draws it straight away. An HTTP source runs every picture through its Actions / Transformers pipe and stores it as the source value, which is extra work at 2 pictures per second. Use an HTTP source only for a slow refresh, for example once every 30 seconds or less often, or when you need actions on the answer.
If the address starts sending a real MJPEG stream, the source switches to it by itself.
A camera that sends its pictures as MQTT or WebSocket messages needs no Video source: bind the Video component to that MQTT or WebSocket source (see MQTT).
MQTT
What you typically set:
- Default value — shown until the first matching message
- MQTT connection — pick a shared connection (the broker address, port, TLS, login, protocol version, last will, and so on are all set on the connection, not on the source)
- Topic filters (subscribe) — one per line;
+and#wildcards are supported. At least one is required. Can include{{ source_value("Name") }}or{{ env.my_key }}; the source subscribes to the filled-in names - Subscription QoS — 0, 1, or 2
- No local / Retain as published — shown only when the connection's Protocol version is MQTT 5
Every message updates the source's value with just the message contents (text, decoded JSON, or an image). Details about the message itself are available separately as ctx.transport in transformers and tap actions:
topic,payload,qos,retain,protocolVersion,receivedAt- When the message carries them, MQTT 5
retainAsPublished,responseTopic,correlationData(Base64),contentType,userProperties, andmessageExpiryInterval.
Camera pictures as messages: some cameras, for example an ESP32-CAM, publish one picture per message. Show them with a Video component that uses this source: it draws only the newest picture. Each message must be the picture itself (PNG, JPEG, GIF, or WebP), not Base64 text. Other messages are ignored, and the last picture stays.
To publish outbound, use a tap MQTT send on the component, or a reusable data destination with Trigger data destination. An MQTT source only receives.
WebSocket
What you typically set:
- Default value — shown until the first matching message
- Connection — the shared URL, Transport (WebSocket or Server-Sent Events (SSE)), headers, Reconnect interval (ms) (5000 ms by default), TLS options, and so on
- Message events — an optional list of filters, one per line. Can include
{{ source_value("Name") }}or{{ env.my_key }}:- Empty — accept every message
- Socket.IO — match an exact event name
- SSE — match a pattern (
*and?wildcards) - Raw WebSocket — this list is ignored; every frame is accepted
- Rooms (Socket.IO) — rooms to join. Can include
{{ source_value("Name") }}or{{ env.my_key }}; the source joins the filled-in rooms
Routix Dash tries Socket.IO first when it makes sense, and falls back to a plain WebSocket if that fails. SSE is chosen per connection with Transport.
Messages are handled the same way as MQTT: text, JSON, or an image is detected automatically for value. Details about the message itself — event name, mode (websocket, sse, or socket.io), connection URL, and on SSE a last-event id — are available as ctx.transport in transformers and tap actions.
Camera pictures sent as messages can be shown with a Video component, the same as for MQTT (see Camera pictures as messages under MQTT).
Timer
What you typically set:
- Default value — the string emitted on each tick (can be JSON, a number, or plain text). Can include
{{ source_value("Name") }}or{{ env.my_key }} - Interval (ms) — 1000 ms by default, at least 100 ms, in Auto (periodic) mode
Every tick notifies linked data pieces and components, even if the string didn't change (component transformers can still produce something different each time — for example, a random number or the current time). Empty Default value still ticks.
Manual mode stops the timer and does not emit an empty Default value on load; use Trigger data source(s), or the source's own trigger control, to emit one value at a time.
Each tick also sets ctx.transport: reason (interval, trigger, defaultValue, or peer), intervalMs, and receivedAt.
Shared connections
MQTT connections and WebSocket connections are set up separately from sources, and reused by multiple sources (and destinations). Routix Dash keeps a connection open for as long as anything still needs it. On those connection lists, swipe a row right to left to delete a connection.
Each MQTT and WebSocket/SSE connection also has Keep connected:
- On: stay online and reconnect automatically
- Off: on-demand only (use tap actions Connect / Disconnect when needed)
Connect and Disconnect do not move this switch. They hold the live link until you restart the app or flip the switch. The connection list then shows Connected by action or script or Disconnected by action or script.
MQTT and WebSocket/SSE connections can run On prepare actions (the first row under Events) before each connect, including reconnects. Use this when the host, URL, headers, query parameters, or credentials need fresh values each time.
Allowed actions: HTTP request, Simple expression, JSONPath, Lua, JavaScript, and Stop pipeline. The row's switch turns the list on or off. A list that is off, or has nothing enabled, is skipped.
MQTT and WebSocket/SSE connections can also run On connected actions (also under Events). They run after every successful connect, including reconnects, once the connection is up. Socket.IO rooms and MQTT topics are already subscribed again by then. Use them to log in, subscribe, send a hello message, or ask for the current state.
- Allowed actions: WebSocket send, MQTT send, HTTP request, Simple expression, JSONPath, Lua, JavaScript, Trigger data destination, Trigger data source(s), Connect, Disconnect, and Stop pipeline
- A WebSocket send or MQTT send with no connection selected sends on this connection. This is the best choice: it keeps working when you copy the connection
- Fields can use the On prepare result (
{{ value }},{{ ctx… }}) and{{ env.my_key }} - If an action fails, the connection shows the error and a log line, but stays connected. It does not reconnect
- Editing the list does not reconnect
- Server replies can arrive while the list is still running
Host, URL, credentials, headers, and similar connection fields can include {{ env.my_key }}. Changing that variable reconnects interpolating connections. See ENV variables.
Each connection's editor shows a status dot and a Connection log. If there is an error, the log opens so you can see what went wrong.
The last setting in a connection editor is Data, the same as on a source.
Source list rows for HTTP stream, MQTT, and WebSocket/SSE show two dots side by side: connection, then activity. HTTP and Timer rows show one activity dot, and every name starts at the same offset. Each data piece still shows one status dot:
- HTTP — gray while idle, red on error, and solid green while a request runs
- Timer — gray while idle, red if there is an error, solid green while a tick is running
- HTTP stream — connection is green while the stream is open, gray and blinking while connecting, gray while idle, and red when it failed. Activity is gray while no data is arriving, red on error, and green for a moment when data arrives
- Video — connection is green while the stream is open, gray and blinking while connecting, gray while idle (off, or paused with no Video component on screen), and red when it failed. Activity is solid green while the stream is connected
- MQTT and WebSocket/SSE — connection is green while connected, gray and blinking while connecting, gray when idle or when Keep connected is off, and red when it failed. Activity is gray while no data moves, red on error, and green for a moment when the source receives a message or anything is sent on its connection, for example by a data destination
How data type is detected
For HTTP, MQTT, and WebSocket, Routix Dash looks at the content type and the bytes themselves to decide whether the data is text, JSON (decoded before transformers run, when possible), or an image. The stored value follows that decision, so match the components you add — for example, a Label for text or JSON.
Source transformers and status
HTTP stream, MQTT, WebSocket, and Timer sources can have their own transformers (JSONPath, Simple expression, Lua, JavaScript, Stop pipeline, Debounce) that run on every new incoming value before it's stored as value. HTTP sources use the Actions / Transformers pipe instead. A Video source has no transformers. See Data transformers.
Network failures run through this same chain. ctx.error is an object with a message, a kind, and sometimes a statusCode. It's null when things succeed, or after a Lua transformer clears it with ctx.error = nil. Clearing it on the source affects every transformer that runs after it, and every component linked to that source.
Each source keeps:
value— the result after the source's transformers run (what components receive)- A relative time on the data piece (for example 2s ago) after a successful check or message, even if nothing changed (an HTTP poll or a Timer tick)
- Connection health on the status dot and, for MQTT and WebSocket, in the connection log
After the source's transformers run, each linked component gets its own copy of the error information. Whether a component shows a red #error above it in the editor depends on a transformer throw — leftover ctx.error stays available to later transformers in that component chain. Connection health is separate.
Incoming data is cached on your device, so restarting the app restores the last value before the next fetch or message arrives. If nothing is cached yet, Default value is used instead.
Refreshing by hand
- Open a source and use its trigger control, or add a Trigger data source(s) action to a component's tap actions
- HTTP — runs the Actions / Transformers pipe
- HTTP stream — refreshes data pieces from the last value. Connects only when the stream is down, blocked, or Keep connected is off. Reconnect now on the source always starts a fresh connection
- Video — connects when the stream is down. With Pause when not on screen on, only while a Video component that uses it is on screen; otherwise it does nothing
- MQTT / WebSocket — re-runs the source's transformers on the last message received; it doesn't wait for a new one to arrive
- Timer — emits one tick with the string you've set
While a tap action is running, automatic background refreshes for the tapped component's source pause, so every action sees a stable value.
See also
- Incoming data flow — the full path from the network to the screen
- ENV variables — reusable hosts, tokens, and shared strings (
env.my_key) - Expressions in editors — which names work in source fields and
{{ }} - Data transformers — source-level vs component transformer chains
- Tap actions — HTTP request, MQTT send, WebSocket send, and Trigger data destination
- Data destinations — reusable outbound HTTP, MQTT, and WebSocket
- Tutorials: HTTP GET, MQTT, WebSocket, Timer / live clock