Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/synchronizing/bluelink
๐ Control your Hyundai car via Python.
https://github.com/synchronizing/bluelink
hyundai hyundai-bluelink python
Last synced: 4 days ago
JSON representation
๐ Control your Hyundai car via Python.
- Host: GitHub
- URL: https://github.com/synchronizing/bluelink
- Owner: synchronizing
- Created: 2022-01-07T13:59:00.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-18T15:52:09.000Z (about 2 years ago)
- Last Synced: 2024-12-31T16:14:10.108Z (11 days ago)
- Topics: hyundai, hyundai-bluelink, python
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 214
- Watchers: 6
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- my-awesome-github-stars - synchronizing/bluelink - ๐ Control your Hyundai car via Python. (Python)
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.
```