flobz / psa_car_controller

Control psa car with connected_car v4 API.
GNU General Public License v3.0
426 stars 225 forks source link

"kinetic" and "last_position" fields are empty #50

Closed jlayec closed 1 year ago

jlayec commented 3 years ago

Describe the bug "kinetic" and "last_position" fields are empty in json answer of get_vehicleinfo/VIN Am I alone?

To Reproduce Steps to reproduce the behavior:

  1. what command did you use ? python3 server.py -l 0.0.0.0 --debug DEBUG
  2. when the bug append ? Everytime with get_vehicleinfo/VIN
  3. Does it persist after restarting the program? Yes

Here is the output of the API

            "type": "Fuel"
        }
    ],
    "environment": null,
    "ignition": null,
    "kinetic": null,
    "last_position": null,
    "preconditionning": {
        "air_conditioning": {
            "failure_cause": null,
            "programs": [
                {
                    "enabled": false,

I confirm that the privacy configuration in vehicle is share data and position (was not changed and was working before).

abmantis commented 2 years ago

I don’t know why, but from today after 1 year I can see the coordinates in psa api, I can map the value in home assistant but I can’t see the map in psa_car_controller, it’s need some api key?

How do you see them on the API? Which endpoint?

http://localhost:5000/get_vehicleinfo/YOURVIN

in psa_car_controller api

Ah! So it is not in the PSA api but in car controller API. Mine still has nothing :(

Bonxy commented 2 years ago

The PSA group API is still not returning any location data at the status, lastPosition or telemetry endpoints. :(

Can anyone see any location data from these endpoints?

robotfishe commented 2 years ago

I'm having a similar problem and started an issue about it but it was closed. However I don't think the issue is the same. Has anyone else in the thread found that psa_car_controller doesn't work for pulling location but Tronity Platform does work?

maivorbim commented 2 years ago

Tronity uses a different API than PSACC. I have a theory that you can force Peugeot to change you to the Tronity API if you buy a Free2Move subscription and manage to connect the car to the app (complain to Free2Move support in case it doesnt work).

robotfishe commented 2 years ago

My car is a Vauxhall, not Peugeot, not sure if that makes a difference.

washcroft commented 2 years ago

Tronity uses a different API than PSACC. I have a theory that you can force Peugeot to change you to the Tronity API if you buy a Free2Move subscription and manage to connect the car to the app (complain to Free2Move support in case it doesnt work).

Even once a car is using the API Tronity is using, the position data still doesn't come through on the regular API PSACC uses.

Initially, my position data/trips weren't coming through to Tronity either, until they had PSA open up the data on the API they use:

Hello, I am currently trialling your service with my DS3 Crossback - however it doesn’t appear to be logging/showing trips and the current location is incorrect.

Is there something else I need to do to enable this? Thank you. Regards, Warren

Hi Warren,

We are currently testing a new API from PSA. I'll get you activated for this. This will take about 1-2 day. Then you should also receive trips.

Thanks & Best Regards Sebastian Customer Success & Co-Founder TRONITY | Your Car. Your Data.

CalicodesIles commented 2 years ago

@maivorbim Free2Move support is clearly useless. I don’t recommend anyone to use their services and hope that it will help in solving technical issues (nothing has changed in my case, although I insisted seriously by phone and mail about the follow up). You will lose your energy and your money (I’m still waiting for the refund they promised a few months ago).

maivorbim commented 2 years ago

@CalicodesIles I agree, Free2Move support is useless, however it is the only logical explanation I can think of for why, all of the sudden, after almost a year of having my e208, I started receiving location data...I managed to get refunded for the 2 months of service within 1 week of my termination of services. Hope you get your money back too.

Bonxy commented 2 years ago

Tronity use a B2B api, not the B2C api that the app / pca_controller uses if I recall.

So there is nothing wrong with the API, they've just removed the endpoints from the B2C API possibly due to GDPR rules with location data and other people driving the car from what I've read before.

rchiileea commented 2 years ago

its a matter of choice, but the new API not based on the app has fleet managment, which means, full tracking, zone tracking speed tracking doors locking dooors unlocking, but it looks like a paid service which kind of sucks for us.

rchiileea commented 2 years ago

"hreflang": null, "name": null, "profile": null, "templated": null, "title": null, "type": null}, "vehicle": null}, "battery": {"current": 0.0, "voltage": 97.0}, "doors_state": null, "energy": [{"updated_at": "2022-07-03 17:31:07+00:00", "autonomy": 40.0, "battery": null, "charging": {"charging_mode": "No", "charging_rate": 0, "next_delayed_time": "PT23H30M", "plugged": false, "remaining_time": null, "status": "Disconnected"}, "consumption": null, "level": 100.0, "residual": null, "type": "Electric"}, {"updated_at": "2022-07-03 17:31:07+00:00", "autonomy": 500.0, "battery": null, "charging": null, "consumption": null, "level": 71.0, "residual": null, "type": "Fuel"}], "environment": null, "ignition": null, "kinetic": {"acceleration": null, "moving": null, "pace": null, "speed": null}, "last_position": {"type": "Feature", "geometry": {"coordinates": [null, null, null], "type": "Point"}, "properties": {"heading": null, "signal_quality": null, "type": null, "updated_at": null}}, "preconditionning": {"air_conditioning": {"failure_cause": "DoorOpened", "programs": null, "status": "Failure", "updated_at": "2022-07-03 17:31:07+00:00"}}, "privacy": {"state": "None"}, "safety": null, "service": {"type": "Hybrid", "updated_at": "2022-07-03 17:31:07+00:00"}, "timed_odometer": {"updated_at": null, "mileage": 2243.8}}

] all i seem to be getting is fuel, battery, mileage, I get trips, but no locations and charging and remaining time and I can still precondition. and refress and see charging rates in both per mile and kw and type of charge either slow or fast.

Bonxy commented 2 years ago

its a matter of choice, but the new API not based on the app has fleet managment, which means, full tracking, zone tracking speed tracking doors locking dooors unlocking, but it looks like a paid service which kind of sucks for us.

What is the new api?

rchiileea commented 2 years ago

https://developer.groupe-psa.io/webapi/

gytisgreitai commented 2 years ago

What is the exact procedure with free2move and which exact apk? Either I'm misunderstanding how should it work, or got the wrong app

stevoh6 commented 1 year ago

Maybe stupid question, but I found this in psa_controller code, what exactly it means?

https://github.com/flobz/psa_car_controller/blob/7c07cca143fcd7b04c39614ccaa194208ecd9db6/psa_car_controller/psacc/application/psa_client.py#L104

https://github.com/flobz/psa_car_controller/blob/7c07cca143fcd7b04c39614ccaa194208ecd9db6/psa_car_controller/psa/connected_car_api/api/vehicles_api.py#L1220

abmantis commented 1 year ago

I have not changed anything, and today I noticed that position is now updated! It was null previously. Was something changed on PSA Car Controller, or something on PSA servers?

{
    "last_position": {
        "type": "Feature",
        "geometry": {
            "coordinates": [
                XXXX,
                YYYY,
                ZZZZ
            ],
            "type": "Point"
        },
        "properties": {
            "heading": null,
            "signal_quality": 9.0,
            "type": "Aquire",
            "updated_at": "2023-01-10 20:07:32+00:00"
        }
    }
}
stevoh6 commented 1 year ago

I have still null values. image

albenex commented 1 year ago

from my understanding it's totally random.

it was working well since I signed up with paid subscription. then such service was terminated (app changed name and other things) and live position stopped working.

after months it worked twice and currently i have update position 1 time over 10 tries.

from my point of view is totally a PSA server side issue (or choice)

abmantis commented 1 year ago

I never had any paid service, that is what I found most interesting since most people that report having location updates had some paid service.

dreimer1986 commented 1 year ago

Like me. Tronity by now and it works fine again...

joszz commented 1 year ago

I never had any paid service as well, and my Citroën E C4 all of a sudden started reporting it's position as well. It's not very accurate though and misses out on a lot I drive, but it's something.

jlayec commented 1 year ago

Hello all, Good news on my side but seems I'm not alone according to the latest comments above. After almost 2 years, the PSA API is sending again positions since 12/27/22 without any specific action except writing here on this github issue. I never subscribed any service. Propose to close the issue. Thanks all for your feedback even we can't do something but I feel better to see that I was not alone.

Bonxy commented 1 year ago

I still don’t see any location data. :/

thennart commented 1 year ago

It seems it’s linked to the use of Peugeot app with Bluetooth connection. If I forget to allow bt connection with the app, location is not updated

Le dim. 22 janv. 2023 à 14:09, Bonxy @.***> a écrit :

I still don’t see any location data. :/

— Reply to this email directly, view it on GitHub https://github.com/flobz/psa_car_controller/issues/50#issuecomment-1399480143, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANDP2WH5AX664DHN4NOLJIDWTUWQVANCNFSM4ZQPLZ7Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rchiileea commented 1 year ago

I ended up using a combination of this and node red with tronity flow for map tracking

stevoh6 commented 1 year ago

I ended up using a combination of this and node red with tronity flow for map tracking

How, could you please shere some more i fo how to achieve this? Since im using android auto,app is paired with car,but still no data about location :(

rchiileea commented 1 year ago

https://community.home-assistant.io/t/use-tronity-api-to-extract-car-data-into-sensors-using-node-red/362405

jlayec commented 1 year ago

I did the test driving without any BT connection during few days and location is well updated through the API and not through mobile app.

It seems it’s linked to the use of Peugeot app with Bluetooth connection. If I forget to allow bt connection with the app, location is not updated

PatrikNorrgard commented 1 year ago

I did the test driving without any BT connection during few days and location is well updated through the API and not through mobile app.

It seems it’s linked to the use of Peugeot app with Bluetooth connection. If I forget to allow bt connection with the app, location is not updated

Interesting! Has anyone else gotten this to work?

stevoh6 commented 1 year ago

I did the test driving without any BT connection during few days and location is well updated through the API and not through mobile app.

It seems it’s linked to the use of Peugeot app with Bluetooth connection. If I forget to allow bt connection with the app, location is not updated

Interesting! Has anyone else gotten this to work?

Im not.

Bonxy commented 1 year ago

Is there a link that it seems to be when people are using the Peugeot app? I connected the Vauxhall app when Im driving my car and checked the location endpoint from the API and it still doesn't return any location data.

PatrikNorrgard commented 1 year ago

That might be, I´m on the Opel app, and have never received any location data.

stevoh6 commented 1 year ago

Im on citroen app, I dont get any data too.

szambetti commented 1 year ago

It seems it’s linked to the use of Peugeot app with Bluetooth connection. If I forget to allow bt connection with the app, location is not updated

Hello,

the connection of the position does NOT depend on the app bluetooth sync at all. It will be sent by the car directly using its own network data to PSA services, along with other data such as SOC and Available range.

In order to know if your car can be located by the PSA service or not, call the assistance using the emergency call button - tell them that the car won't tell you the position on the app and you wanted to know if on their side it is correct.

If they know it, the car is transmitting the position correctly on its own.

stevoh6 commented 1 year ago

Interresting, it is okay use thst button? :D I never use it. But if they know position, they can also enable sending those data via api? or who we should contact?

stevoh6 commented 1 year ago

Okay, citroen can see my coordinates, but they arent available in psa controller:(

Bonxy commented 1 year ago

So today, after changing / doing nothing lastPosition, kinetic and safety are now showing up in my API data.

image

p4block commented 1 year ago

Randomly stopped updating my coordinates the other day... can't seem to get them to update. Everything else changes properly, bummer.

both1 commented 1 year ago

Same here. Stopped last Friday. If it happened for many of us, it sounds like a central change.

sircuri commented 1 year ago

@Bonxy What is the value of your privacy sub tree in that json? I think it might be related to the fact that I don't get any location or kinetic information. For me the privacy state is always FULL. No matter what I set in my car.

Bonxy commented 1 year ago

@Bonxy What is the value of your privacy sub tree in that json? I think it might be related to the fact that I don't get any location or kinetic information. For me the privacy state is always FULL. No matter what I set in my car.

My privacy in the response is None. Full privacy would mean no location data is shared.

p4block commented 1 year ago

Mine is also None right now, no changes to location though. Bummer x2.

sircuri commented 1 year ago

I think it's time for me to hop by a local dealer. I can't set the privacy mode, eCall is not working and also Peugeot Assistance is not working. Lot of services seem to be disabled somehow. Also since I started playing with the privacy settings I get a warning at the top of the Peugeot app that the privacy settings prevent feedback from my car to the app. Something is definitely wrong here. I should be able to disable the privacy mode by pressing the SoS button and the Assistance button at the same time for 1 second (according to the manual) and it should ask me to confirm that I want to disable the privacy mode. That is not working either.

Bonxy commented 1 year ago

Ive just checked mine and it doesn't look like the location is updating any more. :(

show2go commented 1 year ago

neither does mine... also since about 10.3. thx

thealphonso commented 1 year ago

"last_position": {"type": "Feature", "geometry": {"coordinates": [xx, yy, 98], "type": "Point"}, "properties": {"heading": 4.0, "signal_quality": 9.0, "type": "Aquire", "updated_at": "2023-03-10 12:02:19+00:00

Does it main I'm in the same boat with some of you?

Matthy1810 commented 1 year ago

Same issue here. Peugeot e208, last position updated on 2023-03-09.

Nitro56 commented 1 year ago

Same issue. Peugeot e208, last position updated on 2023-03-10

mdkeil commented 1 year ago

Same issue. Peugeot e208, last position updated on 2023-03-10

yep-- for me too! Therefore ABRP always get this wrong cordinates and every new route planning from "my position" starts from this outdated position.

@flobz could the position set to "null/none" before sending to ABRP if it outdated?

Bushrider commented 1 year ago

For me the last update is even worse:{"heading":xxxxx,"latitude":xxxxx,"longitude":xxxxx,"speed":0,"valid_hdg":true,"valid_lat":true,"valid_lng":true,"valid_spd":true},"gnss":{"altitude":248.300003,"error_altitude":4.24,"error_h_position":3.92,"error_v_speed":0.09,"fix_status":3,"heading":xxxxx,"latitude":xxxxx,"longitude":xxxxx,"speed":0,"timestamp":**"2021-06-30T08:45:56Z"**,"valid_alt":true,"valid_err_alt":true,"valid_err_hps":true,"valid_err_spd":true,"valid_hdg":true,"valid_lat":true,"valid_lng":true,"valid_spd":true},"satellites":{"tracked":20,"used":12,"valid_trk":true,"valid_usd":true,"valid_vis":true,"visible":26}},"fds":["NDR01","NAE01","NBM01","NCG01","NAO01","NAS01"],"sev_state":0,"timestamp_gnss":1625042756,"obj_counter":6,"privacy_customer":0,"privacy_applicable":0,"privacy_applicable_max":2,"superlock_state":0}' But the addon is reporting my actual home location, i think it's because of the fallback last_charge ? Am i right ? Gonna try to test if the assistance button is working well and see if Peugeot have my actual location or not ...