A Python package for remotely controlling Vattenfall EV charging stations
Project description
⚡ PyInCharge
An unofficial Python library for controlling your Vattenfall InCharge charging stations 🔌
Because manually walking to your EV charger is so 2024 🚗💨
Welcome to this unofficial, half-baked but working (on my machine) Python package for controlling your Vattenfall InCharge charging stations. In essence, this is a Python wrapper around the Vattenfall InCharge web application.
It is born out of the frustration of not being able to control my charging station via Home Assistant, so I set out to develop a Python package with which you at least have some control over your station.
Right now, it has these features:
- Automatic-Login: Automates the login process in a not so neat but working way
- Remote Start: Start charging your EV without leaving your computer
- Remote Stop: Stop charging your EV without leaving your computer either
- Remote Unlock: Automatically unlock your EV charging cable
- Set light intensity: Useless but hey why not
- Reset: Reset your charging station
🏗️ Installation
pip install py-incharge
Or from source:
git clone https://github.com/Swopper050/py-incharge.git
cd py-incharge
pip install -e .
🎮 Quick Start
Usage (commands)
import logging
from py_incharge import InChargesend_remote_start
# Optional, to see the logging and what's going on
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)
client = InCharge(email="your@email.com", password="your_password")
client.login() # Required for other calls to work
# Charge your car like it's 2025
client.start_transaction(station_name="EVB-12345678", rfid="123456abcdef")
# Other commands
client.unlock_connector(station_name="EVB-12345678")
client.stop_transaction(station_name="EVB-12345678", transaction_id=1)
client.set_light_intensity(station_name="EVB-12345678", "90")
client.trigger_status_notification(station_name="EVB-12345678")
client.reset(mode="Soft") # Careful with this one
# Logout to finish the session
client.logout()
🕵️ Find the information you need in Vattenfall
In order to work with this library you need 4 things:
- Your email. I really hope you know this one.
- Your password. Same.
These are your credentials you use to login at the Vattenvall InCharge portal:
-
The name of your charging station, something like
EVB-P1234567. After logging in to the portal you can find that here: -
The RFID of your charging card. The RFID is something like
12345AB12345C67(not the same as your card number, which is something like for exampleNL-NUO-A01234567-A). You can your RFID here:
With these 4 variables (email, password, station name and RFID), you can use the package!
🌟 How It Works
-
Login: Mimics the login flow to obtain a 'bearer token', used to authenticate further requests.
-
Send Commands: Now you can send commands like
start_transaction(...)orunlock_connector(...). For every call roughly the following steps are executed:- A new ticket ID is requested.
- Via a websocket connection this ticket is validated.
- The command with specific parameters (
station_name,connector_id,transaction_id, etc.) is send to the websocket. - The reponse status is validated.
-
Profit: Your car starts (or stops, or something else) charging! 🎉
🚨 Important Notes
- Chrome Required: This package uses Chrome for authentication
- Credentials: Keep your credentials safe and never commit them to version control
- Rate Limits: Don't spam the API (be nice to the servers), especially take time between commands!
- Testing: Always test in a safe environment first
🤝 Contributing
Found a bug? Want to add a feature? PRs are welcome! Just make sure to:
- Write clean, documented code
- Follow the existing code style
- Add tests (not really, but when you're at it, feel free to test my code too ;) )
- Update this README if needed
📄 License
MIT License - feel free to use this for your own EV charging projects
Disclaimer: This is an unofficial tool and is not affiliated with Vattenfall. Use at your own risk and always follow local regulations regarding EV charging.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_incharge-0.2.0.tar.gz.
File metadata
- Download URL: py_incharge-0.2.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
194537db27e2c4ec73e41b96a0b45fe567ed72f911e78eb584bbdf354ca3fe56
|
|
| MD5 |
49f45c4222b6da08f525ca984fc2e75f
|
|
| BLAKE2b-256 |
494430d270ca92fbe17465da91ede8dc0d265a30fb1a31d8c5590fbd8c1cc4f3
|
Provenance
The following attestation bundles were made for py_incharge-0.2.0.tar.gz:
Publisher:
publish.yml on Swopper050/py-incharge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_incharge-0.2.0.tar.gz -
Subject digest:
194537db27e2c4ec73e41b96a0b45fe567ed72f911e78eb584bbdf354ca3fe56 - Sigstore transparency entry: 249327391
- Sigstore integration time:
-
Permalink:
Swopper050/py-incharge@b1eec731930389fb466529c067361384fb4a71cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Swopper050
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b1eec731930389fb466529c067361384fb4a71cf -
Trigger Event:
push
-
Statement type:
File details
Details for the file py_incharge-0.2.0-py3-none-any.whl.
File metadata
- Download URL: py_incharge-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c17db1e54110d472d81d7c84afbde3cebb4a89b9a1af3076a3201f8643885ee3
|
|
| MD5 |
60ae97737ae6e3682c5e5e482277d7e6
|
|
| BLAKE2b-256 |
c1101f4c545899a3b2bfa7b726511420b99d0c4e43ef41e569930d5dc4747613
|
Provenance
The following attestation bundles were made for py_incharge-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on Swopper050/py-incharge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_incharge-0.2.0-py3-none-any.whl -
Subject digest:
c17db1e54110d472d81d7c84afbde3cebb4a89b9a1af3076a3201f8643885ee3 - Sigstore transparency entry: 249327393
- Sigstore integration time:
-
Permalink:
Swopper050/py-incharge@b1eec731930389fb466529c067361384fb4a71cf -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Swopper050
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b1eec731930389fb466529c067361384fb4a71cf -
Trigger Event:
push
-
Statement type: