Git Product home page Git Product logo

mb-exporter's Introduction

mb-exporter

This is a prometheus exporter using the APIs provided by Mercedes-Benz. You can subscribe to these APIs and use them only for your own car( s) (BYOCAR = bring your own car).

How to use

  1. Goto https://developer.mercedes-benz.com/ and login
  2. Jump to the console and create a project dedicated to use with this exporter.
  3. Fill in the required details.
  4. Click on "Add product" and add the following products. Each with the options "get for free" and "BYOCAR".
    1. Electric Vehicle Status
    2. Fuel Status
    3. Pay As You Drive Insurance
    4. Vehicle Lock Status
    5. Vehicle Status
  5. Click on subscribe and back to project page afterwards
  6. Generate credentials and save the client id and especially the client secret to a secure location. The client secret cannot be displayed again and maybe only regenerated.
  7. Adapt the redirect URL. E.g. running this exporter on your local computer or using a port forwarding use http://localhost:8080/oauth.redirect.
  8. Put the client id, the client secret and your cars VIN into a file named config.py:
    client_id = "my-client-id"
    client_secret = "my-client-secret"
    vin = "my-vin"

Afterwards you have the option to use the docker image: https://hub.docker.com/r/chrko/mb-exporter

docker run --detach \
  --rm \
  --name mb-exporter \
  --pull always \
  --publish 8080:8080/tcp \
  --volume /home/mb-exporter/config.py:/mb-exporter/src/config.py \
  --volume /home/mb-exporter/state/state.json:/mb-exporter/state.json \
  chrko/mb-exporter

On the first run or after issues with the authentication, you must go to localhost:8080/oauth.auth. There maybe the need to empty state.json before launching the exporter.

cat > ~mb-exporter/state/state.json < /dev/null

Contributions

Contributions in the form of issues or pull requests are welcome, but please note that this intended to fit my personal needs.

License

This project is licensed under the terms of Mozilla Public License 2.0.

mb-exporter's People

Contributors

chrko avatar

Watchers

 avatar  avatar

mb-exporter's Issues

Retry on error

In case of an error during an API call which doesn't relate to rate limiting, auth failures etc., I would like to retry especially the API calls which usually called only once an hour.

Add readme with setup guide

Add a readme (adoc or md) with explanatory 'Getting started' section. That is, where (developer.m**-b**.com) to request which products ('Fuel Status' etc.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.