Metadata-Version: 2.4
Name: pymyhondaplus
Version: 1.2.1
Summary: Unofficial Python client for the Honda Connect Europe (My Honda+) API
Author: Enrico Battocchi
License-Expression: MIT
Project-URL: Homepage, https://github.com/enricobattocchi/pymyhondaplus
Project-URL: Repository, https://github.com/enricobattocchi/pymyhondaplus
Project-URL: Issues, https://github.com/enricobattocchi/pymyhondaplus/issues
Keywords: honda,honda-e,my-honda-plus,home-assistant,ev
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: cryptography
Provides-Extra: keyring
Requires-Dist: keyring>=24.0; extra == "keyring"
Dynamic: license-file

# pymyhondaplus

Unofficial Python client for the Honda Connect Europe (My Honda+) API.

Tested on Honda e. Should work with other Honda Connect Europe vehicles (e:Ny1, ZR-V, CR-V, Civic, HR-V, Jazz 2020+) but these are untested — contributions welcome!

## Installation

```bash
pip install pymyhondaplus

# Optional: enable OS keyring support (macOS Keychain, Windows Credential Vault, Linux Secret Service)
pip install pymyhondaplus[keyring]
```

## CLI usage

```bash
# Login (first time — triggers email verification; password prompted if omitted)
pymyhondaplus login --email user@example.com

# List vehicles on your account
pymyhondaplus list

# Get vehicle status (auto-selects if only one vehicle)
pymyhondaplus status

# Get fresh status from car (wakes TCU)
pymyhondaplus status --fresh

# Lock / unlock doors
pymyhondaplus lock
pymyhondaplus unlock

# Request fresh car location (wakes TCU)
pymyhondaplus location

# Climate control
pymyhondaplus climate-start
pymyhondaplus climate-stop
pymyhondaplus climate-settings --temp hotter --duration 30

# Set charge limits
pymyhondaplus charge-limit --home 80 --away 90

# Horn & lights
pymyhondaplus horn

# Trip history (current month)
pymyhondaplus trips
pymyhondaplus trips --all
```

### Vehicle selection

If you have only one vehicle on your account, it's selected automatically. With multiple vehicles, specify one using `--vin` (or `-v`) with a VIN, nickname, or plate number:

```bash
pymyhondaplus -v "Honda e" status
pymyhondaplus -v GE395KM status
pymyhondaplus -v JHMZC7840LXXXXXX status

# Or via environment variable
export HONDA_VIN="Honda e"
pymyhondaplus status
```

### Security

Tokens and device keys are encrypted at rest using Fernet (AES-128-CBC). The encryption key is:

- **With `pymyhondaplus[keyring]`**: stored in the OS keyring (macOS Keychain, Windows Credential Vault, Linux Secret Service/KDE Wallet)
- **Without keyring**: derived from a machine-specific fingerprint (username + hostname + random salt via PBKDF2)

Use `--storage plain` to disable encryption (original behavior). Existing plain-text token files are automatically migrated to encrypted format on first use.

## Library usage

```python
from pymyhondaplus.api import HondaAPI
from pymyhondaplus.auth import HondaAuth, DeviceKey

# Authenticate
auth = HondaAuth()
tokens = auth.full_login("user@example.com", "password")

# Use the API
api = HondaAPI()
api.set_tokens(**tokens)
status = api.get_dashboard("JHMZC7840LXXXXXX")
```

## Disclaimer

This project is **unofficial** and **not affiliated with, endorsed by, or connected to Honda Motor Co., Ltd.** in any way.

- Use at your own risk. The authors accept no responsibility for any damage to your vehicle, account, or warranty.
- Honda may change their API at any time, which could break this library without notice.
- Sending remote commands (lock, unlock, climate, charging) to your vehicle is your responsibility. Make sure you understand what each command does before using it.
- This project does not store or transmit your credentials to any third party. Authentication is performed directly with Honda's servers.
