🚨 I sold my Renault Zoe so I can't test more things anymore. I hope this repo will continue to live with your contributions.
MyRenaultAPI is an npm package that provides an interface to interact with the Renault API. This package allows developers to easily access and manage data from their Renault vehicles.
Note: This is not an official library. It uses endpoints from the official MyRenault application.
- Node >= 12.0.0
To install the package, use npm:
npm install myrenaultapi
Here is an example of how to use the MyRenaultAPI package:
import MyRenaultAPI from 'myrenaultapi'
const renault = new MyRenaultAPI({
username: 'your-email@example.com',
password: 'your-password',
});
renault.login()
.then(() => {
return renault.getVehicleDetails('my-super-vin');
})
.then(vehicle => {
console.log(vehicle);
})
.catch(error => {
console.error(error);
});
Authenticates the user.
Note: You don't have to login everytime, but there is already a condition to avoid login if previous one is still usable.
-
force
(optional, boolean):-
true
: Forces a login, regardless of session validity. -
false
(default): Skips login if the current session is still valid.
-
A Promise
that resolves when the login process is complete.
await renault.login(true); // Forces a login
Get vehicle details for the given vehicle VIN.
-
vin
(string)
A Promise
that resolves with many informations about the vehicle.
renault.login()
.then(() => {
return renault.getVehicleDetails('my-super-vin');
})
.then(vehicle => {
console.log(vehicle);
})
.catch(error => {
console.error(error);
});
Get details for all vehicles the user own.
A Promise
that resolves with a list of vehicles informations.
renault.login()
.then(() => {
return renault.getVehiclesDetails();
})
.then(vehicles => {
console.log(vehicles);
})
.catch(error => {
console.error(error);
});
Get data for a given vin vehicle and a given endpoint.
-
vin
(string) -
endpoint
(VehicleDataEndpoint)
A Promise
that resolves with information for the given endpoint.
renault.login()
.then(() => {
return renault.getVehicleData('my-super-vin', VehicleDataEndpointVersion2.BatteryStatus);
})
.then(vehicle => {
console.log(vehicle);
})
.catch(error => {
console.error(error);
});
Get capabilities of the vehicle.
-
vin
(string)
A Promise
that resolves with capabilities for the given VIN vehicle.
renault.login()
.then(() => {
return renault.getVehicleCapabilities('my-super-vin');
})
.then(vehicle => {
console.log(vehicle);
})
.catch(error => {
console.error(error);
});
Post an action to the given vehicle and given endpoint.
Note: Data can be very different for each endpoint. Please check the documentation.
-
vin
(string) -
endpoint
(ActionEndpoint) -
data
(any)
A Promise
that resolves.
renault.login()
.then(() => {
const body = {
data: {
type: 'ChargingStart',
attributes: {
action: 'start',
},
};
return renault.postVehicleAction('my-super-vin', ActionEndpointVersion1.ChargeMode, body)
})
.then(() => {
console.log('Success')
})
.catch(error => {
console.error(error)
})
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Distributed under the terms of the MIT license, MyRenaultAPI is free and open source software.
This project is not affiliated with, endorsed by, or connected to Renault. I accept no responsibility for any consequences, intended or accidental, as a as a result of interacting with Renault's API using this project.
This project was heavily based on Renault API, a Python Renault API.