wallboxjs
v1.0.1
Published
An API to control your Wallbox charger (EV). Includes functions like start/stop, scheduling, and pricing details.
Downloads
16
Maintainers
Readme
WallboxJS
A JavaScript library that can control your Wallbox Charger (EV). It provides functionalities like start/stop charging, scheduling, and pushing pricing details.
Installation
Use the package manager npm to install WallboxJS.
npm install wallboxjs
Usage
Firstly, import the library:
const Wallbox = require('wallboxjs');
You can use the library like this:
const wallbox = new Wallbox('username', 'password');
//Get all chargers
const chargerList = await wallbox.getChargers();
chargerID = chargerList[0].id;
console.log(chargerID);
// Get charger status
const response = await wallbox.getChargerStatus(chargerID);
console.log(response.data);
// Push price to API
wallbox.setEnergyCost(chargerID, hourPrice);
Library Methods
This package includes the following methods:
authenticate()
: Authenticate with the Wallbox API. This happens within the other methods as well so no need to authenticate seperatly.getChargers()
: Get a list of all your chargers.getChargerStatus(chargerId)
: Get the status of a specific charger.getSessionList(chargerId, startDate, endDate)
: Get a list of charging sessions for a specific charger within a specific date range.setEnergyCost(chargerId, energyCost)
: Set the energy cost for a specific charger.pauseChargingSession(chargerId)
: Pause the charging session for a specific charger.resumeChargingSession(chargerId)
: Resume the charging session for a specific charger.setMaxChargingCurrent(chargerId, maxChargingCurrent)
: Set the maximum charging current for a specific charger.unlockCharger(chargerId)
: Unlock a specific charger.lockCharger(chargerId)
: Lock a specific charger.setSchedule(chargerId, startTime, endTime)
: Set the charging schedule for a specific charger. Enter time as string ("HH:MM").
Dependencies
This library is using axios for the http requests.
Contributing
Contributions are welcome! Please feel free to submit issues or propose new features through GitLab. More detailed contribution guidelines will be added in the future.
Testing
Testing can be performed by executing the commands in your application and verifying the expected behavior on your Wallbox charger.
License
This project is licensed under the MIT License.