An internal variable is an IO with no hardware behind it: it drives nothing and measures nothing, it simply holds a value.
This is what you start missing as soon as your automations get slightly clever. A few examples:
An internal variable is used in rules exactly like any other IO: as a condition and as an action.
| Type | Holds | Typical use |
|---|---|---|
| Boolean | true or false | A mode being active or not, a flag |
| Integer | a number | A counter, a target value, a level |
| String | text | A message, a named state |
Choose the simplest one that fits. A “Holiday” mode is a boolean; if you need three exclusive modes, an integer or a string reads better than a collection of booleans you must remember to reset.
In the Add menu, choose Internal variable, then fill in:
Three options complete the creation:
| Option | Effect |
|---|---|
| Visible | Shows the variable in the interfaces, to read or change it by hand |
| Read / write | Allows it to be changed from the interfaces, or reserves it for rules |
| Save | Keeps the value across a server restart |
This is the most important one, and the one whose absence shows at the worst moment.
Without it, the variable goes back to its initial value on every restart of the server. After an update or a power cut, your “Holiday” mode switches itself off, and the watering starts again while you are away.
Ask yourself: “if the server restarts tonight, must this value be found unchanged?” If so, enable Save.
Conversely, a working variable — a counter reset every morning — is better off starting from zero.
To stop the automatic watering running twice on the same day:
The same principle — a variable remembering what has already happened — solves a large share of the automations that “keep triggering in a loop”.
A variable that is visible and read/write appears in the applications as a controllable element. It is the simplest way to offer a setting to the user: a target temperature, a mode, a number of minutes.
Your rules then read that variable instead of a value frozen in the configuration — and the user can adjust their installation without opening Calaos Installer.