-# mercedes_me_api
+# mercedes_me_api
[![Releases][releases-img]][releases-url]
[![Last Commit][last-commit-img]][last-commit-url]
[![hacs][hacs-img]][hacs-url]
3) Register to the following APIs (all of them):
- [Electric Vehicle Status](https://developer.mercedes-benz.com/products/electric_vehicle_status)
- [Fuel Status](https://developer.mercedes-benz.com/products/fuel_status)
- - [Pay As You Drive Insurance](https://developer.mercedes-benz.com/products/pay_as_you_drive_insurance)
+ - [Pay As You Drive Insurance](https://developer.mercedes-benz.com/products/pay_as_you_drive_insurance)
- [Vehicle Lock Status](https://developer.mercedes-benz.com/products/vehicle_lock_status)
- [Vehicle Status](https://developer.mercedes-benz.com/products/vehicle_status)
-Notes:
+Notes:
1) the APIs described above do not require any subscription in case you use them with your own car associated with the Mercedes me Account.
2) not all sensors may be available in your own car; if a sensor is not available the data request returns no data.
3) only one car is supported for the moment.
enable_resources_file: <**ENABLE (true) OR DISABLE (false) RESOURCES - OPTIONAL (DEFAULT DISABLED)**>
scan_interval: <** TIME PERIOD (NUMBER OF SECONDS) TO REFRESH RESOURCES - OPTIONAL**>
```
-2) Actually it's not possible to retrieve the token from scratch. Please use the other scripts to retrieve the first token and copy it (.mercedesme_token) into the homeassistant configuration folder, in the same path where configuration.yaml is located
+2) Actually it's not possible to retrieve the token from scratch. Please use the other scripts to retrieve the first token and copy it (.mercedesme_token) into the homeassistant configuration folder, in the same path where configuration.yaml is located
### Debug
To enable advanced log please expand the logger module configuration with the following lines:
# Software Name & Version
NAME = "Mercedes Me API"
DOMAIN = "mercedesmeapi"
-VERSION = "0.11"
+VERSION = "0.12"
# Software Parameters
TOKEN_FILE = ".mercedesme_token"
CONFIG_FILE = ".mercedesme_config"
"name": "Mercedes Me API",
"documentation": "https://github.com/xraver/mercedes_me_api/blob/master/README.md",
"issue_tracker": "https://github.com/xraver/mercedes_me_api/issues",
+ "requirements": [],
+ "dependencies": [],
"config_flow": false,
- "version": "0.11",
- "codeowners": [ "@xraver" ]
+ "version": "0.12",
+ "codeowners": [ "@xraver" ],
+ "iot_class": "cloud_push"
}
#!/bin/bash
# Author: G. Ravera
-# Version 0.5
+# Version 0.7
# Creation Date: 28/09/2020
#
# Change log:
# 18/12/2020 - 0.4 - Added macOS support (robert@klep.name)
# 19/12/2020 - 0.5 - Added Electric Vehicle Status support
# 23/12/2020 - 0.6 - Added PayAsYouDrive support (danielrheinbay@gmail.com)
+# 19/12/2022 - 0.7 - Updated URLs (samfaitmalomolet)
# Script Name & Version
NAME="mercedes_me_api.sh"
shift
;;
-r | --refresh )
- refreshAuthCode
+ refreshAuthCode
shift
;;
-f | --fuel )
BASE64=$(echo $BASE64 | sed $SED_FLAG 's/ //')
}
-function getAuthCode ()
+function getAuthCode ()
{
generateBase64
-
+
echo "Open the browser and insert this link:"
- echo
+ echo
echo "https://ssoalpha.dvb.corpinter.net/v1/auth?response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URL&scope=$SCOPE"
#echo "https://ssoalpha.dvb.corpinter.net/v1/auth?response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIRECT_URL&scope=$SCOPE&state=$STATE"
- echo
+ echo
echo "Copy the code in the url:"
read AUTH_CODE
extractRefreshToken
TOKEN=$(curl --request POST \
- --url https://id.mercedes-benz.com/as/token.oauth2 \
+ --url https://ssoalpha.dvb.corpinter.net/v1/token \
--header "Authorization: Basic $BASE64" \
--header "content-type: application/x-www-form-urlencoded" \
--data "grant_type=refresh_token&refresh_token=$REFRESH_CODE")