Unofficial API wrapper for Hyundais BlueLink.
Project description
🚙 BlueLink
Unofficial Python API wrapper for Hyundai's Bluelink®. Allows you to remotely control your Hyundai car via Python.
Installing
pip install bluelink
Documentation
Documentation can be found below. See code for more details.
Using
You can use this module either through the built-in CLI, or directly through Python. lock
, unlock
, start
, stop
, find
, and odometer
are supported.
CLI
Note that every individual command will sign-in in to BlueLink. If you plan on chaining commands, you should use the Python API.
$ export BLUELINK_EMAIL=<email>
$ export BLUELINK_PASSWORD=<password>
$ export BLUELINK_PIN=<pin>
$ bluelink cars
Elantra - <vin>
Santa Fe - <vin>
$ bluelink <vin> lock
Locking...
$ bluelink <vin> unlock
Unlocking...
# 'dsh' stands for 'driver seat heat'
# 'psh' stands for 'passenger seat heat'
$ bluelink <vin> start --duration=10 --temp="LO" --defrost --dsh=4 --psh=4
Starting...
$ bluelink <vin> stop
Stopping...
$ bluelink <vin> find
Latitude: <latitude>
Longitude: <longitude>
$ bluelink <vin> odometer
7,643
Python
The Python wrapper comes with two classes: BlueLink
and Car
. The former is the main class that allows logging into the service, and the latter is a wrapper for specific cars linked to the account.
from bluelink import BlueLink
# Logins to BlueLink. You may also choose to set the username, password,
# and pin via environment variables (same convention as the CLI) and
# leave the arguments blank.
bl = BlueLink(email='<email>', password='<password>', pin='<pin>')
bl.login()
# Prints the BlueLink object.
print(bl) # BlueLink(email=<email>, is_logged=True)
# Print all of the cars in the account. 'cars' is a standard dictionary.
for vin, car in bl.cars.items():
print(vin, car) # <vin> Car(nickname=<nickname>, bluelink=<has_bluelink>)
# Gets the first car.
elantra = bl.cars['<vin>']
elantra.lock() # Returns True if successful.
elantra.unlock() # Returns True if successful.
elantra.start(
duration=10,
temp="LO",
defrost=True,
driver_seat_heat=4,
passenger_seat_heat=4,
) # Returns True if successful.
elantra.stop() # Returns True if successful.
elantra.find() # Returns a tuple of (latitude, longitude).
elantra.odometer # Returns an integer. Note this is a property, and not a method.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bluelink-1.0.0.tar.gz
.
File metadata
- Download URL: bluelink-1.0.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06318e900f21cea24d47c8f1694d597c630404a6e62c56ff4d3585005b28711a |
|
MD5 | df0a15ac75b779e3cb04b3cc878a6d79 |
|
BLAKE2b-256 | 91d591b7e6a10d28bb0cdffee36a45a18a0f468f3a727078997cd33ae52b9594 |
File details
Details for the file bluelink-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: bluelink-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a6b27b1825911736ebd93f18ccc01c9095cd467bde55ba4e60f66044603a3a |
|
MD5 | efc6655e51a0bd3428ee802be0c2a5d9 |
|
BLAKE2b-256 | d522d02ce543675a28cc3dc3a3c4c5c820bf6d9a868712dc64df0fdbf8231460 |