Introduction to Magic Text
What is Magic Text?
In many triggers, actions, and constraints, you can fill in text fields.
Next to these fields, you will often see a button labeled "...". When you tap it, you will see all the magic text available in that context.
Magic text allows you to insert dynamic information that updates automatically each time the action runs (battery, time, variables, event data, etc.).
Example:
- Normal text:
The battery is low - With magic text:
The battery is at {battery_level}%
How is it used?
You can insert it in two ways:
- By tapping the
...button (recommended for beginners) - By typing it manually
⚠️ If you type it manually, it must match exactly (case, spelling, symbols, etc.).
Any mistake and it will not work.
Available formats
{value}← Recommended (clearer and more modern)[value]← Compatible with older versions
Recommendation: Always use {} unless you are on a very old version (v5.20 or earlier).
Accessing dictionaries and arrays (complex data)
To access information within structures:
{lv=name[key][subkey]}
Example:
{lv=user[name][first]}{lv=event[details][location][city]}
You can nest as many levels as needed, but the deeper you go, the easier it is to make mistakes.
Important tips
- Available magic text depends on the context (you will not see the same options in a "Low Battery" trigger as in a "Notification Received" trigger).
- In modern versions,
{}is safer for complex data because it avoids ambiguity. - You can combine normal text with multiple magic text values in the same field.
