Failover
Automatically switch between SIM slots after a number of unsuccessful connection attempts.
- Trigger data - The model data that will trigger (start) this automation.
Commands
Properties
Enable
Enable this automation.
- Data type: boolean
- Default:
true - Configuration
CLI: (cli)> config network cellular sim failover enable
Label
The label used to describe and locate this automation.
- Data type: string
- Default:
SIM failover - Configuration
- Optional
CLI: (cli)> config network cellular sim failover label
Running
The run status of this automation.
| Option | Label |
|---|---|
true | Running |
false | Not running |
- Data type: boolean
- Status
CLI: (cli)> show network cellular sim failover running
Error
The error associated with the recent failed run.
- Data type: string
- Status
CLI: (cli)> show network cellular sim failover error
Script
The javascript automation source.
- Data type: string
- Default: `const active = await model.pull('/network/cellular/sim/active'); const alt = active === 'sim1' ? 'sim2' : 'sim1';
/* Don't switch to the alternative SIM slot if it is absent. */ if (!data.sim[alt].present) return;
const maxAttempts = 5; const maxAttemptsExceeded = Object.values(data.connection || {}).some(con => con.attempts > maxAttempts);
/* Switch slot if the current SIM is absent, or a connection has exceeded the
- maximum number of connection attempts. */
if (!data.sim[active].present || maxAttemptsExceeded) {
console.log(
Switching from ${active.toUpperCase()} to ${alt.toUpperCase()}); await model.runCommand('/network/cellular/sim/switch'); } `
- Configuration
- Required
CLI: (cli)> config network cellular sim failover script
Run schedule
Run the automation action on a schedule.
- Data type: string
- Configuration
- Optional
CLI: (cli)> config network cellular sim failover schedule
Run on start
Run the automation action immediately after boot up or the automation is added.
- Data type: boolean
- Default:
true - Configuration
CLI: (cli)> config network cellular sim failover run-on-start
