Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volvo-connect: unauthorized_client #16726

Closed
1 task done
triple-it opened this issue Oct 18, 2024 · 77 comments
Closed
1 task done

volvo-connect: unauthorized_client #16726

triple-it opened this issue Oct 18, 2024 · 77 comments
Labels
devices Specific device support wontfix This will not be worked on

Comments

@triple-it
Copy link
Contributor

Describe the bug

Hi..
Is the (hard-coded) client suddenly become invalid?

[volvo-cc] TRACE 2024/10/18 21:28:49 POST https://volvoid.eu.volvocars.com/as/token.oauth2
[volvo-cc] TRACE 2024/10/18 21:28:49 access_token_manager_id=JWTh4Yf0b&grant_type=password&password=***&scope=openid+vehicle%3Aattributes+energy%3Arecharge_status+energy%3Abattery_charge_level+energy%3Aelectric_range+energy%3Aestimated_charging_time+energy%3Acharging_connection_status+energy%3Acharging_system_status+conve%3Afuel_status+conve%3Aodometer_status+conve%3Aenvironment&username=***
--
{"error":"unauthorized_client"}
[main  ] ERROR 2024/10/18 21:28:49 creating vehicle db:1 failed: cannot create vehicle type 'template': cannot create vehicle type 'volvo-connected': unexpected status: 400 (Bad Request)

This is in the code

const (
	managerId = "JWTh4Yf0b"
	basicAuth = "Basic aDRZZjBiOlU4WWtTYlZsNnh3c2c1WVFxWmZyZ1ZtSWFEcGhPc3kxUENhVXNpY1F0bzNUUjVrd2FKc2U0QVpkZ2ZJZmNMeXc="
)

Steps to reproduce

curl -X POST https://volvoid.eu.volvocars.com/as/token.oauth2
-H "Authorization: Basic aDRZZjBiOlU4WWtTYlZsNnh3c2c1WVFxWmZyZ1ZtSWFEcGhPc3kxUENhVXNpY1F0bzNUUjVrd2FKc2U0QVpkZ2ZJZmNMeXc="
-H "Content-Type: application/x-www-form-urlencoded"
-d "access_token_manager_id=JWTh4Yf0b"
-d "grant_type=password"
-d "username=invalid_user_does_not_matter"
-d "password=invalid_pass_does_not_matter"
-d "scope=openid vehicle:attributes energy:recharge_status energy:battery_charge_level energy:electric_range energy:estimated_charging_time energy:charging_connection_status energy:charging_system_status conve:fuel_status conve:odometer_status conve:environment"

{"error":"unauthorized_client"}

Configuration details

Not appliccable

Log details

{"error":"unauthorized_client"}

What type of operating system are you running?

Docker container

Nightly build

  • I have verified that the issue is reproducible with the latest nightly build

Version

0.130.13 (not yet relevant to issue, current master version has same credentials)

@andig
Copy link
Member

andig commented Oct 19, 2024

Seems Volvo has made changes. Do we know which?

@andig andig added the devices Specific device support label Oct 19, 2024
@andig
Copy link
Member

andig commented Oct 19, 2024

@mmierke
Copy link

mmierke commented Oct 20, 2024

I don't know what they have changed, but I can confirm that Volvo2mqtt is working again.

@mmierke
Copy link

mmierke commented Oct 20, 2024

@mmierke
Copy link

mmierke commented Oct 20, 2024

They have updated to V2 API. What ever that means.

@mmierke
Copy link

mmierke commented Oct 20, 2024

There is a volvo.py in that repository src/volvo.py

@andig
Copy link
Member

andig commented Oct 20, 2024

Seems this requires 2FA now which we don't support. Long time ago, we've asked Volvo to unboard us on their official APIs. This hasn't happened. We're not going to add more ugly workaround.

@mmierke
Copy link

mmierke commented Oct 20, 2024

So back to the generic car.

@mmierke
Copy link

mmierke commented Oct 20, 2024

But is this
As of version v1.9.0, this addon uses the same OTP authentication as the Volvo app. The following steps are required for authentication in exactly this order:

Setup volvo2Mqtt, either via Docker, or via HA addon (take a look at the "Setup" section below)

Fill in your settings and start volvo2Mqtt

Your log will show the following lines
Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 0/15
Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 1/15
etc ...

Now, open your mailbox and copy your OTP Code

Open HomeAssistant and search for the entity ID text.volvo_otp

Paste your OTP into the text entity and press Enter
6a. (optional) If your OTP cannot be safed, try to paste your OTP code via MQTT to the following topic: volvoAAOS2mqtt/otp_code

OTP Post Script

If everything has worked, your addon is now authenticated. In the future, OTP authentication only needs to be done when updating, not when restarting the container.

really an ugly workaround?

@FritsStau
Copy link

I've got a bad request 400 error on my Volvo template running Evcc as an addon in HS. Does this mean that we cannot use the templates in evcc due to the 2FA on Volvo's side?

@MichielVanwelsenaere
Copy link

I've got a bad request 400 error on my Volvo template running Evcc as an addon in HS. Does this mean that we cannot use the templates in evcc due to the 2FA on Volvo's side?

yes, that's exactly what it means.
+1 on this issue.

@mmierke
Copy link

mmierke commented Oct 21, 2024

What is the reason behind 2FA not being supported?

@mmierke
Copy link

mmierke commented Oct 21, 2024

I understand, that in the yaml approach it is complicated to integrate 2FA, but with the new configuration screen it should be possible to redirect to Volvo and deal with 2FA.

There is even a kind of exmaple flow.

https://github.com/volvo-cars/developer-portal-api-samples/tree/main/oauth2-code-flow-sample

@andig
Copy link
Member

andig commented Oct 21, 2024

That's exactly the API that Volvo has not onboarded us on... Once they do that's the way to go.

@andig andig added the wontfix This will not be worked on label Oct 21, 2024
@triple-it
Copy link
Contributor Author

triple-it commented Oct 21, 2024

That's exactly the API that Volvo has not onboarded us on... Once they do that's the way to go.

Ah, so you didn't receive a client_id? And the app is not yet published by Volvo?
Who should we have to e-mail at Volvo to ask for more information? Do you have any contacts for us?

@mmierke
Copy link

mmierke commented Oct 21, 2024

I think you can get a client id without even having a Volvo. But somehow the evcc user needs to login with his or her client id to get connected to their cars.

@andig Where are you stuck in the process of onboarding?

https://developer.volvocars.com/apis/docs/authorisation/

@mmierke
Copy link

mmierke commented Oct 21, 2024

But you should be able to onboard even with your github account

grafik

@triple-it
Copy link
Contributor Author

Idea: Creating a volvoAAOS2mqtt vehicle type?
(Using: https://github.com/Dielee/volvo2mqtt)

Playing with the idea, i unfortunately see that the DemoCar VIN is not very supportive.. so some real data is needed.

app-1  | Oct 21 13:14:22 volvo2mqtt [1] - INFO: Vin: ['LPSEFAVS2NPOLDEMO'] found!
app-1  | Oct 21 13:14:22 volvo2mqtt [1] - ERROR: API Call failed. Status Code: 403. Error: {
app-1  |   "status" : 403,
app-1  |   "operationId" : "ff862ec3-f787-4a09-89db-f21d6a3d1472",
app-1  |   "error" : {
app-1  |     "message" : "FORBIDDEN",
app-1  |     "description" : "No relationship to UUID"
app-1  |   }
app-1  | }
app-1  | Oct 21 13:14:22 volvo2mqtt [1] - INFO: Failed, Battery Charge Level is unfortunately not supported by your vehicle.

But a real VIN is very responsive with the following data every 300 seconds on mqtt...

volvoAAOS2mqtt/availability online
homeassistant/sensor/ANONYMIZED_VIN_battery_charge_level/state 75.0
homeassistant/sensor/volvoAAOS2mqtt/ANONYMIZED_VIN_battery_charge_level/config {"name": "Battery Charge Level", "object_id": "volvo_ANONYMIZED_VIN_battery_charge_level", "schema": "state", "icon": "mdi:battery-70", "state_topic": "homeassistant/sensor/ANONYMIZED_VIN_battery_charge_level/state", "device": {"identifiers": ["volvoAAOS2mqtt_ANONYMIZED_VIN"], "manufacturer": "Volvo", "model": "EX30", "name": "EX30 (2025) - ANONYMIZED_VIN"}, "unique_id": "volvoAAOS2mqtt_ANONYMIZED_VIN_battery_charge_level", "availability_topic": "volvoAAOS2mqtt/availability", "device_class": "battery", "unit_of_measurement": "%", "state_class": "measurement"}
homeassistant/sensor/ANONYMIZED_VIN_battery_capacity/state 66.0
homeassistant/sensor/ANONYMIZED_VIN_electric_range/state 356
homeassistant/sensor/ANONYMIZED_VIN_estimated_charging_time/state 0
homeassistant/sensor/ANONYMIZED_VIN_charging_system_status/state Done
homeassistant/sensor/ANONYMIZED_VIN_charging_connection_status/state Connected AC
homeassistant/sensor/ANONYMIZED_VIN_odometer/state 1436
homeassistant/sensor/ANONYMIZED_VIN_last_data_update/state 21.10.2024, 12:55:40
homeassistant/sensor/ANONYMIZED_VIN_active_schedules/attributes {"timers": []}
homeassistant/binary_sensor/ANONYMIZED_VIN_window_front_left/state OFF
homeassistant/binary_sensor/ANONYMIZED_VIN_window_front_right/state OFF
homeassistant/binary_sensor/ANONYMIZED_VIN_window_rear_left/state OFF
homeassistant/binary_sensor/ANONYMIZED_VIN_window_rear_right/state OFF
homeassistant/binary_sensor/ANONYMIZED_VIN_door_front_left/state OFF
homeassistant/binary_sensor/volvoAAOS2mqtt/ANONYMIZED_VIN_door_front_left/config {"name": "Door Front Left", "object_id": "volvo_ANONYMIZED_VIN_door_front_left", "schema": "state", "icon": "mdi:car-door-lock", "state_topic": "homeassistant/binary_sensor/ANONYMIZED_VIN_door_front_left/state", "device": {"identifiers": ["volvoAAOS2mqtt_ANONYMIZED_VIN"], "manufacturer": "Volvo", "model": "EX30", "name": "EX30 (2025) - ANONYMIZED_VIN"}, "unique_id": "volvoAAOS2mqtt_ANONYMIZED_VIN_door_front_left", "availability_topic": "volvoAAOS2mqtt/availability", "device_class": "door"}
homeassistant/binary_sensor/ANONYMIZED_VIN_door_front_right/state OFF
homeassistant/binary_sensor/volvoAAOS2mqtt/ANONYMIZED_VIN_door_front_right/config {"name": "Door Front Right", "object_id": "volvo_ANONYMIZED_VIN_door_front_right", "schema": "state", "icon": "mdi:car-door-lock", "state_topic": "homeassistant/binary_sensor/ANONYMIZED_VIN_door_front_right/state", "device": {"identifiers": ["volvoAAOS2mqtt_ANONYMIZED_VIN"], "manufacturer": "Volvo", "model": "EX30", "name": "EX30 (2025) - ANONYMIZED_VIN"}, "unique_id": "volvoAAOS2mqtt_ANONYMIZED_VIN_door_front_right", "availability_topic": "volvoAAOS2mqtt/availability", "device_class": "door"}
homeassistant/binary_sensor/ANONYMIZED_VIN_door_rear_left/state OFF
homeassistant/binary_sensor/volvoAAOS2mqtt/ANONYMIZED_VIN_door_rear_left/config {"name": "Door Rear Left", "object_id": "volvo_ANONYMIZED_VIN_door_rear_left", "schema": "state", "icon": "mdi:car-door-lock", "state_topic": "homeassistant/binary_sensor/ANONYMIZED_VIN_door_rear_left/state", "device": {"identifiers": ["volvoAAOS2mqtt_ANONYMIZED_VIN"], "manufacturer": "Volvo", "model": "EX30", "name": "EX30 (2025) - ANONYMIZED_VIN"}, "unique_id": "volvoAAOS2mqtt_ANONYMIZED_VIN_door_rear_left", "availability_topic": "volvoAAOS2mqtt/availability", "device_class": "door"}
homeassistant/binary_sensor/ANONYMIZED_VIN_door_rear_right/state OFF
homeassistant/binary_sensor/volvoAAOS2mqtt/ANONYMIZED_VIN_door_rear_right/config {"name": "Door Rear Right", "object_id": "volvo_ANONYMIZED_VIN_door_rear_right", "schema": "state", "icon": "mdi:car-door-lock", "state_topic": "homeassistant/binary_sensor/ANONYMIZED_VIN_door_rear_right/state", "device": {"identifiers": ["volvoAAOS2mqtt_ANONYMIZED_VIN"], "manufacturer": "Volvo", "model": "EX30", "name": "EX30 (2025) - ANONYMIZED_VIN"}, "unique_id": "volvoAAOS2mqtt_ANONYMIZED_VIN_door_rear_right", "availability_topic": "volvoAAOS2mqtt/availability", "device_class": "door"}
homeassistant/binary_sensor/ANONYMIZED_VIN_tailgate/state OFF
homeassistant/binary_sensor/ANONYMIZED_VIN_engine_hood/state OFF
homeassistant/binary_sensor/ANONYMIZED_VIN_tank_lid/state ON
homeassistant/binary_sensor/ANONYMIZED_VIN_sunroof/state OFF
homeassistant/switch/ANONYMIZED_VIN_climate_status/state OFF
homeassistant/lock/ANONYMIZED_VIN_lock_status/state LOCKED
homeassistant/lock/volvoAAOS2mqtt/ANONYMIZED_VIN_lock_status/config {"name": "Lock state", "object_id": "volvo_ANONYMIZED_VIN_lock_status", "schema": "state", "icon": "mdi:lock", "state_topic": "homeassistant/lock/ANONYMIZED_VIN_lock_status/state", "device": {"identifiers": ["volvoAAOS2mqtt_ANONYMIZED_VIN"], "manufacturer": "Volvo", "model": "EX30", "name": "EX30 (2025) - ANONYMIZED_VIN"}, "unique_id": "volvoAAOS2mqtt_ANONYMIZED_VIN_lock_status", "availability_topic": "volvoAAOS2mqtt/availability", "command_topic": "homeassistant/lock/ANONYMIZED_VIN_lock_status/command"}
homeassistant/device_tracker/ANONYMIZED_VIN_location/attributes {"longitude": "<REDACTED>", "latitude": "<REDACTED>", "gps_accuracy": 1}
homeassistant/sensor/ANONYMIZED_VIN_tyre_front_left/state NO_WARNING
homeassistant/sensor/ANONYMIZED_VIN_tyre_front_right/state NO_WARNING
homeassistant/sensor/ANONYMIZED_VIN_tyre_rear_left/state NO_WARNING
homeassistant/sensor/ANONYMIZED_VIN_tyre_rear_right/state NO_WARNING
homeassistant/binary_sensor/ANONYMIZED_VIN_engine_state/state OFF
homeassistant/binary_sensor/volvoAAOS2mqtt/ANONYMIZED_VIN_engine_state/config {"name": "Engine State", "object_id": "volvo_ANONYMIZED_VIN_engine_state", "schema": "state", "icon": "mdi:engine-off-outline", "state_topic": "homeassistant/binary_sensor/ANONYMIZED_VIN_engine_state/state", "device": {"identifiers": ["volvoAAOS2mqtt_ANONYMIZED_VIN"], "manufacturer": "Volvo", "model": "EX30", "name": "EX30 (2025) - ANONYMIZED_VIN"}, "unique_id": "volvoAAOS2mqtt_ANONYMIZED_VIN_engine_state", "availability_topic": "volvoAAOS2mqtt/availability", "device_class": "running"}
homeassistant/sensor/ANONYMIZED_VIN_distance_to_empty_battery/state 356
homeassistant/sensor/ANONYMIZED_VIN_km_to_service/state 28564
homeassistant/sensor/ANONYMIZED_VIN_time_to_service/state 19 months
homeassistant/sensor/ANONYMIZED_VIN_service_warning_status/state NO_WARNING
homeassistant/sensor/ANONYMIZED_VIN_washer_fluid_warning/state NO_WARNING
homeassistant/sensor/ANONYMIZED_VIN_api_backend_status/state NO_WARNING
homeassistant/number/ANONYMIZED_VIN_update_interval/state 300

So this requires only to have a volvo2mqtt-app (https://github.com/Dielee/volvo2mqtt) installed, and a volvo-mqtt vehicle type to be created.

I would rather have a nice and clean programmed evcc go implementation of the volvo API in place of course.

But in the meantime, while we wait for volvo, it doesn't feel too kludgy for me to:

  • Create a mqtt vehicle type (Could be re-used for future mqtt vehicles ...)
  • Pull in a well supported homeassistant vehicle data via MQTT: volvoAAOS2mqtt

Any ideas/thoughts for the volvoAAOS2mqtt vehicle type support?

@andig
Copy link
Member

andig commented Oct 21, 2024

We have the same for Mazda, happy tonsuppoert a PR.

@mmierke
Copy link

mmierke commented Oct 21, 2024

evcc yaml:

vehicles:

  • name: myCar
    title: Volvo XC60 Recharge
    type: custom
    icon: car
    capacity: 19
    phases: 2
    onIdentify:
    mode: pv # enable PV-charging when vehicle is identified (minpv|now|off|pv)
    soc: # battery soc (%)
    source: http
    uri: http://xxx.xxx.xxx.xxx:8123/api/states/sensor.volvo_battery_charge_level
    method: GET # default HTTP method
    headers:
    - authorization: Bearer
    - content-type: application/json
    jq: .state | tonumber # parse response json
    range: # optional electric range (km)
    source: http
    uri: http://xxx.xxx.xxx.xxx:8123/api/states/sensor.volvo
    electric_range
    method: GET # default HTTP method
    headers:
    - authorization: Bearer
    - content-type: application/json
    jq: .state | tonumber # parse response json
    odometer:
    source: http
    uri: http://xxx.xxx.xxx.xxx:8123/api/states/sensor.volvo
    _odometer
    method: GET # default HTTP method
    headers:
    - authorization: Bearer
    - content-type: application/json
    jq: .state | tonumber # parse response json
    status:
    source: http
    uri: http://xxx.xxx.xxx.xxx:8123/api/states/sensor.xc60_charging_status_a_f
    method: GET # default HTTP method
    headers:
    - authorization: Bearer
    - content-type: application/json
    jq: .state # parse response json

helper sensor (sensor.xc60_charging_status_a_f):

{% if is_state("sensor.volvo_charging_connection_status","Disconnected")-%}
A
{%- elif is_state("sensor.volvo
charging_connection_status","Connected AC")-%}
{% if is_state("sensor.volvo
_charging_system_status","Charging")-%}
C
{%- else -%}
B
{%- endif %}
{%- else -%}
F
{%- endif %}

@mmierke
Copy link

mmierke commented Oct 21, 2024

So basically, because I use evcc as an add on in ha, I have created a vehicle, that pulls the values from HA directly

@andig andig closed this as completed Oct 21, 2024
@mmierke
Copy link

mmierke commented Oct 21, 2024

You need to create a bearer token

@Robbi12
Copy link

Robbi12 commented Oct 22, 2024

Hallo. mmierke ich hätte eine Frage. Funktioniert das auch wenn ich homeassistant nicht habe. Ich habe nur den iobroker. Was muss ich denn nun genau eingeben.

Vielleicht kannst du mir helfen

@triple-it
Copy link
Contributor Author

Gutentag Robbi12.

I think mmierke uses the REST api from homeassistant, to pull in the data for evcc (where evcc is again an addon for ha to make things complicated :-) ).

I am using evcc using #16771 with just volvo2mqtt without homeassistant.
So I am using an evcc "volvo2mqtt" vehicle template, instead of volvo or volvo-connected, which just uses volvo2mqtt which was written for homeassistant, but is standalone usable.

In the template there are homeassistant topic paths, but I am not using homeassistant....

  soc:
    source: mqtt
    topic: homeassistant/sensor/{{ .vin }}_battery_charge_level/state
    timeout: {{ .timeout }}

Maybe you could test that path too?

@martijnvangeffen
Copy link

martijnvangeffen commented Oct 22, 2024

Quistion why dont we move to full oauth as per Powershell i can still pull the data: (No 2FA done anywhere)

image

@martijnvangeffen
Copy link

which just uses volvo2mqtt which was written for homeassistant, but is standalone usable.

Can you explain a little more on how to do this ?

@triple-it
Copy link
Contributor Author

which just uses volvo2mqtt which was written for homeassistant, but is standalone usable.

Can you explain a little more on how to do this ?

sure...

Install Dielee/volvo2mqtt, just follow their instructions. (This is with OTP btw)
Install evcc/vehicle/volvo2mqtt template which is lurking the data from Dielee/volvo2mqtt

Some more info and test config is placed in PR #16771

@lahlor2
Copy link

lahlor2 commented Oct 26, 2024

Ich muss mich nun hier auch nochmal einmischen. Ich als auch Freund&Bekannte nutzen evcc als "Standalone" Lösung auf einem Linux Server (Pi, Custom Build Ubunutu etc.) und haben bisher das volvo-connect template verwendet.
Dies schlägt nun bei uns allen fehl (XC90, XC40..).
Ich verstehe, dass es seitens Volvo ein Anpassung gab, aber ich verstehe nicht, wieso ich nun mit MQTT, HomeAssistant oder Proxmox oder sonstigen 3rd Party Lösungen einen Workaround finden muss. 1. ist es viel zu komplex meiner Meinung nach, 2. brauchte ich es vorher ja auch nicht.
Daher meine direkte (nicht böse gemeinte) Frage:
Wird es in naher Zukunft seitens EVCC eine direkte implementierung der "neuen" API Anbindung von Volvo geben, sodass es ohne Zusatzsoftware wieder einsetzbar ist?

@mmierke
Copy link

mmierke commented Oct 26, 2024

@lahlor2 Wenn ich andig's früheren Kommentar und das Schließen des Issues richtig interpretiere, hat sich der Fall für ihn erledigt.

@mmierke
Copy link

mmierke commented Oct 26, 2024

@Robbi12 Wenn du magst, können wir uns dein Setup mal zusammen ansehen.

@FritsStau
Copy link

I've got this all working again through Volvo2mqtt. But now I have a feeling my car is a bit too exposed because it has the same control as the native Volvo app. Is there a way to block this on the Volvo side of things?

@lahlor2
Copy link

lahlor2 commented Oct 26, 2024

@lahlor2 Wenn ich andig's früheren Kommentar und das Schließen des Issues richtig interpretiere, hat sich der Fall für ihn erledigt.

Ich bin jetzt nicht genau durchgestiegen aber wenn ich es richtig lese, dann kann evcc kein Volvo mehr anbieten? Verstehe ich das richtig?

Habe mich dann mal an die ganzen MQTT HA etc Themen gesetzt und mal getestet. Als Laie, der so erstmal mit MQTT/HA und co nichts zu tun hat - alles sehr unverständlich und unlösbar.
Gibt es irgendjemanden, der das Thema mal inhaltlich so aufarbeiten kann, dass man es versteht und vorallem weioß was ich nun genau brauche?
Habe z.B. kein HA und nur eine kleine Ubuntu Linux Kiste.
Wenn ich z.B. wie in einem Post hier nur die volvo2mqtt Lösung via Docker installieren, dann kommt im Docker Log folgender Fehler.

ct 26 23:02:20 volvo2mqtt [1] - INFO: Starting volvo2mqtt version v1.10.3
Traceback (most recent call last):
  File "/volvoAAOS2mqtt/./main.py", line 14, in <module>
    connect()
  File "/volvoAAOS2mqtt/mqtt.py", line 39, in connect
    client.connect(settings["mqtt"]["broker"], port)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.9/socket.py", line 856, in create_connection
    raise err
  File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Ich habe "außerhalb" von Docker einen Mosquitto MQTT Broker laufen, ob der aber nun auch korrekt luft etc - keine Ahnung. Also mMn alles sehr undurchsichtig und eine super Bastellösung.
Versteht mich nicht falsch - aber das ist mehr als nicht zufriedenstellend.
Ich bin für jede Hilfe dankbar, da ich hinter mir noch 2 Installationen stehen habe, die dasselbe Problem haben und schnellstmöglich nach eine Lösung schreien.

@Robbi12
Copy link

Robbi12 commented Oct 26, 2024

Hallo ich bräuchte auch noch Hilfe. Habe nun stundenlang probiert.
Ich würde gerne Volvo2mqtt mit Homeassistant laufen lassen. Dies klappt auch, aber nur mit einem mqtt broker auf homeassistant. Egal was ich eingebe (Internetadresse von meinem MQTT Broker in Iobroker oder den Port) nichts wird genommen. Ich kann lediglich mit auto_broker und auto_port arbeiten.

Nun würde ich aber gerne vom Iobroker evcc steuern. Dies klappt nicht so gut mit dem EVCC Adapter. Vorher hatte es wunderbar mit dem mqtt broker vom iobroker geklappt, dessen Daten in Evcc waren. In Evcc habe ich ja nun den Homeassistant Broker drin. Oder könnte ich in EVCC zwei MQTT Broker eintragen und wenn ja, wie?

@lahlor2
Copy link

lahlor2 commented Oct 26, 2024

@lahlor2 Wenn ich andig's früheren Kommentar und das Schließen des Issues richtig interpretiere, hat sich der Fall für ihn erledigt.

Ich bin jetzt nicht genau durchgestiegen aber wenn ich es richtig lese, dann kann evcc kein Volvo mehr anbieten? Verstehe ich das richtig?

Habe mich dann mal an die ganzen MQTT HA etc Themen gesetzt und mal getestet. Als Laie, der so erstmal mit MQTT/HA und co nichts zu tun hat - alles sehr unverständlich und unlösbar. Gibt es irgendjemanden, der das Thema mal inhaltlich so aufarbeiten kann, dass man es versteht und vorallem weioß was ich nun genau brauche? Habe z.B. kein HA und nur eine kleine Ubuntu Linux Kiste. Wenn ich z.B. wie in einem Post hier nur die volvo2mqtt Lösung via Docker installieren, dann kommt im Docker Log folgender Fehler.

ct 26 23:02:20 volvo2mqtt [1] - INFO: Starting volvo2mqtt version v1.10.3
Traceback (most recent call last):
  File "/volvoAAOS2mqtt/./main.py", line 14, in <module>
    connect()
  File "/volvoAAOS2mqtt/mqtt.py", line 39, in connect
    client.connect(settings["mqtt"]["broker"], port)
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 914, in connect
    return self.reconnect()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1044, in reconnect
    sock = self._create_socket_connection()
  File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
    return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
  File "/usr/local/lib/python3.9/socket.py", line 856, in create_connection
    raise err
  File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Ich habe "außerhalb" von Docker einen Mosquitto MQTT Broker laufen, ob der aber nun auch korrekt luft etc - keine Ahnung. Also mMn alles sehr undurchsichtig und eine super Bastellösung. Versteht mich nicht falsch - aber das ist mehr als nicht zufriedenstellend. Ich bin für jede Hilfe dankbar, da ich hinter mir noch 2 Installationen stehen habe, die dasselbe Problem haben und schnellstmöglich nach eine Lösung schreien.

Mein lieber Herr Gesangsverein war das ein Ritt 😆

Ich möchte nun mal meine Erfahrungen und Ergebnisse zusammenfassen, damit vielleicht auch andere eine schnelle Volvo Lösung haben.

Grundlage bei mir:

  • evcc Versionn v0.131.1 auf Ubuntu
  • Mosquitto MQTT Broker
  • Docker

Wie ihr evcc installiert wisst ihr 😆
Die andere Software ist neben der evcc Installation auf dem Ubunutu installiert. Ich denke es lässt sich auch einfach auf andere Linux Derivate adaptieren. Wichtig ist sicher nachfolgend die Config etc.

Mosquitto

sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa sudo apt-get update sudo apt-get install mosquitto

Dann noch eine passende Konfiguration erstellen unter /etc/mosquitto/mosquitto.conf
Achtung hier muss eure IP eingetragen werden.

`
persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d
per_listener_settings false
allow_anonymous false
password_file /etc/mosquitto/password
bind_address
`
Die "password" Datei erstellen wir dann mit Hilfe des Befehls

mosquitto_passwd -c /etc/mosquito/password user

Hier kommt der User/Passwort rein, der dann den Broker mit Daten beladen kann/darf. Der Nutzer in dem Beispiel heißt "user".

Abschließend den Service einmal neu starten

sudo systemctl restart mosquitto.service

Dann noch einmal den Status prüfen, der "grün" sein sollte.

sudo systemctl status mosquitto.service

Als nächstes wird Docker insalliert

sudo apt-get install docker sudo apt install docker.io

Nun sind die Grundlagen geschaffen und es kann mit dem "Volvo2mqtt" Addon weitergehen.

Hierzu muss nun ein Docker Container geschaffen werden, der das ganze laufen lässt.
Nutzt hierzu einfach folgenden Befehl und passt unter Umständen die IP des Mosquitto Servers aus dessen Config an, sowie die Login Daten zur Volvo Developer Portal und die ganzen API keys und VIN.

docker run -d --pull=always -e CONF_updateInterval=300 -e CONF_babelLocale='de' -e CONF_mqtt='@json {"broker": "xxx.xxx.xxx.xxx", "username": "user", "password": "xxxxx", "port": 1883}' -e CONF_volvoData='@json {"username": "xxxx", "password": "xxxx", "vin": "xxxxxx", "vccapikey": ["xxxxxx"]}' -e TZ='Europe/Berlin' --name volvo2mqtt ghcr.io/dielee/volvo2mqtt:latest

Im Idealfall bekommt ihr direkt nun eine Mail zugesendet mit dem OTP Key für den Login.
Sollte das nicht der Fall sein, dann schaut mal in die Docker Logs.
Das geht wie folgt.
Ließt den Docker Container ID aus:

user@server:~$ sudo docker container ls -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6f8360fxxxx ghcr.io/dielee/volvo2mqtt:latest "python -u ./main.py" 2 hours ago Up 15 minutes volvo2mqtt
Dann nutzt diese ID für den folgenden Befehl

sudo docker container logs 6f8360fXXXX

Im Besten Fall kommt sowas und zeit euch, dass eine Mail versendet wurde

Oct 27 00:45:03 volvo2mqtt [1] - INFO: Starting volvo2mqtt version v1.10.3 Oct 27 00:45:03 volvo2mqtt [1] - INFO: Starting login with OTP Oct 27 00:45:04 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 0/24 Oct 27 00:45:09 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 1/24 Oct 27 00:45:14 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 2/24 Oct 27 00:45:19 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 3/24 Oct 27 00:45:24 volvo2mqtt [1] - INFO: Waiting for otp code... Please check your mailbox and post your otp code to the following mqtt topic "volvoAAOS2mqtt/otp_code". Retry 4/24

Wenn der Container nicht läuft einfach mittels Befehl starten

sudo docker container start 6f8360fXXXX

Nun kommt der Part, dass wir den OTP Key irgendwie in das System bekommen müssen. Die Anleitung von Volvo2mqtt sagt man solle HomeAssistant nutzen, den haben wir aber hier nicht im Einsatz.
Also habe ich mir eine schnelle kleine Software für Windows im Internet gesucht, mit dessen Hilfe ich die OTP Key via MQTT an den Broker senden kann.
Ich nutze hierzu die Portable Version von "MQTT-Explorer" https://github.com/thomasnordquist/MQTT-Explorer/releases/download/v0.4.0-beta.6/MQTT-Explorer-0.4.0-beta.6.exe >> Hertseller Website https://mqtt-explorer.com/

Hier habe ich die IP des Mosquitto Servers eingegeben inkl. Port User und Passwort.
Dann unter volvoAAOS2mqtt im Baum unter otp_code den wet rechts als json hinterlegt und auf "Publish" geklickt.
Es wurde sofort alles nachgeladen und die Infos aus dem Volvo Portal gezogen!

image

Abschließend muss dann evcc beigebracht werden die Daten via MQTT zu beziehen. Hierzu meine evcc.yaml Konfiguration mit den relevanten Daten. Neu ist der mqtt Part und hier muss dann entsprechend die IP des MQTT Brokers Mosquitto rein, sowie der Benutzername/Passwort.

`
vehicles:

  • name: XC90
    type: template
    template: volvo2mqtt
    title: XC90 # Wird in der Benutzeroberfläche angezeigt (optional)
    vin: XXXXXXXXX # Erforderlich, wenn mehrere Fahrzeuge des Herstellers vorhanden sind (optional)
    capacity: 18.8 # Akkukapazität in kWh (optional)

mqtt: # Mqtt broker is required!
broker: xxx.xxx.xxx.xxx:1883
topic: #
#clientid: evcc
user: user
password: xxxxxx
`
Nach einem Neustart des evcc Dienstes habe ich dann via

evcc vehicle

eine Abfrage gestartet und siehe da, alles wieder an seinem Platz!

Einziges Problem was ich habe, es wird nicht automatisch erkannt, dass ich den Volvo lade. Ich habe kein Standardfahrzeug hinterlegt, mit der alten Volvo-connect Template lief es automatisch. Jetzt wird immer alles als Gastfahrzeug erkannt und ich muss manuell auf den Volvo wechseln.
Vielleicht hat hierzu jemand noch eine Idee oder soll ich nen neuen "Issue" aufmachen?

Ich hoffe ich kann mit dieser Zusammenfassung und Anleitung dem einem oder anderen helfen!

@mmierke
Copy link

mmierke commented Oct 27, 2024

@lahlor2 Ich würde mir mal Proxmox ansehen. Ich habe so einen kleinen Zauberwürfel mit 16GB RAM und 512GB SSSD. Auf dem läuft Proxmox als Virtualisierungsplattform.
grafik
Interessant sind hier eigentlich nur der Container 100 mqtt und die virtuelle Maschine 500 haos.
Bei mir laufen beide auf Debian. Beide habe ich mithilfe dieser Seite aufgebaut => https://helper-scripts.com/

Bei haos würde ich zumindest ssh aktivieren um mithilfe von WinScp und VsCode direkt auf die Konfigurationsdateien zugreifen zu können.
Mqtt habe ich im Container als Service eingerichtet, damit er bei einem Reboot direkt wieder gestartet wird.

Evcc und Volvo2Mqtt laufen bei mir als Addons im HA. Das ist aber nicht zwingend notwendig.

@Robbi12 Wenn ihr mehr Details haben möchtet, können wir gerne ein Slack aufmachen.

@Robbi12
Copy link

Robbi12 commented Oct 27, 2024

Danke mmierke.

So habe ich es ähnlich. Du hast einen eigenen Container mit mqtt. Ich habe dort zigbee2mqtt laufen mit broker drin und auch iobroker mit einem mqtt broker drin.

Also ähnlich.

Was mich interessiert und überhaupt nicht schaffe, wie ich volvo2mqtt im homeassistant einstellen muss, dass er auf meinen Broker (bei dir MQTT bei 100) zugreifen kann. Funktioniert einfach nicht.

@mmierke
Copy link

mmierke commented Oct 27, 2024

Also erstmal habe ich meinem mqtt eine feste IP Addresse gegeben. Das geht über die Netzwerkeinstellungen für den Container und proxmox. Gateway nicht vergessen, sonst funktioniert kein update mehr. Und dann hat mein Mosquitto Server noch ein Passwort. Ich weiß nicht, ob das dein Problem ist. Hier ein Beispiel für die Werte auf der Configuration Seite des Addons in HA.

broker: 192.168.123.456
port: "1883"
username: mosquitto
password: "sdgffgsfgdfg"

@mmierke
Copy link

mmierke commented Oct 27, 2024

Ich hatte früher auch ioBroker und bin dann langsam auf HA umgezogen. Um mir das Leben zu erleichtern habe ich zuerst mqtt in einen eigenen Container verlagert und zigbee2mqtt und in deinem Fall ioBroker mit diesem Verbunden. Also aus 2 mach 1 mqtt broker. Das vereinfacht auch deine gesamte Architektur.

@Robbi12
Copy link

Robbi12 commented Oct 27, 2024

Danke für deine Mühe. Genau so mache ich es. Es funktionier alles bei mir zigbee2mqtt usw.

Wenn ich jedoch die Daten im Homeassistant bei volvo2mqtt eingebe kommt immer folgendes.
Oct 27 12:23:57 volvo2mqtt [106] - INFO: Starting volvo2mqtt version v1.10.2
Traceback (most recent call last):
File "/volvoAAOS2mqtt/main.py", line 14, in
connect()
File "/volvoAAOS2mqtt/mqtt.py", line 39, in connect
client.connect(settings["mqtt"]["broker"], port)
File "/usr/lib/python3.12/site-packages/paho/mqtt/client.py", line 914, in connect
return self.reconnect()
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/paho/mqtt/client.py", line 1044, in reconnect
sock = self._create_socket_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/paho/mqtt/client.py", line 3685, in _create_socket_connection
return socket.create_connection(addr, timeout=self._connect_timeout, source_address=source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/socket.py", line 865, in create_connection
raise exceptions[0]
File "/usr/lib/python3.12/socket.py", line 850, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Nehme ich den eigenen mosquito mqtt im homeassistant mit

auto_broker
auto_port
auto_user
auto_password

funktioniert es.

@mmierke
Copy link

mmierke commented Oct 27, 2024

@Robbi12 Setz mal den Port in ""

@Robbi12
Copy link

Robbi12 commented Oct 27, 2024

Auch schon getestet. Funktioniert nicht.

Dieselbe Fehlermeldung hatte lahlor2 auch bei einem externen broker

@mmierke
Copy link

mmierke commented Oct 27, 2024

@Robbi12 Also bei mir sind Passwort und Port in "". Ich hatte glaube ich ein ähnliches Problem im Anfang

@martijnvangeffen
Copy link

Note IF you install mqtt it by default does not allow connections,

You have to make a configuration change to allow anonomouse connections to localhost.

listener 1883 0.0.0.0
allow_anonymous true

if you use mosquitto you can do it in the mosquitto.conf directly. dont forget to restart the service.

I am running mosquitto mqtt broker with only volvo2mqtt in docker and it works perfectly. using the template provided here

@MartijnvanGeffen13
Copy link

@mmierke

Do your auth also expire after a few days:

image

@mmierke
Copy link

mmierke commented Oct 28, 2024

@MartijnvanGeffen13 once during this weekend. Normally it is stable

@triple-it
Copy link
Contributor Author

triple-it commented Oct 28, 2024

For people who could need some separate docker oneliners or don't want to use the docker-compose:

10_mqtt_docker_onliner.sh:

#docker rm -f mqtt
docker start mqtt > /dev/null && docker logs mqtt && docker attach mqtt || docker run \
--env-file .env \
--name mqtt \
-p 1883:1883 \
eclipse-mosquitto \
/usr/sbin/mosquitto -c /mosquitto-no-auth.conf \
#-d

20_volvo2mqtt_docker_oneliner.sh:

# Load variabels from .env and evaluatue them if necessary
set -o allexport
source .env
set +o allexport
set | grep -E '^(EVCC_|VOLVO_|MQTT_|CONF_|TZ)' > .env.generated

echo Pls run: docker exec -it mqtt  mosquitto_pub -t "volvoAAOS2mqtt/otp_code" -m "{OTP_FROM_EMAIL}"
#docker rm -f volvo2mqtt
docker start volvo2mqtt > /dev/null && docker logs volvo2mqtt && docker attach volvo2mqtt || docker run  \
--pull=always \
--env-file .env.generated \
--name volvo2mqtt \
ghcr.io/dielee/volvo2mqtt:latest \
#-d

30_evcc_docker_oneliner.sh:

source .env
docker start evcc > /dev/null && docker logs evcc && docker attach evcc || docker run \
--env-file .env \
--name evcc \
-v "$(pwd)/evcc.yaml":/etc/evcc.yaml \
-v "$(pwd)/.evcc":/root/.evcc \
-p ${EVCC_PORT_7070}:7070 \
-p ${EVCC_PORT_8887}:8887 \
-p ${EVCC_PORT_7090_UDP}:7090/udp \
-p ${EVCC_PORT_9522_UDP}:9522/udp \
evcc/evcc:nightly \
#-d 

With this .env file..

.env:

# EVCC settings
EVCC_PORT_7070=7070
EVCC_PORT_8887=8887
EVCC_PORT_7090_UDP=7090
EVCC_PORT_9522_UDP=9522

# Volvo2MQTT settings
VOLVO_USERNAME="[email protected]"  # Replace with your Volvo account username
VOLVO_PASSWORD="your_password"              # Replace with your Volvo account password
VIN="your_vin_number"                       # Replace with your VIN number
VCC_API_KEY1="your_vcc_api_key1"            # Replace with your first API key
VCC_API_KEY2="your_vcc_api_key2"            # Replace with your second API key

# MQTT settings
MQTT_BROKER="172.17.0.1"                    # IP for the MQTT broker
MQTT_PORT="1883"                            # Default MQTT port

# Timezone
TZ="Europe/Berlin"                          # Set to your timezone

# Configuration settings
CONF_babelLocale="de"                       # Language setting
CONF_updateInterval=300                     # Update interval in seconds

# JSON formatted configurations (placeholders)
CONF_mqtt="@json {\"broker\": \"${MQTT_BROKER}\", \"username\": \"\", \"password\": \"\", \"port\": \"${MQTT_PORT}\"}"

CONF_volvoData="@json {\"username\": \"${VOLVO_USERNAME}\", \"password\": \"${VOLVO_PASSWORD}\", \"vin\": \"${VIN}\", \"vccapikey\": [\"${VCC_API_KEY1}\", \"${VCC_API_KEY2}\"]}"

evcc.yaml:

# Open EVCC at http://evcc.local:7070
network:
  schema: http
  host: evcc.local  # .local suffix announces the hostname on MDNS
  port: 7070

log: debug
levels:
  cache: error

# Unique installation ID (replace with your own ID)
plant: {unique_plant_id}

interval: 30s  # Control cycle interval

# Sponsor token (replace with actual token if available)
sponsortoken: {sponsortoken}

# Sponsors can set telemetry: true to enable anonymous data aggregation
# See https://github.com/evcc-io/evcc/discussions/4554
telemetry: false

meters:
  - type: template
    template: homewizard
    usage: grid
    host: {homewizard_host}  # Replace with grid meter IP
    name: grid1
  - type: template
    template: enphase
    usage: pv
    host: {enphase_host}  # Replace with Enphase meter IP
    token: {enphase_token}  # Replace with Enphase token
    name: pv2

chargers:
  - type: template
    template: alfen
    id: 1
    host: {charger_host}  # Replace with charger IP
    port: 502
    modbus: tcpip
    name: wallbox3

loadpoints:
  - title: CarPort
    charger: wallbox3
    mode: minpv

vehicles:
  - name: ex30
    title: Volvo EX30
    type: template
    template: volvo2mqtt
    capacity: 67  # Battery capacity in kWh
    vin: {vin}  # Replace with vehicle VIN number

mqtt:
  broker: 172.17.0.1:1883  # Default MQTT broker IP, adjust if necessary
  topic: #
  #clientid: evcc
  #user: evcc
  #password: {mqtt_password}

site:
  title: site1
  meters:
    grid: grid1
    pv:
      - pv2

@Olf1337
Copy link

Olf1337 commented Oct 28, 2024

@mmierke hast du die fahrzeugerkennung hinbekommen? Bei mir muss ich das manuell machen...

@lahlor2
Copy link

lahlor2 commented Oct 29, 2024

@mmierke hast du die fahrzeugerkennung hinbekommen? Bei mir muss ich das manuell machen...

Ist bei mir identisch. Daten sind alle da, aber ich muss das Fahrzeug auch immer manuell auswählen. Wenn da jemand Ideen hat, bin ich sehr dankbar.

@MartijnvanGeffen13
Copy link

Ist bei mir identisch. Daten sind alle da, aber ich muss das Fahrzeug auch immer manuell auswählen. Wenn da jemand Ideen hat, bin ich sehr dankbar.

sorry my german aint that good,

How long did you wait before you manually selected your car, as the default poll is 5 minutes (volvo2mqtt) + your EVCC poll (30 sec) it could take up to 6 minutes till evcc detects (pull and update from mqtt the connected state) your vehicle.

For me i only have 1 car so i dont use detection but have the charger set to always use my EX30. I did however reduce the volvo2mqtt poll time down to 2 minutes to get more accurate SOC specially when you above 90% evcc calculation is off and you need better polling interval. (Hardcoded limit seems to be 60 sec in the repo.)

@Olf1337
Copy link

Olf1337 commented Oct 29, 2024

got it... depends on the interval set in the volvo2mqtt addon + the interval set in EVCC . I've reduced it and will check later.
thanks!

its not working...

@lahlor2
Copy link

lahlor2 commented Nov 2, 2024

got it... depends on the interval set in the volvo2mqtt addon + the interval set in EVCC . I've reduced it and will check later. thanks!

its not working...

Can agree. Waited 15 minutes without any change so only the guestcar is selected.
Has anyone the volvo2mqtt addon running with more than one car and is the volvo selected automatically?

@VolkerK62
Copy link
Contributor

#16988 (reply in thread)

@MartijnvanGeffen13
Copy link

got it... depends on the interval set in the volvo2mqtt addon + the interval set in EVCC . I've reduced it and will check later. thanks!
its not working...

Can agree. Waited 15 minutes without any change so only the guestcar is selected. Has anyone the volvo2mqtt addon running with more than one car and is the volvo selected automatically?

Can you check if your car status is actually connected ?

I just checked my EX30 looks like it never receives the connected status.

Currently i am reverse engineering and buiding a new modules based on volvo2mqtt as the solution itself is not optimal for EVCC, As we constantly wake up the car and pull a lot of data that is not needed for EVCC and we expose more privileges than are actually needed.

I cant give a ETA yet but this issue will also be 1 of the thinks i want to look at for the new module.

@MartijnvanGeffen13
Copy link

Update ,

Released a early Beta version that still needs documentation but stability tests have passed , meaning i will be running this to my production car this week.

I will now focus on EVCC template, documentation and how to, and bootup scheduled task creation.

you can follow progress:
https://github.com/MartijnvanGeffen13/Volvo4evcc

@MartijnvanGeffen13
Copy link

Update: A release candidate has been released

https://github.com/MartijnvanGeffen13/Volvo4evcc

Features in current RC3 release module: (See wiki for instalation)

Car status should be auto detectable by EVCC
Support for Volvo 2FA authentication
No Constant live poll Only poll when connected and charging. Update poll intervall based on connection and SOC (high interval when charging, low interval when connected but not charging, super low interval when not connected)
Only pull data interresting for EVCC from API to increase security
Request minimal Oauth scope in auth session to improve security
Handle all credentials encrypted at all times
Application is Multi threaded to increase flexability
Volvo4Evcc is using a super light weight web instance to host the JSON response meaning no MQTT or extra broker is needed.
Direct EVCC Yaml intergration
Auto application restarts and startup via crontab no matter if app is started allready
Windows and Linux compatible

@burnz3000
Copy link

Update: A release candidate has been released

https://github.com/MartijnvanGeffen13/Volvo4evcc

Features in current RC3 release module: (See wiki for instalation)

Car status should be auto detectable by EVCC Support for Volvo 2FA authentication No Constant live poll Only poll when connected and charging. Update poll intervall based on connection and SOC (high interval when charging, low interval when connected but not charging, super low interval when not connected) Only pull data interresting for EVCC from API to increase security Request minimal Oauth scope in auth session to improve security Handle all credentials encrypted at all times Application is Multi threaded to increase flexability Volvo4Evcc is using a super light weight web instance to host the JSON response meaning no MQTT or extra broker is needed. Direct EVCC Yaml intergration Auto application restarts and startup via crontab no matter if app is started allready Windows and Linux compatible

Will this solution be included in EVCC?

@MartijnvanGeffen13
Copy link

Will this solution be included in EVCC?

Not as native if you mean that, its a broker addon to interface between the 2 just like all the 2MQTT but those are all double brokers (Car api -> *2MQTT -> MQTT -> EVCC), This solution removes the extra MQTT broker and adds lot of features.

We did do raise a template request to be included for Volvo4Evcc to be added to the EVCC sollution its being reviewed by Andig atm.

17350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devices Specific device support wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests