Code Monkey home page Code Monkey logo

bluelink's Introduction

๐Ÿš™ 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.

bluelink's People

Contributors

synchronizing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bluelink's Issues

PIP Install Not Working in VS Code

ERROR: Could not find a version that satisfies the requirement bluelink (from versions: none)
ERROR: No matching distribution found for bluelink

country

can you make this for other country ?

Unable to send your request because a previous request is pending. Please wait and try again later.

I get this error every time, even though I'm able to log in using the app successfully. Is there anything region specific to this API, or should it work in all regions worldwide?

Exception has occurred: RequestFailed
Unable to send your request because a previous request is pending. Please wait and try again later.
  File "D:\My Documents\Repos\bluelink-test\bluelink-test.py", line 7, in <module>
    bl.login()

Car Status?

Thanks for this - it works really well.

I wonder if there is a way to grab that car status that bluelink provides. If doors are open, if it is running, etc.

That would be very useful (i think). :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.