https://github.com/timbroddin/stromer-api
A wrapper for the Stromer e-bike API
https://github.com/timbroddin/stromer-api
e-bike nodejs stromer
Last synced: 4 months ago
JSON representation
A wrapper for the Stromer e-bike API
- Host: GitHub
- URL: https://github.com/timbroddin/stromer-api
- Owner: TimBroddin
- Created: 2018-10-12T11:51:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-14T08:23:19.000Z (over 7 years ago)
- Last Synced: 2025-09-12T04:01:08.532Z (10 months ago)
- Topics: e-bike, nodejs, stromer
- Language: JavaScript
- Homepage:
- Size: 73.2 KB
- Stars: 20
- Watchers: 6
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stromer API for Node JS
This NPM package provides a wrapper for the [Stromer e-bike API](https://www.stromerbike.com/fr_BE.html). By using this package you can get your bike's status, position and much more.
## Installation
`yarn add stromer-api`
or
`npm install stromer-api --save`
## Usage
const Stromer = require('stromer-api');
const api = new Stromer({
username: "xxxxx",
password: "xxxxxx",
client_id: "xxxxxxx",
client_secret: "xxxxxxx"
});
api.bike.state.get().then(state => console.log(state));
### Client id & secret
I can not share the Stromer client id & secret. However, it should be pretty easy to obtain them by using a tool like [mitmproxy](https://mitmproxy.org/) while using an official Stromer app.
## Methods
Once you've initiated the API, it's pretty easy to get all the info you need. All methods are async, so you can either use `async await` or use promises.
Let's say you've initiated the API like I did above:
| Method | Returns |
| ------------------------------------- | -------------------------------------------------------------------- |
| api.bike.state.get(cached = false) | The state of your bike (battery info, FW version, temperatures, ...) |
| api.bike.position.get(cached = false) | The position of your bike |
| api.bike.serviceInfo.get() | Technical details of all your bike parts (not in official app) |
| api.bike.settings.get() | Get all settings |
| api.bike.settings.getMainSettings() | Get main settings (auto lock, ...) |
| api.bike.settings.getSensorSettings() | Get torque and brake sensor settings |
| api.bike.settings.getTuningSettings() | Get tuning settings for preset 2 |
| api.bike.settings.set(data) | Change a setting, pass data as an object |
| api.bike.light.set(mode = flash) | Flash the front light |
| api.bike.lock() | Lock your bike |
| api.bike.unlock() | Unlock your bike |
## Thanks
Many thanks to merstro on [StromerForum.nl](http://stromerforum.nl) for the initial Python code!
## Disclaimer
Use at your own risk!