Compare commits

..
7 Commits
Author SHA1 Message Date
linus 76cfa21db7 Bump pypi packages 2026-03-23 07:57:37 +01:00
linus 9d11dff24b Fix #318 2026-03-23 07:47:15 +01:00
bazza2000andGitHub 3a4160451c Fix: use POST for continueAuthentication endpoint (#317)
Volvo's PingFederate auth API now requires a POST request for the
continueAuthentication step after OTP verification. Using GET returns
the same OTP_VERIFIED state in a loop, never progressing to COMPLETED,
which causes a KeyError on 'authorizeResponse'.

Changing auth_session.get() to auth_session.post() with an empty JSON
body causes the API to return COMPLETED with the expected authorizeResponse.
2026-03-23 07:43:53 +01:00
linus 515e1a8d27 Bump addon version 2026-01-02 18:17:31 +01:00
linus 4961f7bfad Move readme to 2026 maintenance 2026-01-02 18:16:30 +01:00
linus a68216bdd5 Move object_id to default_entity_id for mqtt entities according to #312 2026-01-02 18:12:47 +01:00
linus 98d8dd7e65 Fix missing charging system state 2026-01-02 18:06:30 +01:00
7 changed files with 36 additions and 15 deletions
+1 -1
View File
@@ -171,6 +171,6 @@ Here is what every option means:
[i386-shield]: https://img.shields.io/badge/i386-yes-green.svg
[releases]: https://github.com/Dielee/volvo2mqtt/releases
[releases-shield]: https://img.shields.io/github/release/Dielee/volvo2mqtt.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2026.svg
[commits-shield]: https://img.shields.io/github/commit-activity/y/Dielee/volvo2mqtt.svg
[commits]: https://github.com/Dielee/volvo2mqtt/commits/main
+4 -4
View File
@@ -1,6 +1,6 @@
requests~=2.32.0
dynaconf~=3.1.12
paho-mqtt~=1.6.1
Babel~=2.12.1
pytz~=2023.3
dynaconf~=3.2.13
paho-mqtt~=2.1.0
Babel~=2.18.0
pytz~=2026.1.post1
google_play_scraper~=1.2.6
+19
View File
@@ -1,3 +1,22 @@
## v1.13.3
### 🐛 Bug Fixes:
- Bump pypi packages
## v1.13.2
### 🐛 Bug Fixes:
- Fix KeyError: 'authorizeResponse' in auth flow #318
## v1.13.1
### 🐛 Bug Fixes:
- Fix missing charging system state `error` #314
- Move `object_id` to `default_entity_id` for mqtt entities according to #312
## v1.13.0
### 🚀 Features:
+1 -1
View File
@@ -1,6 +1,6 @@
name: "Volvo2Mqtt"
description: "Volvo AAOS MQTT bridge"
version: "1.13.0"
version: "1.13.3"
slug: "volvo2mqtt"
init: false
url: "https://github.com/Dielee/volvo2mqtt"
+3 -2
View File
@@ -1,6 +1,6 @@
from config import settings
VERSION = "v1.13.0"
VERSION = "v1.13.3"
OAUTH_TOKEN_URL = "https://volvoid.eu.volvocars.com/as/token.oauth2"
OAUTH_AUTH_URL = "https://volvoid.eu.volvocars.com/as/authorization.oauth2"
@@ -61,7 +61,8 @@ availability_topic = "volvoAAOS2mqtt/availability"
charging_system_states = {"CHARGING": "Charging", "IDLE": "Idle",
"FAULT": "Fault", "UNSPECIFIED": "Unspecified",
"DONE": "Done", "SCHEDULED": "Scheduled"}
"DONE": "Done", "SCHEDULED": "Scheduled", "ERROR": "Error",
"DISCHARGING": "Discharging"}
charging_connection_states = {"DISCONNECTED": "Disconnected", "UNSPECIFIED": "Unspecified",
"FAULT": "Fault", "CONNECTED": "Connected"}
+7 -6
View File
@@ -25,8 +25,9 @@ active_schedules = {}
otp_code = None
def connect():
client = mqtt.Client("volvoAAOS2mqtt") if os.environ.get("IS_HA_ADDON") \
else mqtt.Client("volvoAAOS2mqtt_" + settings.volvoData["username"].replace("+", ""))
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, "volvoAAOS2mqtt") \
if os.environ.get("IS_HA_ADDON") \
else mqtt.Client(mqtt.CallbackAPIVersion.VERSION1, "volvoAAOS2mqtt_" + settings.volvoData["username"].replace("+", ""))
if "logging" in settings["mqtt"] and settings["mqtt"]["logging"]:
mqtt_logger = logging.getLogger("mqtt")
@@ -58,7 +59,7 @@ def create_otp_input():
state_topic = otp_mqtt_topic + "/state"
config = {
"name": "Volvo OTP",
"object_id": "volvo_otp",
"default_entity_id": "volvo_otp",
"schema": "state",
"command_topic": otp_mqtt_topic,
"state_topic": state_topic,
@@ -95,7 +96,7 @@ def send_car_images(vin, data, device):
image_topic = f"homeassistant/image/{vin}_{entity['id']}/image_topic"
config = {
"name": entity["name"],
"object_id": f"volvo_{vin}_{entity['id']}",
"default_entity_id": f"volvo_{vin}_{entity['id']}",
"schema": "state",
"icon": "mdi:image-area",
"content_type": "image/png",
@@ -405,7 +406,7 @@ def update_ha_device(entity, vin, state):
logging.debug("Updating icon to " + icon + " for " + entity["id"])
config = {
"name": entity['name'],
"object_id": f"volvo_{vin}_{entity['id']}",
"default_entity_id": f"volvo_{vin}_{entity['id']}",
"schema": "state",
"icon": f"mdi:{icon}" if icon else f"mdi:{entity['icon']}",
"state_topic": f"homeassistant/{entity['domain']}/{vin}_{entity['id']}/state",
@@ -446,7 +447,7 @@ def create_ha_devices():
for entity in volvo.supported_endpoints[vin]:
config = {
"name": entity['name'],
"object_id": f"volvo_{vin}_{entity['id']}",
"default_entity_id": f"volvo_{vin}_{entity['id']}",
"schema": "state",
"icon": f"mdi:{entity['icon']}",
"state_topic": f"homeassistant/{entity['domain']}/{vin}_{entity['id']}/state",
+1 -1
View File
@@ -114,7 +114,7 @@ def authorize(renew_tokenfile=False):
def continue_auth(auth_session, data):
next_url = data["_links"]["continueAuthentication"]["href"].replace("http://", "https://") + "?action=continueAuthentication"
auth = auth_session.get(next_url)
auth = auth_session.post(next_url, data="{}")
if auth.status_code == 200:
return auth.json()