keys = [
("climatisation", "climatisationStatus", "value", "carCapturedTimestamp"),
("climatisation", "climatisationStatus", "value", "climatisationState"),
("charging", "chargingStatus", "value", "carCapturedTimestamp"),
("charging", "plugStatus", "value", "plugConnectionState"),
("charging", "chargingStatus", "value", "chargingState"),
("charging", "chargingStatus", "value", "chargePower_kW")
]
def get_nested(data, path):
"""Liest einen verschachtelten Key-Pfad aus und gibt None zurück, falls er fehlt."""
d = data
for key in path:
if isinstance(d, dict) and key in d:
d = d[key]
else:
return None
return d
timestamp1 = get_nested(data, keys[0])
cli_state = get_nested(data, keys[1])
timestamp2 = get_nested(data, keys[2])
plu_state = get_nested(data, keys[3])
cha_state = get_nested(data, keys[4])
cha_power = get_nested(data, keys[5])
if all(var is not None for var in (timestamp1,cli_state)):
print(f" Klimatisierungs-Zeitstempel : {timestamp1}\t{cli_state}")
if all(var is not None for var in (timestamp2,plu_state,cha_state,cha_power)):
print(f" Charging-Zeitstempel : {timestamp2}\t{plu_state}\t{cha_state}\t{cha_power}")
time.sleep(1)
#############################added debug code #############################
return data
Problem description:
Issuing commands to the vehicle e.g. climatization start / stop or wake - sleep works fine
Updating of the related topics either works delayed or not at all,
Observations
carconnectivity-plugins\mqtt\mqtt-client
def method: _oncarconnectivity_event
tyical behaviour
debug log:
carconnectivity_connectors\volkswagen\connector.py
def fetch data...
debug log; e.g. on connecting the car to a wallbox at 21.53:15 GMT+1
remark: carconnectiviyt has been started appr. at 21:45, but not reaction in mqtt client / explorer
Used hardware and software
VW ID.7 SW 5.2 online
Windows 11 25H2
Python 3.13 IDLE environment
carconnectivity-mqtt package 0.9.2.
carconnectivity-connector-volkswagen 0.9.2.
mqtt explorer on local host Port 1884
config File: intervall 300, broker: local host port 1884