> ## Documentation Index
> Fetch the complete documentation index at: https://docs.amps.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Return to self-consumption

> Put a battery back into its own self-consumption mode with auto.balance.

Send `auto.balance` to hand control back to the battery. It stores surplus solar and covers the home's load on its own, using the manufacturer's self-consumption mode.

## 1. Check the battery supports it

The battery must list `auto.balance` in `commands`. It takes no parameters and can't be windowed.

```bash theme={null}
curl https://api.amps.ai/battery/device_abc123 \
  -H "x-api-key: $AMPS_API_KEY"
```

```json theme={null}
{
  "success": true,
  "data": {
    "id": "device_abc123",
    "state": { "currentMode": "charge" },
    "commands": {
      "auto.balance": { "parameters": {}, "execution": ["immediate", "scheduled"] },
      "auto.reserve": { "parameters": {}, "execution": ["immediate", "scheduled"] },
      "auto.export": { "parameters": {}, "execution": ["immediate", "scheduled"] }
    }
  }
}
```

## 2. Send the command

```bash theme={null}
curl -X POST https://api.amps.ai/battery/device_abc123 \
  -H "x-api-key: $AMPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "action": { "command": "auto.balance" } }'
```

```json theme={null}
{
  "success": true,
  "data": {
    "id": "action_aHjkkbBGW4",
    "command": "auto.balance",
    "parameters": null,
    "state": "acknowledged",
    "links": { "self": "/actions/action_aHjkkbBGW4" }
  }
}
```

The API returns `202 Accepted`. Add a `start` to switch modes later, for example after a morning charge. Sending a parameter or an `end` returns `422 DEVICE_NOT_CAPABLE`.

The other auto modes use the same body:

| Command | Use it to |
| - | - |
| `auto.balance` | Use solar in the home first. |
| `auto.reserve` | Keep charge in reserve for a grid outage. |
| `auto.export` | Favour exporting to the grid. |

## 3. Confirm

Listen for `push.completed` on your [webhook](/guides/webhooks). Once applied, `GET /battery/device_abc123` reports `state.currentMode: "auto.balance"`.

## Next steps

<CardGroup cols={2}>
  <Card title="Charge in a cheap-rate window" icon="moon" href="/cookbooks/battery/charge-in-window">
    Charge overnight, then balance by day.
  </Card>

  <Card title="Push" icon="arrow-up" href="/guides/push">
    Action lifecycle and timing.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.