mirror of
https://github.com/Dielee/volvo2mqtt.git
synced 2026-08-13 03:09:52 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0516c29563 | ||
|
|
9b3f9b4c0b | ||
|
|
65d0214664 |
@@ -8,13 +8,13 @@ Maybe this component works also with other Volvo cars. Please try out the native
|
|||||||
Just install this addon with the following command.
|
Just install this addon with the following command.
|
||||||
Please note to fill in your settings inside the environment variables.
|
Please note to fill in your settings inside the environment variables.
|
||||||
|
|
||||||
`docker run -e CONF_updateInterval=300 -e CONF_babelLocale='de' -e CONF_mqtt='@json {"broker": "", "username": "", "password": ""}' -e CONF_volvoData='@json {"username": "", "password": "", "vin": "", "vccapikey": ""}' -e TZ='Europe/Berlin' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest`
|
`docker run --pull=always -e CONF_updateInterval=300 -e CONF_babelLocale='de' -e CONF_mqtt='@json {"broker": "", "username": "", "password": ""}' -e CONF_volvoData='@json {"username": "", "password": "", "vin": "", "vccapikey": ""}' -e TZ='Europe/Berlin' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest`
|
||||||
|
|
||||||
Here is what every option means:
|
Here is what every option means:
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
| -------------------- | :-------: | :----------: | --------------------------------------------------------------- |
|
| -------------------- | :-------: | :----------: | --------------------------------------------------------------- |
|
||||||
| `updateInterval` | `int` | **required** | Updateintervall in seconds. |
|
| `updateInterval` | `int` | **required** | Update intervall in seconds. |
|
||||||
| `babelLocale` | `string` | **required** | Locale for date Format |
|
| `babelLocale` | `string` | **required** | Locale for date Format |
|
||||||
| `mqtt` | `json` | **required** | Broker = Mqtt Broker IP / Username and Passwort are optional! |
|
| `mqtt` | `json` | **required** | Broker = Mqtt Broker IP / Username and Passwort are optional! |
|
||||||
| `volvoData` | `json` | **required** | Username and password are required. Car vin can be a single vin or a list of multiple vins like `["vin1", "vin2"]`. If no vin is provided, <b>ALL</b> of your vehicles will be used. Vccapi key is your api key from [here](https://developer.volvocars.com/account/). |
|
| `volvoData` | `json` | **required** | Username and password are required. Car vin can be a single vin or a list of multiple vins like `["vin1", "vin2"]`. If no vin is provided, <b>ALL</b> of your vehicles will be used. Vccapi key is your api key from [here](https://developer.volvocars.com/account/). |
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
VERSION = "v1.0.2.1"
|
||||||
|
|
||||||
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
OAUTH_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
|
||||||
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles"
|
VEHICLES_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles"
|
||||||
VEHICLE_DETAILS_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles/{0}"
|
VEHICLE_DETAILS_URL = "https://api.volvocars.com/connected-vehicle/v1/vehicles/{0}"
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
from volvo import authorize
|
from volvo import authorize
|
||||||
from mqtt import update_loop, connect
|
from mqtt import update_loop, connect
|
||||||
|
from const import VERSION
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
print("Starting volvo2mqtt version " + VERSION)
|
||||||
authorize()
|
authorize()
|
||||||
connect()
|
connect()
|
||||||
update_loop()
|
update_loop()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from const import charging_system_states, CLIMATE_START_URL, \
|
|||||||
|
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
session.headers = {
|
session.headers = {
|
||||||
"vcc-api-key": settings["volvoData"]["vccapikey"],
|
"vcc-api-key": "",
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
"accept": "*/*"
|
"accept": "*/*"
|
||||||
}
|
}
|
||||||
@@ -42,6 +42,7 @@ def authorize():
|
|||||||
token_expires_at = datetime.now() + timedelta(seconds=(data["expires_in"] - 30))
|
token_expires_at = datetime.now() + timedelta(seconds=(data["expires_in"] - 30))
|
||||||
refresh_token = data["refresh_token"]
|
refresh_token = data["refresh_token"]
|
||||||
|
|
||||||
|
session.headers.update({"vcc-api-key": settings["volvoData"]["vccapikey"]})
|
||||||
get_vehicles()
|
get_vehicles()
|
||||||
else:
|
else:
|
||||||
message = auth.json()
|
message = auth.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user