bimmer_connected.vehicle
¶
The bimmer_connected.vehicle
module contains all data & parsers for a vehicle.
bimmer_connected.vehicle.vehicle
¶
Models state and remote services of one vehicle.
-
class
bimmer_connected.vehicle.vehicle.
LscType
(*args, **kwds)[source]¶ Known Values for lsc_type field.
Not really sure, what this value really contains.
-
ACTIVATED
= 'ACTIVATED'¶
-
NOT_CAPABLE
= 'NOT_CAPABLE'¶
-
NOT_SUPPORTED
= 'NOT_SUPPORTED'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
-
class
bimmer_connected.vehicle.vehicle.
MyBMWVehicle
(account: MyBMWAccount, vehicle_base: dict, vehicle_state: Optional[dict, None] = None, charging_settings: Optional[dict, None] = None, fetched_at: Optional[datetime.datetime, None] = None)[source]¶ Models state and remote services of one vehicle.
Parameters: - account – MyBMW account this vehicle belongs to
- attributes – attributes of the vehicle as provided by the server
-
available_attributes
¶ Get the list of non-drivetrain attributes available for this vehicle.
-
brand
¶ Get the car brand.
-
static
combine_data
(account: MyBMWAccount, vehicle_base: dict, vehicle_state: Optional[dict, None], charging_settings: Optional[dict, None], fetched_at: Optional[datetime.datetime, None] = None) → Dict[source]¶ Combine API responses and additional information to a single dictionary.
-
drive_train
¶ Get the type of drive train of the vehicle.
-
drive_train_attributes
¶ Get list of attributes available for the drive train of the vehicle.
The list of available attributes depends if on the type of drive train. Some attributes only exist for electric/hybrid vehicles, others only if you have a combustion engine. Depending on the state of the vehicle, some of the attributes might still be None.
-
get_vehicle_image
(direction: bimmer_connected.vehicle.vehicle.VehicleViewDirection) → bytes[source]¶ Get a rendered image of the vehicle.
:returns bytes containing the image in PNG format.
-
has_combustion_drivetrain
¶ Return True if vehicle is equipped with an internal combustion engine.
In this case we can get the state of the gas tank.
-
has_electric_drivetrain
¶ Return True if vehicle is equipped with a high voltage battery.
In this case we can get the state of the battery in the state attributes.
-
is_charging_plan_supported
¶ Return True if charging profile is available and can be set via API.
-
is_lsc_enabled
¶ Return True if LastStateCall is enabled (vehicle automatically updates API).
-
is_remote_charge_start_enabled
¶ Return True if charging can be started via the API.
-
is_remote_charge_stop_enabled
¶ Return True if charging can be stop via the API.
-
is_remote_climate_start_enabled
¶ Return True if AC/ventilation can be started via the API.
-
is_remote_climate_stop_enabled
¶ Return True if AC/ventilation can be stopped via the API.
-
is_remote_horn_enabled
¶ Return True if the horn can be activated via the API.
-
is_remote_lights_enabled
¶ Return True if the lights can be activated via the API.
-
is_remote_lock_enabled
¶ Return True if vehicle can be locked via the API.
-
is_remote_sendpoi_enabled
¶ Return True if POIs can be set via the API.
-
is_remote_set_ac_limit_enabled
¶ Return True if AC limit can be set via the API.
-
is_remote_set_target_soc_enabled
¶ Return True if Target SoC can be set via the API.
-
is_remote_unlock_enabled
¶ Return True if POIs can be unlocked via the API.
-
is_vehicle_active
¶ Deprecated, always returns False.
Check if the vehicle is active/moving.
If the vehicle was active/moving at the time of the last status update, current position is not available.
-
is_vehicle_tracking_enabled
¶ Return True if vehicle finder is enabled in vehicle.
-
lsc_type
¶ Get the lscType of the vehicle.
Not really sure what that value really means. If it is NOT_CAPABLE, that probably means that the vehicle state will not contain much data.
-
mileage
¶ Get the mileage of the vehicle.
-
name
¶ Get the name of the vehicle.
-
timestamp
¶ Get the timestamp when the data was recorded.
-
update_state
(vehicle_base: dict, vehicle_state: Optional[dict, None] = None, charging_settings: Optional[dict, None] = None, fetched_at: Optional[datetime.datetime, None] = None) → None[source]¶ Update the state of a vehicle.
-
vin
¶ Get the VIN (vehicle identification number) of the vehicle.
bimmer_connected.vehicle.remote_services
¶
Trigger remote services on a vehicle.
-
class
bimmer_connected.vehicle.remote_services.
ExecutionState
(*args, **kwds)[source]¶ Enumeration of possible states of the execution of a remote service.
-
DELIVERED
= 'DELIVERED'¶
-
ERROR
= 'ERROR'¶
-
EXECUTED
= 'EXECUTED'¶
-
IGNORED
= 'IGNORED'¶
-
INITIATED
= 'INITIATED'¶
-
PENDING
= 'PENDING'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
-
class
bimmer_connected.vehicle.remote_services.
RemoteServiceStatus
(response: dict, event_id: Optional[str, None] = None)[source]¶ Wraps the status of the execution of a remote service.
-
class
bimmer_connected.vehicle.remote_services.
RemoteServices
(vehicle: MyBMWVehicle)[source]¶ Trigger remote services on a vehicle.
-
trigger_charge_start
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the vehicle to start charging.
-
trigger_charge_stop
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the vehicle to stop charging.
-
trigger_charging_profile_update
(charging_mode: Optional[bimmer_connected.vehicle.charging_profile.ChargingMode, None] = None, precondition_climate: Optional[bool, None] = None) → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Update the charging profile on the vehicle.
-
trigger_charging_settings_update
(target_soc: Optional[int, None] = None, ac_limit: Optional[int, None] = None) → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Update the charging settings on the vehicle.
-
trigger_remote_air_conditioning
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the air conditioning to start.
-
trigger_remote_air_conditioning_stop
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the air conditioning to stop.
-
trigger_remote_door_lock
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the vehicle to lock its doors.
-
trigger_remote_door_unlock
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the vehicle to unlock its doors.
-
trigger_remote_horn
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the vehicle to sound its horn.
-
trigger_remote_light_flash
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the vehicle to flash its headlights.
-
trigger_remote_service
(service_id: bimmer_connected.vehicle.remote_services.Services, params: Optional[Dict, None] = None, data: Any = None, refresh: bool = False) → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger a remote service and wait for the result.
-
trigger_remote_vehicle_finder
() → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Trigger the vehicle finder.
-
trigger_send_poi
(poi: Union[bimmer_connected.models.PointOfInterest, Dict]) → bimmer_connected.vehicle.remote_services.RemoteServiceStatus[source]¶ Send a PointOfInterest to the vehicle.
Parameters: poi – A PointOfInterest containing at least ‘lat’ and ‘lon’ and optionally ‘name’, ‘street’, ‘city’, ‘postalCode’, ‘country’
-
-
class
bimmer_connected.vehicle.remote_services.
Services
(*args, **kwds)[source]¶ Enumeration of possible services to be executed.
-
AIR_CONDITIONING
= 'climate-now'¶
-
CHARGE_START
= 'start-charging'¶
-
CHARGE_STOP
= 'stop-charging'¶
-
CHARGING_PROFILE
= 'CHARGING_PROFILE'¶
-
CHARGING_SETTINGS
= 'CHARGING_SETTINGS'¶
-
DOOR_LOCK
= 'door-lock'¶
-
DOOR_UNLOCK
= 'door-unlock'¶
-
HORN
= 'horn-blow'¶
-
LIGHT_FLASH
= 'light-flash'¶
-
SEND_POI
= 'SEND_POI'¶
-
VEHICLE_FINDER
= 'vehicle-finder'¶
-
bimmer_connected.vehicle.charging_profile
¶
Models the charging profiles of a vehicle.
-
class
bimmer_connected.vehicle.charging_profile.
ChargingMode
(*args, **kwds)[source]¶ Charging mode of electric vehicle.
-
DELAYED_CHARGING
= 'DELAYED_CHARGING'¶
-
IMMEDIATE_CHARGING
= 'IMMEDIATE_CHARGING'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
-
class
bimmer_connected.vehicle.charging_profile.
ChargingPreferences
(*args, **kwds)[source]¶ Charging preferences of electric vehicle.
-
CHARGING_WINDOW
= 'CHARGING_WINDOW'¶
-
NO_PRESELECTION
= 'NO_PRESELECTION'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
-
class
bimmer_connected.vehicle.charging_profile.
ChargingProfile
(is_pre_entry_climatization_enabled: bool, timer_type: bimmer_connected.vehicle.charging_profile.TimerTypes, departure_times: List[bimmer_connected.vehicle.charging_profile.DepartureTimer], preferred_charging_window: bimmer_connected.vehicle.charging_profile.ChargingWindow, charging_preferences: bimmer_connected.vehicle.charging_profile.ChargingPreferences, charging_mode: bimmer_connected.vehicle.charging_profile.ChargingMode, ac_current_limit: Optional[int, None] = None, ac_available_limits: Optional[list, None] = None, charging_preferences_service_pack: Optional[str, None] = None)[source]¶ Models the charging profile of a vehicle.
-
ac_available_limits
= None¶ Available AC limits to be selected.
-
ac_current_limit
= None¶ Returns the ac current limit.
-
charging_mode
= None¶ Returns the preferred charging mode.
-
charging_preferences
= None¶ Returns the preferred charging preferences.
-
charging_preferences_service_pack
= None¶ Service Pack required for remote service format.
-
departure_times
= None¶ List of timers.
-
format_for_remote_service
() → dict[source]¶ Format current charging profile as base to be sent to remote service.
-
is_pre_entry_climatization_enabled
= None¶ Get status of pre-entry climatization.
-
preferred_charging_window
= None¶ Returns the preferred charging window.
-
timer_type
= None¶ Returns the current timer plan type.
-
-
class
bimmer_connected.vehicle.charging_profile.
ChargingWindow
(window_dict: dict)[source]¶ A charging window.
-
end_time
¶ End of the charging window.
-
start_time
¶ Start of the charging window.
-
bimmer_connected.vehicle.doors_windows
¶
Models the state of a vehicle.
-
class
bimmer_connected.vehicle.doors_windows.
DoorsAndWindows
(door_lock_state: bimmer_connected.vehicle.doors_windows.LockState = <LockState.UNKNOWN: 'UNKNOWN'>, lids: List[bimmer_connected.vehicle.doors_windows.Lid] = <factory>, windows: List[bimmer_connected.vehicle.doors_windows.Window] = <factory>)[source]¶ Provides an accessible version of properties.doorsAndWindows.
-
all_lids_closed
¶ Check if all lids are closed.
-
all_windows_closed
¶ Check if all windows are closed.
-
door_lock_state
= 'UNKNOWN'¶ Get state of the door locks.
-
lids
= None¶ All lids (doors+hood+trunk) of the car.
-
open_lids
¶ Get all open lids of the car.
-
open_windows
¶ Get all open windows of the car.
-
windows
= None¶ All windows (doors+sunroof) of the car.
-
-
class
bimmer_connected.vehicle.doors_windows.
Lid
(name: str, state: str)[source]¶ A lid of the vehicle.
Lids are: Doors + Trunk + Hatch
-
is_closed
¶ Check if the lid is closed.
-
name
= None¶ name of the lid
-
-
class
bimmer_connected.vehicle.doors_windows.
LidState
(*args, **kwds)[source]¶ Possible states of the hatch, trunk, doors, windows, sun roof.
-
CLOSED
= 'CLOSED'¶
-
INTERMEDIATE
= 'INTERMEDIATE'¶
-
INVALID
= 'INVALID'¶
-
OPEN
= 'OPEN'¶
-
OPEN_TILT
= 'OPEN_TILT'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
bimmer_connected.vehicle.fuel_and_battery
¶
Generals models used for bimmer_connected.
-
class
bimmer_connected.vehicle.fuel_and_battery.
ChargingState
(*args, **kwds)[source]¶ Charging state of electric vehicle.
-
CHARGING
= 'CHARGING'¶
-
COMPLETE
= 'COMPLETE'¶
-
DEFAULT
= 'DEFAULT'¶
-
ERROR
= 'ERROR'¶
-
FINISHED_FULLY_CHARGED
= 'FINISHED_FULLY_CHARGED'¶
-
FINISHED_NOT_FULL
= 'FINISHED_NOT_FULL'¶
-
FULLY_CHARGED
= 'FULLY_CHARGED'¶
-
INVALID
= 'INVALID'¶
-
NOT_CHARGING
= 'NOT_CHARGING'¶
-
PLUGGED_IN
= 'PLUGGED_IN'¶
-
TARGET_REACHED
= 'TARGET_REACHED'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
WAITING_FOR_CHARGING
= 'WAITING_FOR_CHARGING'¶
-
-
class
bimmer_connected.vehicle.fuel_and_battery.
FuelAndBattery
(remaining_range_fuel: Optional[bimmer_connected.models.ValueWithUnit, None] = ValueWithUnit(value=None, unit=None), remaining_range_electric: Optional[bimmer_connected.models.ValueWithUnit, None] = ValueWithUnit(value=None, unit=None), remaining_range_total: Optional[bimmer_connected.models.ValueWithUnit, None] = ValueWithUnit(value=None, unit=None), remaining_fuel: Optional[bimmer_connected.models.ValueWithUnit, None] = ValueWithUnit(value=None, unit=None), remaining_fuel_percent: Optional[int, None] = None, remaining_battery_percent: Optional[int, None] = None, charging_status: Optional[bimmer_connected.vehicle.fuel_and_battery.ChargingState, None] = None, charging_start_time_no_tz: Optional[datetime.datetime, None] = None, charging_end_time: Optional[datetime.datetime, None] = None, is_charger_connected: bool = False, charging_target: Optional[int, None] = None, account_timezone: datetime.timezone = datetime.timezone.utc)[source]¶ Provides an accessible version of status.FuelAndBattery.
-
account_timezone
= datetime.timezone.utc¶
-
charging_end_time
= None¶ The estimated time the vehicle will have finished charging.
-
charging_start_time
¶ The planned time the vehicle will start charging.
-
charging_start_time_no_tz
= None¶ The planned time the vehicle will start charging without time zone information.
-
charging_status
= None¶ Charging state of the vehicle.
-
charging_target
= None¶ State of charging target in percent.
-
classmethod
from_vehicle_data
(vehicle_data: Dict)[source]¶ Create the class based on vehicle data from API.
-
is_charger_connected
= False¶ Get status of the connection
-
remaining_battery_percent
= None¶ State of charge of the high voltage battery in percent.
-
remaining_fuel
= ValueWithUnit(value=None, unit=None)¶ Get the remaining fuel of the vehicle.
-
remaining_fuel_percent
= None¶ State of charge of the high voltage battery in percent.
-
remaining_range_electric
= ValueWithUnit(value=None, unit=None)¶ Get the remaining range of the vehicle on electricity.
-
remaining_range_fuel
= ValueWithUnit(value=None, unit=None)¶ Get the remaining range of the vehicle on fuel.
-
remaining_range_total
= ValueWithUnit(value=None, unit=None)¶ Get the total remaining range of the vehicle (fuel + electricity, if available).
-
bimmer_connected.vehicle.location
¶
Generals models used for bimmer_connected.
-
class
bimmer_connected.vehicle.location.
VehicleLocation
(location: Optional[bimmer_connected.models.GPSPosition, None] = None, heading: Optional[int, None] = None, vehicle_update_timestamp: Optional[datetime.datetime, None] = None, account_region: Optional[bimmer_connected.const.Regions, None] = None, remote_service_position: Optional[Dict, None] = None)[source]¶ The current position of a vehicle.
-
account_region
= None¶
-
classmethod
from_vehicle_data
(vehicle_data: Dict)[source]¶ Create the class based on vehicle data from API.
-
heading
= None¶ The last known heading/direction of the vehicle.
-
location
= None¶ The last known position of the vehicle.
-
remote_service_position
= None¶
-
set_remote_service_position
(remote_service_dict: Dict)[source]¶ Store remote service position returned from vehicle finder service.
-
vehicle_update_timestamp
= None¶
-
bimmer_connected.vehicle.reports
¶
Models the state of a vehicle.
-
class
bimmer_connected.vehicle.reports.
CheckControlMessage
(description_short: str, description_long: Optional[str, None], state: bimmer_connected.vehicle.reports.CheckControlStatus)[source]¶ Check control message sent from the server.
-
class
bimmer_connected.vehicle.reports.
CheckControlMessageReport
(messages: List[bimmer_connected.vehicle.reports.CheckControlMessage] = <factory>, has_check_control_messages: bool = False)[source]¶ Parse and summarizes check control messages (e.g. low tire pressure).
-
has_check_control_messages
= False¶ Indicate if check control messages are present.
-
messages
= None¶ List of check control messages.
-
-
class
bimmer_connected.vehicle.reports.
CheckControlStatus
(*args, **kwds)[source]¶ Status of the condition based services.
-
CRITICAL
= 'CRITICAL'¶
-
HIGH
= 'HIGH'¶
-
LOW
= 'LOW'¶
-
MEDIUM
= 'MEDIUM'¶
-
OK
= 'OK'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
-
class
bimmer_connected.vehicle.reports.
ConditionBasedService
(service_type: str, state: bimmer_connected.vehicle.reports.ConditionBasedServiceStatus, due_date: Optional[datetime.datetime, None], due_distance: bimmer_connected.models.ValueWithUnit)[source]¶ Entry in the list of condition based services.
-
class
bimmer_connected.vehicle.reports.
ConditionBasedServiceReport
(messages: List[bimmer_connected.vehicle.reports.ConditionBasedService] = <factory>, is_service_required: bool = False)[source]¶ Parse and summarizes condition based services (e.g. next oil service).
-
is_service_required
= False¶ Indicate if a service is required.
-
messages
= None¶ List of the condition based services.
-
-
class
bimmer_connected.vehicle.reports.
ConditionBasedServiceStatus
(*args, **kwds)[source]¶ Status of the condition based services.
-
OK
= 'OK'¶
-
OVERDUE
= 'OVERDUE'¶
-
PENDING
= 'PENDING'¶
-
UNKNOWN
= 'UNKNOWN'¶
-
-
class
bimmer_connected.vehicle.reports.
Headunit
(idrive_version: str = '', headunit_type: str = '', software_version: str = '')[source]¶ Parse and summarizes headunit hard/software versions.
-
headunit_type
= ''¶ Type of headunit.
-
idrive_version
= ''¶ IDRIVE generation.
-
software_version
= ''¶ Current software revision of vehicle
-