ENV variables

Store text you reuse across the dashboard — a host, a token, a shared string — once, then insert it wherever fields accept expressions.

Open from the menu: Data → ENV variables.

Fields

Field What to enter
Key The name you type later, for example mqtt_host. Latin lowercase letters (a–z), numbers, and underscores. Must not start with a number. Typed letters are stored in lowercase. At most 50 characters.
Value The text to insert. At most 500 characters. The field is hidden while you type; tap Reveal to see it and Hide to hide it again.
Description Optional. Write it so the assistant understands the variable. At most 200 characters.

How to insert a variable

Example: store the broker host as mqtt_host, then put {{ env.mqtt_host }} in the MQTT connection host field.

JSON values

If a value is a JSON object or array, for example {"host": "broker.local", "port": 1883}, the app reads it as that object. Read its fields with a dot: env.my_key.host, {{ env.my_key.port }}, $.env.my_key.host. Lua and JavaScript get a ready table or object, so you don't need json_decode or JSON.parse. {{ env.my_key }} in a text field inserts the whole JSON as text. A value that is not valid JSON stays plain text.

The API key in AI settings and the Password of an MQTT connection have an env button next to the field. Tap it to choose a variable or add a new one, and the app inserts {{ env.my_key }} into the field.

Where it works

It does not expand inside the ENV variables editor itself. Values are stored as you type them.

Missing keys

If you write env.my_key and that key does not exist, it is empty: {{ env.my_key }} fills in nothing. Add a fallback with {{ env.my_key ?? "default" }}.

A field whose expression fails (for example a typo in a name) is not filled in:

When a value changes

Changing a variable updates interpolating sources and reconnects interpolating MQTT and WebSocket connections. Transformers and tap actions use the new value the next time data arrives or you tap.

AI assistant

The assistant sees names and descriptions only. It cannot read values. If it needs a password or token, it may ask you to confirm a variable name, or it may open a sheet where you enter the Key, Value, and Description. The value stays on this device and is never sent to the assistant. You can also add or edit variables here yourself.

Saved with your setup

ENV variables are stored with the rest of the encrypted configuration. Export and snapshots include them, so a variable you add on one device also works on another device after you import the file. See Settings and configuration safety.

Runtime vars

vars is a second app-wide store. Scripts fill it while the app runs — a counter, the last token, a list you build up between taps or ticks. It differs from ENV variables:

ENV variables (env) Runtime vars
Who sets values You, in Data → ENV variables Scripts, while the app runs
Kind of value Text, or a JSON object or array Any: text, number, true/false, list, object
Saved Yes, with your configuration No. Values are gone after the app restarts. Importing a configuration and Delete current configuration also clear them

Write a value from a script:

Keys use lowercase Latin letters, numbers, and underscores, must not start with a number, and are at most 50 characters. Write keys in lowercase: vars.rotSpeed is stored as rotspeed, so the next read of vars.rotSpeed finds nothing. Use vars.rot_speed instead.

Read a value anywhere env works:

A missing key is nil in Lua and empty (null) in a simple expression or {{ }} field, the same as a missing ENV variable. Add a fallback with vars.my_key ?? "default". When a value changes, fields that use it update the same way as for ENV variables.

The assistant can read current vars values to help you check a script. It cannot change them.

Custom screen params

On a custom screen, params holds the values passed when the screen opened. Read params.room in transformers and tap actions (Lua, JavaScript, simple expressions), $.params.room in JSONPath, and {{ params.room }} in component fields. params exists only on custom screens.

See also