bimmer-connected


Namebimmer-connected JSON
Version 0.15.0 PyPI version JSON
download
home_pagehttps://github.com/bimmerconnected/bimmer_connected
SummaryLibrary to read data from the BMW Connected Drive portal
upload_time2024-03-29 17:10:27
maintainerNone
docs_urlNone
authorgerard33, rikroe
requires_python>=3.8
licenseApache-2
keywords bmw connected drive home automation
VCS
bugtrack_url
requirements httpx pycryptodome pyjwt Pillow
Travis-CI No Travis.
coveralls test coverage
            bimmer_connected
================

.. image:: https://badge.fury.io/py/bimmer-connected.svg
    :target: https://pypi.org/project/bimmer-connected
.. image:: https://github.com/bimmerconnected/bimmer_connected/actions/workflows/test.yml/badge.svg?branch=master
    :target: https://github.com/bimmerconnected/bimmer_connected/actions/workflows/test.yml?query=branch%3Amaster
.. image:: https://readthedocs.org/projects/bimmer-connected/badge/?version=latest
    :target: https://bimmer-connected.readthedocs.io/en/stable/?badge=latest
.. image:: https://codecov.io/gh/bimmerconnected/bimmer_connected/branch/master/graph/badge.svg?token=qNT50j82f6
    :target: https://codecov.io/gh/bimmerconnected/bimmer_connected
.. image:: https://static.pepy.tech/badge/bimmer_connected/week
    :target: https://pepy.tech/badge/bimmer-connected/week
.. image:: https://static.pepy.tech/badge/bimmer_connected/month
    :target: https://pepy.tech/project/bimmer-connected/month
.. image:: https://static.pepy.tech/badge/bimmer_connected
    :target: https://pepy.tech/project/bimmer-connected    
    

This is a simple library to query and control the status of your BMW or Mini vehicle from
the MyBMW portal.


Installation
============
:code:`bimmer_connected` is tested against **Python 3.8 or above**. Just install the latest release from `PyPI <https://pypi.org/project/bimmer-connected/>`_ 
using :code:`pip3 install --upgrade bimmer_connected`. 

Alternatively, clone the project and execute :code:`pip install -e .` to install the current 
:code:`master` branch.

.. note::
    If you want to connect to a **chinese** server, you need to install the :code:`[china]` extra, e.g. :code:`pip3 install --upgrade bimmer_connected[china]`.

Usage
=====
While this library is mainly written to be included in `Home Assistant <https://www.home-assistant.io/integrations/bmw_connected_drive/>`_, it can be use on its own.

After installation, execute :code:`bimmerconnected` from command line for usage instruction
or see the full `CLI documentation <http://bimmer-connected.readthedocs.io/en/stable/#cli>`_.

Please be aware that :code:`bimmer_connected` is an :code:`async` library when using it in Python code.
The description of the :code:`modules` can be found in the `module documentation 
<http://bimmer-connected.readthedocs.io/en/stable/#module>`_.

Example in an :code:`asyncio` event loop
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::

    import asyncio
    from bimmer_connected.account import MyBMWAccount
    from bimmer_connected.api.regions import Regions

    async def main():
        account = MyBMWAccount(USERNAME, PASSWORD, Regions.REST_OF_WORLD)
        await account.get_vehicles()
        vehicle = account.get_vehicle(VIN)
        print(vehicle.brand, vehicle.name, vehicle.vin)
        
        result = await vehicle.remote_services.trigger_remote_light_flash()
        print(result.state)

    asyncio.run(main())

    
Example in non-async code
^^^^^^^^^^^^^^^^^^^^^^^^^^

::

    import asyncio
    from bimmer_connected.account import MyBMWAccount
    from bimmer_connected.api.regions import Regions


    account = MyBMWAccount(USERNAME, PASSWORD, Regions.REST_OF_WORLD)
    asyncio.run(account.get_vehicles())
    vehicle = account.get_vehicle(VIN)
    print(vehicle.brand, vehicle.name, vehicle.vin)
        
    result = asyncio.run(vehicle.remote_services.trigger_remote_light_flash())
    print(result.state)


Compatibility
=============
This works with BMW (and Mini) vehicles with a MyBMW account.
So far it is tested on vehicles with a 'MGU', 'NBTEvo', 'EntryEvo', 'NBT', or 'EntryNav'
navigation system. If you have any trouble with other navigation systems, please create 
an issue with your server responses (see next section).

To use this library, your BMW (or Mini) must have the remote services enabled for your vehicle. 
You might need to book this in the MyBMW/Mini Connected portal and this might cost 
some money. In addition to that you need to enable the Remote Services in your infotainment 
system in the vehicle.

Different models of vehicles and infotainment systems result in different types of attributes
provided by the server. So the experience with the library will certainly vary across the different 
vehicle models.

Data Contributions
==================
If some features do not work for your vehicle, we would need the data
returned form the server to analyse this and potentially extend the code.
Different models and head unit generations lead to different responses from
the server.

If you want to contribute your data, perform the following steps:

::

    # get the latest version of the library
    pip3 install --upgrade bimmer_connected

    # run the fingerprint function
    bimmerconnected fingerprint <username> <password> <region>

This will create a set of log files in the "vehicle_fingerprint" folder.
Before sending the data to anyone please **check for any personal data** such as **dealer name** or **country**. 

The following attributes are by default replaced with anonymized values:

* :code:`vin` (Vehicle Identification Number)
* :code:`lat` and :code:`lon` (GPS position)
* :code:`licensePlate`
* :code:`information of dealer`

Create a new
`fingerprint data contribution <https://github.com/bimmerconnected/bimmer_connected/discussions/new?category_id=32000818>`_
and add the files as attachment to the discussion.

Please add your model and year to the title of the issue, to make it easier to organize. 
If you know the "chassis code" of your car, you can include that too. (For example, 
googling "2017 BMW X5" will show a Wikipedia article entitled "BMW X5 (F15)". F15 is 
therefore the chassis code of the car.)


**Note:** We will then use this data as additional test cases. So we will publish
(parts of) it (after checking for personal information again) and use
this as test cases for our library. If you do not want this, please
let us know in advance.

Code Contributions
==================
Contributions are welcome! Please make sure that your code passes the checks in :code:`.github/workflows/test.yml`. 
We currently test against :code:`flake8`, :code:`pylint` and our own :code:`pytest` suite.
And please add tests where it makes sense. The more the better.

See the `contributing guidelines <https://github.com/bimmerconnected/bimmer_connected/blob/master/CONTRIBUTING.md>`_ for more details.

Thank you
=========

Thank you to all `contributors <https://github.com/bimmerconnected/bimmer_connected/graphs/contributors>`_ for your research and contributions! And thanks to everyone who shares the `fingerprint data <https://github.com/bimmerconnected/bimmer_connected#data-contributions>`_ of their vehicles which we use to test the code.
A special thanks to @HuChundong, @muxiachuixue, @vividmuse for figuring out how to solve login issues!

This library is basically a best-of of other similar solutions,
yet none of them provided a ready to use library with a matching interface
to be used in Home Assistant and is available on pypi.

* https://github.com/edent/BMW-i-Remote
* https://github.com/jupe76/bmwcdapi
* https://github.com/frankjoke/iobroker.bmw
* https://github.com/TA2k/ioBroker.bmw
* https://gitee.com/ichuixue/bmw_shortcuts / https://www.icloud.com/shortcuts/eb064e89e6b647d2828a404227b91c4a

Thank you for your great software!

License
=======
The bimmer_connected library is licensed under the Apache License 2.0.

Disclaimer
==========
This library is not affiliated with or endorsed by BMW Group.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bimmerconnected/bimmer_connected",
    "name": "bimmer-connected",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "BMW, Connected Drive, home automation",
    "author": "gerard33, rikroe",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/3b/f6/1ebe89a66ce2d633d097843c5b944ae9868c0ba17462844131f5c62e2454/bimmer_connected-0.15.0.tar.gz",
    "platform": null,
    "description": "bimmer_connected\n================\n\n.. image:: https://badge.fury.io/py/bimmer-connected.svg\n    :target: https://pypi.org/project/bimmer-connected\n.. image:: https://github.com/bimmerconnected/bimmer_connected/actions/workflows/test.yml/badge.svg?branch=master\n    :target: https://github.com/bimmerconnected/bimmer_connected/actions/workflows/test.yml?query=branch%3Amaster\n.. image:: https://readthedocs.org/projects/bimmer-connected/badge/?version=latest\n    :target: https://bimmer-connected.readthedocs.io/en/stable/?badge=latest\n.. image:: https://codecov.io/gh/bimmerconnected/bimmer_connected/branch/master/graph/badge.svg?token=qNT50j82f6\n    :target: https://codecov.io/gh/bimmerconnected/bimmer_connected\n.. image:: https://static.pepy.tech/badge/bimmer_connected/week\n    :target: https://pepy.tech/badge/bimmer-connected/week\n.. image:: https://static.pepy.tech/badge/bimmer_connected/month\n    :target: https://pepy.tech/project/bimmer-connected/month\n.. image:: https://static.pepy.tech/badge/bimmer_connected\n    :target: https://pepy.tech/project/bimmer-connected    \n    \n\nThis is a simple library to query and control the status of your BMW or Mini vehicle from\nthe MyBMW portal.\n\n\nInstallation\n============\n:code:`bimmer_connected` is tested against **Python 3.8 or above**. Just install the latest release from `PyPI <https://pypi.org/project/bimmer-connected/>`_ \nusing :code:`pip3 install --upgrade bimmer_connected`. \n\nAlternatively, clone the project and execute :code:`pip install -e .` to install the current \n:code:`master` branch.\n\n.. note::\n    If you want to connect to a **chinese** server, you need to install the :code:`[china]` extra, e.g. :code:`pip3 install --upgrade bimmer_connected[china]`.\n\nUsage\n=====\nWhile this library is mainly written to be included in `Home Assistant <https://www.home-assistant.io/integrations/bmw_connected_drive/>`_, it can be use on its own.\n\nAfter installation, execute :code:`bimmerconnected` from command line for usage instruction\nor see the full `CLI documentation <http://bimmer-connected.readthedocs.io/en/stable/#cli>`_.\n\nPlease be aware that :code:`bimmer_connected` is an :code:`async` library when using it in Python code.\nThe description of the :code:`modules` can be found in the `module documentation \n<http://bimmer-connected.readthedocs.io/en/stable/#module>`_.\n\nExample in an :code:`asyncio` event loop\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n::\n\n    import asyncio\n    from bimmer_connected.account import MyBMWAccount\n    from bimmer_connected.api.regions import Regions\n\n    async def main():\n        account = MyBMWAccount(USERNAME, PASSWORD, Regions.REST_OF_WORLD)\n        await account.get_vehicles()\n        vehicle = account.get_vehicle(VIN)\n        print(vehicle.brand, vehicle.name, vehicle.vin)\n        \n        result = await vehicle.remote_services.trigger_remote_light_flash()\n        print(result.state)\n\n    asyncio.run(main())\n\n    \nExample in non-async code\n^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n    import asyncio\n    from bimmer_connected.account import MyBMWAccount\n    from bimmer_connected.api.regions import Regions\n\n\n    account = MyBMWAccount(USERNAME, PASSWORD, Regions.REST_OF_WORLD)\n    asyncio.run(account.get_vehicles())\n    vehicle = account.get_vehicle(VIN)\n    print(vehicle.brand, vehicle.name, vehicle.vin)\n        \n    result = asyncio.run(vehicle.remote_services.trigger_remote_light_flash())\n    print(result.state)\n\n\nCompatibility\n=============\nThis works with BMW (and Mini) vehicles with a MyBMW account.\nSo far it is tested on vehicles with a 'MGU', 'NBTEvo', 'EntryEvo', 'NBT', or 'EntryNav'\nnavigation system. If you have any trouble with other navigation systems, please create \nan issue with your server responses (see next section).\n\nTo use this library, your BMW (or Mini) must have the remote services enabled for your vehicle. \nYou might need to book this in the MyBMW/Mini Connected portal and this might cost \nsome money. In addition to that you need to enable the Remote Services in your infotainment \nsystem in the vehicle.\n\nDifferent models of vehicles and infotainment systems result in different types of attributes\nprovided by the server. So the experience with the library will certainly vary across the different \nvehicle models.\n\nData Contributions\n==================\nIf some features do not work for your vehicle, we would need the data\nreturned form the server to analyse this and potentially extend the code.\nDifferent models and head unit generations lead to different responses from\nthe server.\n\nIf you want to contribute your data, perform the following steps:\n\n::\n\n    # get the latest version of the library\n    pip3 install --upgrade bimmer_connected\n\n    # run the fingerprint function\n    bimmerconnected fingerprint <username> <password> <region>\n\nThis will create a set of log files in the \"vehicle_fingerprint\" folder.\nBefore sending the data to anyone please **check for any personal data** such as **dealer name** or **country**. \n\nThe following attributes are by default replaced with anonymized values:\n\n* :code:`vin` (Vehicle Identification Number)\n* :code:`lat` and :code:`lon` (GPS position)\n* :code:`licensePlate`\n* :code:`information of dealer`\n\nCreate a new\n`fingerprint data contribution <https://github.com/bimmerconnected/bimmer_connected/discussions/new?category_id=32000818>`_\nand add the files as attachment to the discussion.\n\nPlease add your model and year to the title of the issue, to make it easier to organize. \nIf you know the \"chassis code\" of your car, you can include that too. (For example, \ngoogling \"2017 BMW X5\" will show a Wikipedia article entitled \"BMW X5 (F15)\". F15 is \ntherefore the chassis code of the car.)\n\n\n**Note:** We will then use this data as additional test cases. So we will publish\n(parts of) it (after checking for personal information again) and use\nthis as test cases for our library. If you do not want this, please\nlet us know in advance.\n\nCode Contributions\n==================\nContributions are welcome! Please make sure that your code passes the checks in :code:`.github/workflows/test.yml`. \nWe currently test against :code:`flake8`, :code:`pylint` and our own :code:`pytest` suite.\nAnd please add tests where it makes sense. The more the better.\n\nSee the `contributing guidelines <https://github.com/bimmerconnected/bimmer_connected/blob/master/CONTRIBUTING.md>`_ for more details.\n\nThank you\n=========\n\nThank you to all `contributors <https://github.com/bimmerconnected/bimmer_connected/graphs/contributors>`_ for your research and contributions! And thanks to everyone who shares the `fingerprint data <https://github.com/bimmerconnected/bimmer_connected#data-contributions>`_ of their vehicles which we use to test the code.\nA special thanks to @HuChundong, @muxiachuixue, @vividmuse for figuring out how to solve login issues!\n\nThis library is basically a best-of of other similar solutions,\nyet none of them provided a ready to use library with a matching interface\nto be used in Home Assistant and is available on pypi.\n\n* https://github.com/edent/BMW-i-Remote\n* https://github.com/jupe76/bmwcdapi\n* https://github.com/frankjoke/iobroker.bmw\n* https://github.com/TA2k/ioBroker.bmw\n* https://gitee.com/ichuixue/bmw_shortcuts / https://www.icloud.com/shortcuts/eb064e89e6b647d2828a404227b91c4a\n\nThank you for your great software!\n\nLicense\n=======\nThe bimmer_connected library is licensed under the Apache License 2.0.\n\nDisclaimer\n==========\nThis library is not affiliated with or endorsed by BMW Group.\n\n",
    "bugtrack_url": null,
    "license": "Apache-2",
    "summary": "Library to read data from the BMW Connected Drive portal",
    "version": "0.15.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/bimmerconnected/bimmer_connected/issues",
        "Documentation": "https://bimmer-connected.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/bimmerconnected/bimmer_connected",
        "Source Code": "https://github.com/bimmerconnected/bimmer_connected"
    },
    "split_keywords": [
        "bmw",
        " connected drive",
        " home automation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8bf21a48bbdf9ace7ead8efb07dcd39c64070d37b4a1a110dd8a674fe2cc06e4",
                "md5": "ff37a9df11410f455a489582c5f51b8c",
                "sha256": "801689e5fe8256508e1b63ba89b612ba21f430bf8f16b3d55a46d376f95c4509"
            },
            "downloads": -1,
            "filename": "bimmer_connected-0.15.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ff37a9df11410f455a489582c5f51b8c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 154673,
            "upload_time": "2024-03-29T17:10:23",
            "upload_time_iso_8601": "2024-03-29T17:10:23.560690Z",
            "url": "https://files.pythonhosted.org/packages/8b/f2/1a48bbdf9ace7ead8efb07dcd39c64070d37b4a1a110dd8a674fe2cc06e4/bimmer_connected-0.15.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3bf61ebe89a66ce2d633d097843c5b944ae9868c0ba17462844131f5c62e2454",
                "md5": "db3b5abfc2509c9ce58e263b4044651c",
                "sha256": "ce064b62ec70672b0da7e5478bd0bd0d72906d4816d922312df66d17495a0e56"
            },
            "downloads": -1,
            "filename": "bimmer_connected-0.15.0.tar.gz",
            "has_sig": false,
            "md5_digest": "db3b5abfc2509c9ce58e263b4044651c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7219612,
            "upload_time": "2024-03-29T17:10:27",
            "upload_time_iso_8601": "2024-03-29T17:10:27.099672Z",
            "url": "https://files.pythonhosted.org/packages/3b/f6/1ebe89a66ce2d633d097843c5b944ae9868c0ba17462844131f5c62e2454/bimmer_connected-0.15.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 17:10:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bimmerconnected",
    "github_project": "bimmer_connected",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "httpx",
            "specs": []
        },
        {
            "name": "pycryptodome",
            "specs": [
                [
                    ">=",
                    "3.4"
                ]
            ]
        },
        {
            "name": "pyjwt",
            "specs": [
                [
                    ">=",
                    "2.1.0"
                ]
            ]
        },
        {
            "name": "Pillow",
            "specs": []
        }
    ],
    "lcname": "bimmer-connected"
}
        
Elapsed time: 0.23980s