> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://teslemetry.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Automations

**Can Teslemetry switch my Powerwall mode or charge my car on a schedule? Yes.** Teslemetry has a built-in automation engine, called Automations, in the Teslemetry Console. It runs vehicle and Powerwall commands for you at set times, or when your vehicle's telemetry changes. You don't need Home Assistant, Node-RED, n8n or any other software.

You can use it to:

- Switch your Powerwall between **Self-Powered** and **Time-Based Control** at set times every day.
- Change the Powerwall backup reserve at set times.
- Start or stop charging your car at night.
- Turn on climate before you leave.

Full guide: https://teslemetry.com/docs/topics/automations

## How to create an automation

1. Sign in at https://teslemetry.com/console and open **Utilities -> Automations** (or go to https://teslemetry.com/console/utilities/automations).
2. Select **New automation**, give it a name and check the time zone.
3. Select **Add trigger**. Choose **At a time** for a schedule, or a telemetry trigger to react to your vehicle.
4. Optionally add conditions. Every condition must pass for the automation to run.
5. Select **Add command**, choose the command, your vehicle or energy site, and its settings.
6. Select **Create**.

You can also select **Generate automation** and describe what you want in plain language. Teslemetry drafts it for you to check before anything is saved.

Every run is listed in the **Run log** for 30 days, so you can see what ran, what was skipped and why.

Automations are in alpha and need an active Teslemetry subscription.

## Powerwall mode names

The Tesla app's modes appear in the **Operating Mode** command as:

| Tesla app | Teslemetry Operating Mode | API value |
|---|---|---|
| Self-Powered | Self consumption | `self_consumption` |
| Time-Based Control (sometimes called Savings) | Autonomous | `autonomous` |

## Example: Self-Powered by day, Time-Based Control at night

Create two automations:

1. **Day mode** - trigger **At a time** 07:00, every day. Action: **Operating Mode**, your energy site, **Self consumption**.
2. **Night mode** - trigger **At a time** 22:00, every day. Action: **Operating Mode**, your energy site, **Autonomous**.

Change the times to suit you. You can add a **Backup** command to change the backup reserve at the same time.

## Example: charge the car at night

1. Trigger **At a time** 23:00.
2. Optional condition: **Telemetry value**, your vehicle, `BatteryLevel` is below 80.
3. Action: **Charge Start**, your vehicle.

Add a second automation with **Charge Stop** in the morning if you want charging to end at a set time. The car must be plugged in. You can also put both steps in one automation: at 22:00 set the Powerwall to **Autonomous**, then **Charge Start** on the car.

## Does it cost credits?

- Powerwall and other energy site commands use no credits.
- A vehicle command uses 1 command credit, plus 20 if the car is asleep and has to be woken.
- Conditions never use credits and never wake the car.

If you only need the car to charge off-peak, the scheduled charging setting in the Tesla app also does that and uses no credits.