Electric Vehicle State
Electric vehicle state parameters provide real-time charging status, battery information, and consumption metrics. These fields are read-only and automatically updated from the manufacturer’s API.State data refresh frequency depends on the manufacturer’s API. Tesla updates every 5-10 minutes when active, others may vary.
Charging Status
Indicates whether the charging cable is connected to the vehicle.Example:
trueIndicates whether charging is currently in progress.A vehicle can be plugged in but not actively charging (waiting for low-price period, charge limit reached, etc.).Example:
trueIndicates that the target charge level has been reached and charging has stopped.Example:
trueCurrent charging rate in Watts.Returns
0 when not charging.Example: 11050Estimated time to reach target charge level in seconds.Returns
0 when not charging or fully charged.Example: 6250 (approximately 1 hour 44 minutes)Timestamp when the charge state was last updated from the manufacturer’s API.Use this to determine data freshness.Example:
2023-03-22T13:54:34.000ZBattery Information
Current battery charge level in percent.Example:
90Range: 0-100Total battery capacity in kilowatt-hours.Example:
80Estimated remaining driving range in kilometers based on current battery level.May not be available for all vehicle models.Example:
390Energy Consumption
Energy consumption for charging in the previous day in kWh.Example:
32.5Energy consumption for charging in the previous week in kWh.Example:
120.1Energy consumption for charging in the previous month in kWh.Example:
451.3Timestamp when consumption data was last calculated.Example:
2023-03-22T13:54:34.000ZUsage Examples
Get Vehicle State
Charging States Explained
- Charging
- Connected, Not Charging
- Fully Charged
- Not Connected
Conditions:
is_plugged_in: true, is_charging: true, charge_rate_w > 0Vehicle is actively drawing power and charging the battery.Typical Duration: 1-8 hours depending on battery size and charge rateBest Practices
Data Polling
Data Polling
- Poll vehicle state every 5-10 minutes when plugged in
- Reduce polling to 15-30 minutes when not plugged in
- Check
charge_state_last_updated_atto avoid unnecessary calls - Show last update timestamp to users for transparency
Range Display
Range Display
- Display
driving_rangeprominently for user awareness - Consider range may vary based on driving conditions
- Alert users when range drops below critical threshold (< 50 km)
- Compare range to typical daily driving needs
Charge Monitoring
Charge Monitoring
- Convert
charge_time_remainingfrom seconds to hours:minutes for display - Show charge rate in kW (divide
charge_rate_wby 1000) - Highlight when vehicle is waiting for optimal charging time
- Provide context for why charging may be paused
Consumption Tracking
Consumption Tracking
- Track consumption trends over time
- Calculate estimated costs based on energy contract prices
- Compare consumption to driving patterns
- Identify opportunities for further optimization
EV Attributes
Writable parameters and configuration
Dashboard Integration
Building end-user dashboards
Energy Contracts
Energy pricing for optimization
Buildings
Building parameters reference
