Jetzt lese ich es auch im Post von andlem wo du es geschrieben hast.
Ja, das macht Sinn. Verbessert die Ausfallsicherheit, wenn der Umwandlungsserver dazwischen nicht mehr gebraucht wird.
Jetzt lese ich es auch im Post von andlem wo du es geschrieben hast.
Hi Marc,MarcDerSeemann hat geschrieben: ↑Sa Nov 23, 2024 8:38 am
Die kleinen aber entscheidenden Kniffe sind jetzt:
- openWB wird bei SOC auf „Manuell + Berechnung“ gestellt. Der SOC wird via MQTT gesetzt aber nicht mit dem (überall zu findenden): openWB.lp.1.%Soc sondern mit:
openWB/set/lp/1/manualSoc
- Jetzt kommt NodeRed ins Spiel, bzw. der dort eingesetzte Filter. Dieser blockt die Weiterleitung des SOC solange es keine Wertänderung gibt.
Nodes:Code: Alles auswählen
[{"id":"b3da9059104c47c8","type":"http request","z":"90f78b.543da878","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"http://IP:5000/get_vehicleinfo/VIN","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":330,"y":100,"wires":[["1dfbda7e8303ea5c"]]},{"id":"8cf7fe1150950d01","type":"inject","z":"90f78b.543da878","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"360","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":100,"wires":[["b3da9059104c47c8"]]},{"id":"1dfbda7e8303ea5c","type":"rbe","z":"90f78b.543da878","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload.energy[0].level","topi":"topic","x":510,"y":100,"wires":[["9d90cdc55a161864"]]},{"id":"046b177666c75062","type":"mqtt out","z":"90f78b.543da878","name":"SOC setzen","topic":"openWB/set/lp/1/manualSoc","qos":"0","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"cd7464abf11d1ee0","x":1150,"y":100,"wires":[]},{"id":"9d90cdc55a161864","type":"change","z":"90f78b.543da878","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.energy[0].level","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":910,"y":100,"wires":[["046b177666c75062"]]},{"id":"cd7464abf11d1ee0","type":"mqtt-broker","name":"OpenWB","broker":"192.168.178.31","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]
Ein ganz dickes Dankeschön für das neue psacc-Modul! Habe es letzte Woche mit der 2.1.7 Beta 1 eingerichtet und es funktioniert bisher einwandfrei.andlem hat geschrieben: ↑Mo Dez 02, 2024 10:14 pm Ich habe ein neues SoC-Modul für den PSA Car Controller geschrieben.
Das Modul fragt den SoC nur genau dann ab, wenn er gebraucht wird, während der Ladung wird der SoC aus zum Zählerstand berechnet.
Der Vorteil gegenüber MQTT ist, dass keine zyklische Abfrage über die PSA API mit anschließender Filterung durchgeführt werden muss. Damit werden weniger Anfragen am PSA-Server generiert und die Filterung muss nicht in Node-Red o. ä. durchgeführt werden. Bei zu vielen zyklischen Anfragen könnte PSA sonst den Zugang in Zukunft noch weiter einschränken.
Pull-Request ist erstellt.
Code: Alles auswählen
2025-01-30 11:28:25,287 - {modules.common.configurable_vehicle:56} - {DEBUG:fetch soc_ev3} - Vehicle Instance <class 'modules.vehicles.psacc.config.PSACCVehicleSoc'>
2025-01-30 11:28:25,293 - {modules.common.configurable_vehicle:57} - {DEBUG:fetch soc_ev3} - Calculated SoC-State CalculatedSocState(imported_start=None, manual_soc=None, soc_start=47.0)
2025-01-30 11:28:25,296 - {modules.common.configurable_vehicle:58} - {DEBUG:fetch soc_ev3} - Vehicle Update Data VehicleUpdateData(plug_state=False, charge_state=False, imported=None, battery_capacity=42000, efficiency=90, soc_from_cp=None, timestamp_soc_from_cp=None, soc_timestamp=1737109851.754224)
2025-01-30 11:28:25,299 - {modules.common.configurable_vehicle:59} - {DEBUG:fetch soc_ev3} - General Config GeneralVehicleConfig(use_soc_from_cp=False, request_interval_charging=120, request_interval_not_charging=43200, request_only_plugged=False)
2025-01-30 11:28:25,302 - {modules.common.component_context:26} - {DEBUG:fetch soc_ev3} - Update Komponente ['PSA Car Controller']
2025-01-30 11:28:25,313 - {urllib3.connectionpool:227} - {DEBUG:fetch soc_ev3} - Starting new HTTP connection (1): pitahaya.fritz.box:5000
2025-01-30 11:28:25,313 - {urllib3.connectionpool:227} - {DEBUG:fetch soc_ev3} - Starting new HTTP connection (1): pitahaya.fritz.box:5000
2025-01-30 11:28:25,655 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev3} - http://pitahaya.fritz.box:5000 "GET /get_vehicleinfo/VXKUH... HTTP/1.1" 200 2012
2025-01-30 11:28:25,655 - {urllib3.connectionpool:452} - {DEBUG:fetch soc_ev3} - http://pitahaya.fritz.box:5000 "GET /get_vehicleinfo/VXKUH... HTTP/1.1" 200 2012
2025-01-30 11:28:25,663 - {modules.common.req:32} - {DEBUG:fetch soc_ev3} - Get-Response: {"embedded": null, "links": {"_self": {"deprecation": null, "href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/.../status?profile=endUser", "hreflang": null, "name": null, "profile": null, "templated": null, "title": null, "type": null}, "vehicle": {"deprecation": null, "href": "https://api.groupe-psa.com/connectedcar/v4/user/vehicles/...", "hreflang": null, "name": null, "profile": null, "templated": null, "title": null, "type": null}}, "battery": {"current": null, "voltage": 82.5}, "doors_state": null, "energy": [{"updated_at": "2025-01-30 10:19:26+00:00", "autonomy": 206.0, "battery": null, "charging": {"charging_mode": "Slow", "charging_rate": 56, "next_delayed_time": "PT0S", "plugged": true, "remaining_time": "PT0S", "status": "InProgress"}, "consumption": null, "level": 75.0, "residual": null, "type": "Electric"}], "environment": {"created_at": null, "air": {"temp": 6.5}, "luminosity": {"day": true}}, "ignition": {"type": "Stop"}, "kinetic": {"acceleration": null, "moving": false, "pace": null, "speed": null}, "last_position": {"type": "Feature", "geometry": {"coordinates": [8.55609, 51.73253, 91.0], "type": "Point"}, "properties": {"heading": 69.0, "signal_quality": 9.0, "type": "Acquire", "updated_at": "2025-01-30 08:26:50+00:00"}}, "preconditionning": {"air_conditioning": {"failure_cause": null, "status": "Disabled", "updated_at": "2025-01-30 10:19:23+00:00", "created_at": "2025-01-30 10:19:23+00:00"}}, "privacy": {"state": "None"}, "safety": null, "service": {"type": "Electric", "updated_at": null}, "timed_odometer": {"updated_at": "2025-01-30 10:19:23+00:00", "mileage": 47979.5}}
2025-01-30 11:28:25,681 - {modules.vehicles.json.soc:35} - {DEBUG:fetch soc_ev3} - parse_data: data='{'embedded': None, 'links': {'_self': {'deprecation': None, 'href': 'https://api.groupe-psa.com/connectedcar/v4/user/vehicles/.../status?profile=endUser', 'hreflang': None, 'name': None, 'profile': None, 'templated': None, 'title': None, 'type': None}, 'vehicle': {'deprecation': None, 'href': 'https://api.groupe-psa.com/connectedcar/v4/user/vehicles/...', 'hreflang': None, 'name': None, 'profile': None, 'templated': None, 'title': None, 'type': None}}, 'battery': {'current': None, 'voltage': 82.5}, 'doors_state': None, 'energy': [{'updated_at': '2025-01-30 10:19:26+00:00', 'autonomy': 206.0, 'battery': None, 'charging': {'charging_mode': 'Slow', 'charging_rate': 56, 'next_delayed_time': 'PT0S', 'plugged': True, 'remaining_time': 'PT0S', 'status': 'InProgress'}, 'consumption': None, 'level': 75.0, 'residual': None, 'type': 'Electric'}], 'environment': {'created_at': None, 'air': {'temp': 6.5}, 'luminosity': {'day': True}}, 'ignition': {'type': 'Stop'}, 'kinetic': {'acceleration': None, 'moving': False, 'pace': None, 'speed': None}, 'last_position': {'type': 'Feature', 'geometry': {'coordinates': [8.55609, 51.73253, 91.0], 'type': 'Point'}, 'properties': {'heading': 69.0, 'signal_quality': 9.0, 'type': 'Acquire', 'updated_at': '2025-01-30 08:26:50+00:00'}}, 'preconditionning': {'air_conditioning': {'failure_cause': None, 'status': 'Disabled', 'updated_at': '2025-01-30 10:19:23+00:00', 'created_at': '2025-01-30 10:19:23+00:00'}}, 'privacy': {'state': 'None'}, 'safety': None, 'service': {'type': 'Electric', 'updated_at': None}, 'timed_odometer': {'updated_at': '2025-01-30 10:19:23+00:00', 'mileage': 47979.5}}' pattern='.energy[0].level'
2025-01-30 11:28:26,076 - {modules.vehicles.json.soc:44} - {DEBUG:fetch soc_ev3} - result='75'
2025-01-30 11:28:26,084 - {modules.vehicles.json.soc:35} - {DEBUG:fetch soc_ev3} - parse_data: data='{'embedded': None, 'links': {'_self': {'deprecation': None, 'href': 'https://api.groupe-psa.com/connectedcar/v4/user/vehicles/.../status?profile=endUser', 'hreflang': None, 'name': None, 'profile': None, 'templated': None, 'title': None, 'type': None}, 'vehicle': {'deprecation': None, 'href': 'https://api.groupe-psa.com/connectedcar/v4/user/vehicles/...', 'hreflang': None, 'name': None, 'profile': None, 'templated': None, 'title': None, 'type': None}}, 'battery': {'current': None, 'voltage': 82.5}, 'doors_state': None, 'energy': [{'updated_at': '2025-01-30 10:19:26+00:00', 'autonomy': 206.0, 'battery': None, 'charging': {'charging_mode': 'Slow', 'charging_rate': 56, 'next_delayed_time': 'PT0S', 'plugged': True, 'remaining_time': 'PT0S', 'status': 'InProgress'}, 'consumption': None, 'level': 75.0, 'residual': None, 'type': 'Electric'}], 'environment': {'created_at': None, 'air': {'temp': 6.5}, 'luminosity': {'day': True}}, 'ignition': {'type': 'Stop'}, 'kinetic': {'acceleration': None, 'moving': False, 'pace': None, 'speed': None}, 'last_position': {'type': 'Feature', 'geometry': {'coordinates': [8.55609, 51.73253, 91.0], 'type': 'Point'}, 'properties': {'heading': 69.0, 'signal_quality': 9.0, 'type': 'Acquire', 'updated_at': '2025-01-30 08:26:50+00:00'}}, 'preconditionning': {'air_conditioning': {'failure_cause': None, 'status': 'Disabled', 'updated_at': '2025-01-30 10:19:23+00:00', 'created_at': '2025-01-30 10:19:23+00:00'}}, 'privacy': {'state': 'None'}, 'safety': None, 'service': {'type': 'Electric', 'updated_at': None}, 'timed_odometer': {'updated_at': '2025-01-30 10:19:23+00:00', 'mileage': 47979.5}}' pattern='.energy[0].autonomy'
2025-01-30 11:28:26,457 - {modules.vehicles.json.soc:44} - {DEBUG:fetch soc_ev3} - result='206'
2025-01-30 11:28:26,459 - {modules.vehicles.json.soc:72} - {DEBUG:fetch soc_ev3} - timestamp_pattern='.energy[0].updated_at'
2025-01-30 11:28:26,464 - {modules.vehicles.json.soc:35} - {DEBUG:fetch soc_ev3} - parse_data: data='{'embedded': None, 'links': {'_self': {'deprecation': None, 'href': 'https://api.groupe-psa.com/connectedcar/v4/user/vehicles/.../status?profile=endUser', 'hreflang': None, 'name': None, 'profile': None, 'templated': None, 'title': None, 'type': None}, 'vehicle': {'deprecation': None, 'href': 'https://api.groupe-psa.com/connectedcar/v4/user/vehicles/...', 'hreflang': None, 'name': None, 'profile': None, 'templated': None, 'title': None, 'type': None}}, 'battery': {'current': None, 'voltage': 82.5}, 'doors_state': None, 'energy': [{'updated_at': '2025-01-30 10:19:26+00:00', 'autonomy': 206.0, 'battery': None, 'charging': {'charging_mode': 'Slow', 'charging_rate': 56, 'next_delayed_time': 'PT0S', 'plugged': True, 'remaining_time': 'PT0S', 'status': 'InProgress'}, 'consumption': None, 'level': 75.0, 'residual': None, 'type': 'Electric'}], 'environment': {'created_at': None, 'air': {'temp': 6.5}, 'luminosity': {'day': True}}, 'ignition': {'type': 'Stop'}, 'kinetic': {'acceleration': None, 'moving': False, 'pace': None, 'speed': None}, 'last_position': {'type': 'Feature', 'geometry': {'coordinates': [8.55609, 51.73253, 91.0], 'type': 'Point'}, 'properties': {'heading': 69.0, 'signal_quality': 9.0, 'type': 'Acquire', 'updated_at': '2025-01-30 08:26:50+00:00'}}, 'preconditionning': {'air_conditioning': {'failure_cause': None, 'status': 'Disabled', 'updated_at': '2025-01-30 10:19:23+00:00', 'created_at': '2025-01-30 10:19:23+00:00'}}, 'privacy': {'state': 'None'}, 'safety': None, 'service': {'type': 'Electric', 'updated_at': None}, 'timed_odometer': {'updated_at': '2025-01-30 10:19:23+00:00', 'mileage': 47979.5}}' pattern='.energy[0].updated_at'
2025-01-30 11:28:26,855 - {modules.vehicles.json.soc:44} - {DEBUG:fetch soc_ev3} - result='2025-01-30 10:19:26+00:00'
2025-01-30 11:28:26,858 - {modules.common.configurable_vehicle:67} - {DEBUG:fetch soc_ev3} - Requested start soc from api: 75.0%
2025-01-30 11:28:26,861 - {modules.common.store._api:26} - {DEBUG:fetch soc_ev3} - Raw data CarState(soc=75.0, range=206, soc_timestamp=1738232366)
2025-01-30 11:28:26,893 - {modules.common.store._api:31} - {INFO:store soc_ev3} - Saving CarState(soc=75.0, range=206, soc_timestamp=1738232366)