Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/seydx/homebridge-mercedesme

Mercedes plugin for homebridge
https://github.com/seydx/homebridge-mercedesme

car eqc homebridge homebridge-mercedesme homebridge-plugin homekit mercedes siri

Last synced: 5 days ago
JSON representation

Mercedes plugin for homebridge

Awesome Lists containing this project

README

        



# homebridge-mercedesme

[![npm](https://img.shields.io/npm/v/homebridge-mercedesme.svg?style=flat-square)](https://www.npmjs.com/package/homebridge-mercedesme)
[![npm](https://img.shields.io/npm/dt/homebridge-mercedesme.svg?style=flat-square)](https://www.npmjs.com/package/homebridge-mercedesme)
[![GitHub last commit](https://img.shields.io/github/last-commit/SeydX/homebridge-mercedesme.svg?style=flat-square)](https://github.com/SeydX/homebridge-mercedesme)
[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
[![Discord](https://img.shields.io/discord/432663330281226270?color=728ED5&logo=discord&label=discord)](https://discord.gg/kqNCe2D)
[![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square&maxAge=2592000)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NP4T3KASWQLD8)

**Creating and maintaining Homebridge plugins consume a lot of time and effort, if you would like to share your appreciation, feel free to "Star" or donate.**

[Click here](https://github.com/SeydX) to review more of my plugins.

## Info

Apple Home

This dynamic platform plugin allows control of **Mercedes Me** capable cars. At the moment it is only possible to get information like vehicle status, lock status, fuel status etc. If in the future the possibility of e.g. locking or unlocking the car becomes possible, this will also be implemented.

Any system capable of running [Homebridge](https://github.com/nfarina/homebridge/) can be used to run **homebridge-mercedesme**. The only need is Mercedes Me capable car.

## Installation instructions

After [Homebridge](https://github.com/nfarina/homebridge) has been installed:

```sudo npm install -g homebridge-mercedesme@latest```

## First steps (obtain Client ID and Client Secret)

In order to use this plugin, you must first log in with your Mercedes Me account on [Mercedes Developer](https://developer.mercedes-benz.com).
After logging in go to [Console](https://developer.mercedes-benz.com/console/) and press on **Add new app** if you dont have already an existing app for this plugin.

Enter **Application Name** (e.g. Homebridge) **Business Purposes** (e.g. homebridge-mercedesme) and press **Create**

Now we need to add the API endpoints to our App.

1. Visit [Vehicle Status API](https://developer.mercedes-benz.com/products/vehicle_status) and press **Get access**.
2. Choose **Bring your own car** and press **Next**
3. Choose **Standard** and press **Next**
4. Choose your existing app and press **Next**
5. On **Edit Application** leave everything as it is and press **Submit**

Congratulation. Now you have added the **Vehicle Status** endpoint to your app. You need also to add **Lock Status** endpoint, **Pay as your drive** endpoint, **Electric Vehicle Status** endpoint and **Fuel status** endpoint to your app by following the above steps.

Requested endpoints:

- [x] [Vehicle Status](https://developer.mercedes-benz.com/products/vehicle_status/) (added above)
- [ ] [Lock Status](https://developer.mercedes-benz.com/products/vehicle_lock_status/)
- [ ] [Fuel Status](https://developer.mercedes-benz.com/products/fuel_status/)
- [ ] [Electric Vehicle Status](https://developer.mercedes-benz.com/products/electric_vehicle_status/)
- [ ] [Pay as you drive](https://developer.mercedes-benz.com/products/pay_as_you_drive_insurance/)

Once you have added all the API endpoints to your application, visit [Console](https://developer.mercedes-benz.com/console/) again.
You should see your **Client ID**, **Client Secret** and **Redirect Url**.

### Important
Add your Config UI X ip address with port as your **Redirect Url** (eg http://192.168.178.11:8080). If you have multiple ip addresses to your config ui x, please add them all as **redirect uri** !

Copy your **Client ID** and **Client Secret** and put it in your config.json (``Config UI > Plugins > Homebridge Mercedesme Settings > Client ID/Client Secret``)

## First start

The Version 2 is completely new designed. It supports [Config UI X Plugin UI Utils](https://github.com/homebridge/plugin-ui-utils) and is full integrated in your homebridge system via Config UI X. The custom config will guide you through the process! Generating or refreshing access token was never easier! Below you can see how easy it is to create, edit or delete a new car for the config.json using the custom user interface. To use the custom user interface you need at least **homebridge-config-ui-x v4.34.0**!

CustomUI


## Configuration

Please setup your config in Config UI X under ```Plugins > Homebridge Mercedes Me > Settings.```


## Example config.json:

```
{
"bridge": {
...
},
"platforms": [
{
"platform": "MercedesPlatform",
"debug": false,
"cars": [
{
"name": "Mercedes A200",
"clientID": "1b851746-2x58-7y8r-6548-12ft58w159zu",
"clientSecret": "d896ct55-c85c-6363-9999-25iu6985mo10",
"vin": "WDD1234567N123456",
"model": "Mercedes A200",
"manufacturer": "Mercedes",
"maxRange": 800,
"polling": 60,
"tankBatteryType": "LIGHTBULB"
},
{
"name": "Mercedes CLA250",
"clientID": "1b851746-2x58-7y8r-6548-12ft58w159zu",
"clientSecret": "d896ct55-c85c-6363-9999-25iu6985mo10",
"vin": "WDD1234567N123456",
"model": "Mercedes B180",
"manufacturer": "Mercedes",
"maxRange": 600,
"polling": 120,
"electricVehicle": true,
"tankBatteryType": "HUMIDITY"
},
{
"name": "Mercedes B200",
"clientID": "1b851746-2x58-7y8r-6548-12ft58w159zu",
"clientSecret": "d896ct55-c85c-6363-9999-25iu6985mo10",
"vin": "WDD1234567N123456",
"model": "Mercedes B180",
"manufacturer": "Mercedes",
"maxRange": 600,
"polling": 120,
"hybridVehicle": true,
"tankBatteryType": "HUMIDITY"
}
]
}
]
}
```
See [Example Config](https://github.com/SeydX/homebridge-mercedesme/blob/master/example-config.json) for more details.

### Settings

* `platform` - **required** : Must be 'MercedesPlatform'
* `cars.name` - **required** : Name of the Accessory (*unique*)
* `cars.clientID` - **required** : Client ID obtained from https://developer.mercedes-benz.com
* `cars.clientSecret` - **required** : Client Secret obtained from https://developer.mercedes-benz.com
* `cars.vin` - **required** : Vehicle Identification Number (VIN)
* `cars.manufacturer` - **not required** : Car Manufacturer
* `cars.model` - **not required** : Model of the car (Default: Mercedes)
* `cars.maxRange` - **not required** : Maximum distance after full tank load (for calculating range in % for battery state if API doesnt send the percentage)
* `cars.polling` - **not required** : Time in seconds for polling Mercedes API (Default: 60s)
* `cars.electricVehicle` - **not required** : Enable if your car is a electric vehicle (Default: false)
* `cars.hybridVehicle` - **not required** : Enable if your car is a hybrid vehicle (Default: false)
* `cars.tankBatteryType` - **not required** : Choose between several accessory types (HUMIDITY | LIGHTBULB) to show the remaining tank load and/or electric vehicle battery value in percent

## Supported clients

This plugin has been verified to work with the following apps on iOS 14:

* Apple Home
* All 3rd party apps like Elgato Eve etc.
* Homebridge >= v1.1.6

## TODO
- [ ] If it should be possible to control the doors in the future > Changing Door (Contact Service) to Door Service
- [ ] If it should be possible to control the windows in the future > Changing Window (Contact Service) to Window Service

## Troubleshooting

If you have any issues with the plugin, you can enable the debug mode, which will provide some additional information. This might be useful for debugging issues. Open your config.json and set ``"debug": true``

#### Token Issues

If you experiencing issues with your generated token, you can easily refresh it via Config UI X. Below you can see how to do it.

CustomUI Refresh Token

## Changelog

See the [changelog](https://github.com/SeydX/homebridge-mercedesme/blob/master/CHANGELOG.md) for changes between versions of this package.

## Contributing

You can contribute to this homebridge plugin in following ways:

- [Report issues](https://github.com/SeydX/homebridge-mercedesme/issues) and help verify fixes as they are checked in.
- Review the [source code changes](https://github.com/SeydX/homebridge-mercedesme/pulls).
- Contribute bug fixes.
- Contribute changes to extend the capabilities
- Pull requests are accepted.

## Disclaimer

All product and company names are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.