Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/synchronizing/bluelink

๐Ÿš™ Control your Hyundai car via Python.
https://github.com/synchronizing/bluelink

hyundai hyundai-bluelink python

Last synced: about 1 month ago
JSON representation

๐Ÿš™ Control your Hyundai car via Python.

Awesome Lists containing this project

README

        

# ๐Ÿš™ BlueLink

Unofficial Python API wrapper for Hyundai's [Bluelinkยฎ](https://www.hyundaiusa.com/us/en/blue-link). 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.

```bash
$ export BLUELINK_EMAIL=
$ export BLUELINK_PASSWORD=
$ export BLUELINK_PIN=

$ bluelink cars
Elantra -
Santa Fe -

$ bluelink lock
Locking...

$ bluelink unlock
Unlocking...

# 'dsh' stands for 'driver seat heat'
# 'psh' stands for 'passenger seat heat'
$ bluelink start --duration=10 --temp="LO" --defrost --dsh=4 --psh=4
Starting...

$ bluelink stop
Stopping...

$ bluelink find
Latitude:
Longitude:

$ bluelink 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.

```python
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='', password='', pin='')
bl.login()

# Prints the BlueLink object.
print(bl) # BlueLink(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) # Car(nickname=, bluelink=)

# Gets the first car.
elantra = bl.cars['']

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.
```