lsiddiquee / com.rexwel.bmwconnected

GNU General Public License v3.0
2 stars 3 forks source link

When trying to add my bmw I get the following message: 401: Error occurred while attempting to retrieve token #35

Closed Tukker2021 closed 8 months ago

Tukker2021 commented 12 months ago

When trying to add my bmw I get the following message: 401: Error occurred while attempting to retrieve token image I have reinstalled and restarted the app several times, but always the same error. Any idea how this can be resolved?

lsiddiquee commented 12 months ago

Hi @Tukker2021, thanks for reporting the issue. Can you share which country you are based in? This might occur as I have tested it only for Europe.

Tukker2021 commented 12 months ago

I am based in the Netherlands

From: Likhan Siddiquee @.> Reply to: "lsiddiquee/com.rexwel.bmwconnected" @.> Date: Wednesday, 13 September 2023 at 13:41 To: "lsiddiquee/com.rexwel.bmwconnected" @.> Cc: Rick Stroot @.>, Mention @.***> Subject: Re: [lsiddiquee/com.rexwel.bmwconnected] When trying to add my bmw I get the following message: 401: Error occurred while attempting to retrieve token (Issue #35)

Hi @Tukker2021, thanks for reporting the issue. Can you share which country you are based in? This might occur as I have tested it only for Europe.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Tardos-de commented 10 months ago

Same problem here, located in Germany.

Tukker2021 commented 10 months ago

I just send diagnostics f45b60d4-cabe-4da1-b385-9855e2ae8dcf

Any solution for this, as I haven’t received any feedback after providing the requested info about the country I am in?

HvH31 commented 10 months ago

Hi, I’m also getting the 401 error code.

Diagnostics report sent: ada721ae-5e92-45d1-a2eb-4f429a2fd3ef

I would very much like to use your app.

Thanks very much.

Hugh

lsiddiquee commented 9 months ago

I tried logging out and in again and it seems to be working fine. I remember it happened once for me when I had some specific character in my password. Can you try changing the password once and trying again.

HvH31 commented 9 months ago

Thanks for the reply. I changed the password and still get the 401 error. It appears BMW has different login areas: China, North America and Rest of the World. I see no option choice in your app’s login credentials and being in Europe, I assume you use Rest of the World. The Home Assistant integration has a choice of the three in their login credentials. Is there any possibility that could be added to your app as I’m in the USA and would use the North American gateway. Thanks very much.

lsiddiquee commented 9 months ago

Welcome @HvH31. Indeed the app is now hardcoded for only rest of the world. Hence everytime I see login issue I do ask the user where they are based, and this is the first reported issue from a user based in US. I will take this in and hopefully push out a test version in a week or so.

@Tukker2021 and @Tardos-de as you are based in NL so am I, your issue should be fixed with changing the password, can you please confirm.

lysdioden commented 9 months ago

Last night at 02:00 the car started sending information, it has been quiet since the beginning of the summer

lsiddiquee commented 9 months ago

@lysdioden can you elaborate what you mean by this?

lysdioden commented 9 months ago

I have had no communication between my car and homey since 5/31. I've tried to fix it by changing the password, restarting the app, etc. but last night I got a message from Homey that I'm about to run out of fuel in the car.

lsiddiquee commented 9 months ago

@lysdioden I cannot really understand how could that happen, unless the app was not upto date and was updated last night. As indeed due to a change in BMW's API the older version would not work. However, glad that it is now working.

HvH31 commented 9 months ago

That would be great. I’ll look forward to the test. Thank you.

lsiddiquee commented 9 months ago

@HvH31 can you try the test version. In the login there is a drop down to select rest of the world and North America. 0.2.0 https://homey.app/en-nl/app/com.rexwel.bmwconnected/BMW-Connected/test/

HvH31 commented 9 months ago

Thanks so much! Logged in perfectly and all seems to work fine. Wish list would be an option for miles vs kilometers.

lsiddiquee commented 9 months ago

Great to know. I am currently working on improving some error handling and adding some geofencing features like enter and exit trigger. Once that is done i will push that and move this to release.

The unit is on my list as well. Hopefully we can find a solution soon.

So even though you are based in US all values are returned in km and liters? If it alwayd returns probably i can add a standard conversion for now until it can be resolved from the BMW api.

lsiddiquee commented 9 months ago

@Tukker2021 apologies for getting back late. Are you still encountering the same issue?

HvH31 commented 9 months ago

Yes, all the values are metric. By coincidence, the same thing occurs in the Tesla Homey Pro app as well. Minor issue, but it would be nice in miles and gallons. Having your app successfully login is terrific though. Appreciate your creating it.

Tukker2021 commented 9 months ago

@lsiddiquee Sorry for the late response, I have now re-installed the app by the link you provided yesterday and I changed my password. Now I can add my BMW again, thanks for fixing this issue.

I do have a question though, in the app you can add locations, however how can I use these to trigger a flow?

The description of the app suggests there is an If Location, however in the app I can't find this option anymore:

image

lsiddiquee commented 9 months ago

@Tukker2021 in the current version there is a location changed trigger. And part of the trigger if it is in a geofenced area, the value of the label is populated, otherwise that is empty and you only get the latitude, longitude and adress. However, I have just pushed a new test version, where I have added to additional triggers enter and exit of geofence.

image

Tukker2021 commented 9 months ago

@lsiddiquee Unfortunately I don't see anything related to location or geofencing in the app, I have upgraded to the latest test version 0.2.1, but all I see are the following options:

image

I used the defaults for Polling Interval=60 and Refueling Trigger=5.

After installing the update, it seems that the BMW app is heavily impacting my Homey Pro, as I often get the message now that it is no reachable!

lsiddiquee commented 9 months ago

@Tukker2021 can you please create a separate issue for any performance related.

For the location trigger not being available, once you add the device, you need to drive to a different location and arm your alarm. It seems like currently the capability is only detected when there is a change. And location change only works after you arm your system. And if the capability is not registered the triggers are not available. If you still not see it can you please create a new ticket.

lsiddiquee commented 9 months ago

@HvH31 There is a test version 0.2.2 pushed where you can switch between miles and km. Can you test and provide feedback. Thanks

https://tools.developer.homey.app/apps/app/com.rexwel.bmwconnected/build/32

Tukker2021 commented 9 months ago

Unfortunately no difference. I will also create two different topics for the performance and for the missing of any geofencing or location conditions

HvH31 commented 9 months ago

Hi. I selected the miles option and though the labels now state miles, the actual numeric values are still in km. I then restarted the app and closed the Homey app. After reopening the Homey Pro app and BMW app, there was no change and numeric values remained in km.

lsiddiquee commented 9 months ago

@HvH31 it should get resolved in the next polling/update cycle. Can you confirm if that did not work?

HvH31 commented 9 months ago

@lsiddiquee yes, it did get resolved and the numeric values are now in miles. Is there a way to have an overall settings selection of standard/imperial or metric? As petrol/gas is shown in the app as liters rather than gallons, etc. Thanks for helping out the USA Homey users.

lsiddiquee commented 9 months ago

In the next update I will add the option to select the fuel from Liters/Gallon (US)/Gallon (UK).

lsiddiquee commented 8 months ago

Completed