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

# Electric Vehicle Attributes

> Writable parameters for configuring electric vehicle charging

# Electric Vehicle Attributes

Electric vehicle attributes are writable parameters that control charging behavior, optimization settings, and user preferences for charge limits and schedules.

## Required Parameters

<ParamField body="owner" type="string (UUID)" required>
  User ID that owns this electric vehicle.

  **Example:** `016b78a7-0c7c-4241-a277-015c3ad3cb90`

  **Writable:** No (set at device creation)
</ParamField>

## Device Model

<ParamField body="device_model" type="object">
  The device model assigned to this electric vehicle. Set during onboarding.

  **Writable:** No (set at device creation)

  <Expandable title="device_model fields">
    <ParamField body="manufacturer" type="string">
      Manufacturer name. **Example:** `Tesla`
    </ParamField>

    <ParamField body="model" type="string">
      Model name. **Example:** `Model 3`
    </ParamField>

    <ParamField body="year" type="integer">
      Model year, if available. **Example:** `2023`
    </ParamField>

    <ParamField body="device_type" type="object">
      <Expandable title="device_type fields">
        <ParamField body="short_name" type="string">
          Machine-readable device type identifier. **Example:** `ev`
        </ParamField>

        <ParamField body="long_name" type="string">
          Human-readable device type label. **Example:** `Electric Vehicle`
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Optimization Control

<ParamField body="is_smart_optimization_active" type="boolean">
  Flag indicating whether Podero's smart optimization is actively controlling charging.

  Set to `false` to pause optimization without disconnecting the vehicle.

  **Example:** `true`

  **Writable:** Yes
</ParamField>

## Charge Limits

<ParamField body="charge_target_max" type="integer">
  OEM-detected hard cap on the battery charge level in percent. Set automatically by the system based on the vehicle's detected charge limit — `null` means no cap has been detected yet.

  **Example:** `80`

  **Range:** 0-100

  **Writable:** No (system-managed)
</ParamField>

## Charge Policy

<AccordionGroup>
  <Accordion title="Charge Policy Overview">
    Charge policies allow users to specify a required charge level by a specific deadline, ensuring the vehicle is ready for planned trips.
  </Accordion>
</AccordionGroup>

<ParamField body="is_charge_policy_enabled" type="boolean">
  Flag indicating whether a charge policy is active.

  **Example:** `true`

  **Writable:** Yes
</ParamField>

<ParamField body="charge_deadline_at" type="time">
  Time of day by which the specified charge level must be reached (HH:MM format, 24h).

  Used in combination with `minimum_charge_limit` to ensure the vehicle is ready by a specific time each day.

  **Example:** `07:00`

  **Writable:** Yes
</ParamField>

<ParamField body="minimum_charge_limit" type="integer">
  Minimum charge level in percent that must be reached by the deadline specified in `charge_deadline_at`.

  This overrides normal charging optimization to prioritize meeting the deadline.

  **Example:** `75`

  **Range:** 0-100

  **Writable:** Yes
</ParamField>

<ParamField body="charge_policy_last_updated_at" type="datetime">
  Timestamp when the charge policy was last updated. Read-only, automatically managed.

  **Example:** `2023-03-22T13:54:34.000Z`

  **Writable:** No (system-managed)
</ParamField>

## HEMS Configuration

When a user also has a solar inverter, the EV can be set to charge reactively based on solar production and grid export signals. The following thresholds control when charging starts and stops.

<ParamField body="hems_min_export_to_start_w" type="integer">
  Minimum grid export in Watts required to start charging. Charging begins when the household is exporting at least this much power to the grid.

  **Example:** `2000`

  **Writable:** Yes
</ParamField>

<ParamField body="hems_max_import_before_stopping_w" type="integer">
  Maximum grid import in Watts before charging stops. If the household starts importing more than this from the grid, EV charging is paused.

  **Example:** `4000`

  **Writable:** Yes
</ParamField>

<ParamField body="hems_min_production_to_start_w" type="integer">
  Minimum solar production in Watts required to start charging.

  **Example:** `3000`

  **Writable:** Yes
</ParamField>

<ParamField body="hems_min_production_before_stopping_w" type="integer">
  Minimum solar production in Watts required to keep charging. If production drops below this, charging stops.

  **Example:** `2000`

  **Writable:** Yes
</ParamField>

## Usage Examples

### Configure Daily Charging

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}/electric-vehicles/{device_id}' \
    -H 'Authorization: Bearer {auth_token}' \
    -H 'Content-Type: application/json' \
    -d '{
      "is_smart_optimization_active": true,
      "is_charge_policy_enabled": true,
      "charge_deadline_at": "07:00",
      "minimum_charge_limit": 80
    }'
  ```

  ```python Python theme={null}
  response = requests.put(
      f'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}/electric-vehicles/{device_id}',
      headers={
          'Authorization': f'Bearer {auth_token}',
          'Content-Type': 'application/json'
      },
      json={
          'is_smart_optimization_active': True,
          'is_charge_policy_enabled': True,
          'charge_deadline_at': '07:00',
          'minimum_charge_limit': 80
      }
  )
  ```
</CodeGroup>

### Set Charge Deadline for Trip

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT \
    'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}/electric-vehicles/{device_id}' \
    -H 'Authorization: Bearer {auth_token}' \
    -H 'Content-Type: application/json' \
    -d '{
      "is_charge_policy_enabled": true,
      "charge_deadline_at": "07:00",
      "minimum_charge_limit": 90
    }'
  ```

  ```python Python theme={null}
  response = requests.put(
      f'https://app.podero.com/api/partners/v2.0/org/{org_id}/users/{user_id}/electric-vehicles/{device_id}',
      headers={
          'Authorization': f'Bearer {auth_token}',
          'Content-Type': 'application/json'
      },
      json={
          'is_charge_policy_enabled': True,
          'charge_deadline_at': '07:00',
          'minimum_charge_limit': 90
      }
  )
  ```
</CodeGroup>

## Best Practices

<AccordionGroup>
  <Accordion title="Charge Policies">
    * Use charge policies for planned trips requiring specific charge levels
    * Set deadlines with enough buffer time for charging completion
    * Clear charge policies after the deadline passes
    * Monitor `charge_policy_last_updated_at` to track changes
  </Accordion>

  <Accordion title="Optimization">
    * Keep `is_smart_optimization_active` enabled for cost savings
    * Optimization works best with spot hourly energy pricing
    * Vehicle will always respect deadlines and minimum charge requirements
  </Accordion>
</AccordionGroup>

## Charge Policy Scenarios

<Tabs>
  <Tab title="Daily Commute">
    **Scenario:** User needs 70% charge by 7 AM every weekday

    ```python theme={null}
    update_vehicle({
        'is_charge_policy_enabled': True,
        'charge_deadline_at': '07:00',
        'minimum_charge_limit': 70,
    })
    ```
  </Tab>

  <Tab title="Weekend Trip">
    **Scenario:** User needs full charge for long trip on Saturday morning

    ```python theme={null}
    update_vehicle({
        'is_charge_policy_enabled': True,
        'charge_deadline_at': '08:00',
        'minimum_charge_limit': 100,
    })

    # Clear after trip
    # ... after trip completes ...
    update_vehicle({
        'is_charge_policy_enabled': False,
    })
    ```
  </Tab>

  <Tab title="Flexible Charging">
    **Scenario:** No specific deadline, optimize for lowest cost

    ```python theme={null}
    # Disable policy, rely on optimization
    update_vehicle({
        'is_charge_policy_enabled': False,
        'is_smart_optimization_active': True,
    })
    ```
  </Tab>
</Tabs>

<CardGroup cols={2}>
  <Card title="Electric Vehicle State" icon="chart-line" href="/partner-api/reference/electric-vehicles/state">
    Read-only state data and current readings
  </Card>

  <Card title="Setting Preferences" icon="sliders" href="/partner-api/user-journeys/end-user/setting-preferences">
    User workflow for configuring charging
  </Card>

  <Card title="Device Onboarding" icon="plug" href="/partner-api/user-journeys/end-user/device-onboarding">
    Connecting electric vehicles
  </Card>
</CardGroup>
