basilfx / homeassistant-biketrax

Custom component for the PowUnity BikeTrax integration for Home Assistant.
MIT License
6 stars 2 forks source link

Login #31

Closed andyx87 closed 2 years ago

andyx87 commented 2 years ago

Hi, I installed the BikeTrax Addon in my Home Assistant. I am a German User. I can login in the iPhone App. But i can't login over the addon. I am using HassOS

basilfx commented 2 years ago

Can you provide (debug) logging, from HASS?

andyx87 commented 2 years ago

No Hass does't give me a error report. The integration says, that my login details are wrong. When I sign in over the Web App (https://app.powunity.com) or iPhone App it works. Do I need to activate a developer account or something else? Username = Email

andyx87 commented 2 years ago

Even after resetting the password, the integration says: Ungültige Authentifizierung

basilfx commented 2 years ago

It is hard for me to debug without knowing what happens in the background.

I will release an alpha version soon, that will add additional debug logging that I hope will help to debug this issue.

basilfx commented 2 years ago

Version 0.2.2a1 includes additional logging. You can install the pre-release version using the HACS beta repository feature (https://hacs.xyz/docs/faq/beta/).

Please enable debug logging (see the README.md), and provide the relevant logs.

Be sure to hide sensitive information!

andyx87 commented 2 years ago

2022-10-06 10:04:50.402 DEBUG (MainThread) [homeassistant.components.http.auth] Authenticated 127.0.0.1 for /api/config/config_entries/flow/1973f15acabd823f24c112bfc192260a using bearer token 2022-10-06 10:04:50.402 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/config/config_entries/flow/1973f15acabd823f24c112bfc192260a to 127.0.0.1 (auth: True) 2022-10-06 10:04:50.403 DEBUG (MainThread) [aiobiketrax.client] Updating devices 2022-10-06 10:04:50.404 DEBUG (MainThread) [aiobiketrax.api] Commencing login for 'secrect'. 2022-10-06 10:04:51.249 DEBUG (MainThread) [async_upnp_client.traffic.ssdp] Received packet from ('192.168.0.71', 49432): b'M-SEARCH * HTTP/1.1\r\nHOST: 239.255.255.250:1900\r\nST: urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\nMAN: "ssdp:discover"\r\nMX: 2\r\n\r\n' 2022-10-06 10:04:51.302 DEBUG (MainThread) [aiobiketrax.api] Retrieved JWT token. 2022-10-06 10:04:51.332 DEBUG (MainThread) [bleak.backends.bluezdbus.manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_D1_00_E7_5E_43_EC): ['org.bluez.Device1', {'RSSI': <dbus_fast.signature.Variant ('n', -81)>}, []] 2022-10-06 10:04:51.427 DEBUG (MainThread) [aiobiketrax.api] GET request to 'https://traccar.powunity.com/api/devices' returned HTTP status code 200. 2022-10-06 10:04:51.428 DEBUG (MainThread) [aiobiketrax.api.responses] [{'id': secret, 'attributes': {'trialEnd': '2023-09-29T15:05:38.358Z', 'guardType': 'movement', 'gpsDisabled': False, 'passport': {'bikePictures': ['secret'], 'receiptPictures': ['secret', 'secret'], 'manufacturer': 'secret', 'insurance': True, 'insuranceCompany': 'secret ', 'model': 'secret', 'modelYear': 'secret', 'colour': 'green', 'bikeType': 'mtb', 'engine': 'bosch', 'shiftingSystemManufacturer': 'Shimano ', 'shiftingSystemGears': '12', 'purchaseDate': 'secret', 'price': 'secret', 'frameNumber': 'secret', 'insuranceNumber': 'secret'}, 'autoGuard': True, 'guarded': True, 'alarm': False, 'lastAlarm': 1664624180466}, 'groupId': 0, 'name': 'secret', 'uniqueId': 'secret', 'status': 'offline', 'lastUpdate': 'secret', 'positionId': secret, 'geofenceIds': [], 'phone': None, 'model': None, 'contact': None, 'category': None, 'disabled': False}]

2022-10-06 10:32:43.274 DEBUG (MainThread) [aiobiketrax.client] Updating devices 2022-10-06 10:32:43.275 DEBUG (MainThread) [aiobiketrax.api] Commencing login for 'secret'. 2022-10-06 10:32:44.296 DEBUG (MainThread) [aiobiketrax.api] Retrieved JWT token. 2022-10-06 10:32:44.418 DEBUG (MainThread) [aiobiketrax.api] GET request to 'https://traccar.powunity.com/api/devices' returned HTTP status code 200. 2022-10-06 10:32:44.419 DEBUG (MainThread) [aiobiketrax.api.responses] [{'id': secret, 'attributes': {'trialEnd': '2023-09-29T15:05:38.358Z', 'guardType': 'movement', 'gpsDisabled': False, 'passport': {'bikePictures': ['secret'], 'receiptPictures': ['secret', 'secret'], 'manufacturer': 'secret', 'insurance': True, 'insuranceCompany': 'secret ', 'model': 'secret', 'modelYear': 'secret', 'colour': 'green', 'bikeType': 'mtb', 'engine': 'bosch', 'shiftingSystemManufacturer': 'Shimano ', 'shiftingSystemGears': '12', 'purchaseDate': '2022-09-26T20:27:00+02:00', 'price': 'secret', 'frameNumber': 'secret', 'insuranceNumber': 'secret'}, 'autoGuard': True, 'guarded': True, 'alarm': False, 'lastAlarm': 1664624180466}, 'groupId': 0, 'name': 'secret', 'uniqueId': 'secret', 'status': 'offline', 'lastUpdate': '2022-10-01T16:05:32.000+00:00', 'positionId': secret, 'geofenceIds': [], 'phone': None, 'model': None, 'contact': None, 'category': None, 'disabled': False}]

andyx87 commented 2 years ago

https://drive.google.com/file/d/1essrPetwYTi7OIZSZB63NL85MLvSQclQ/view?usp=sharing

basilfx commented 2 years ago

Thanks for the logging.

It's strange to see that it is able to communicate, because I can see that the calls to the BikeTrax API are successful. I will have to add more logging to see what is going on. I'll create a 0.2.2a2 version with additional logging somewhere today or tomorrow.

basilfx commented 2 years ago

I think I have identified one potential problem. Could it be that the price you have set in the app (under device passport) contains a comma or a dot (e.g. 123.40 or 123,40)?

andyx87 commented 2 years ago

Yes! That was the problem! My value was 123,45 the app made 123.45

The new value I use is 123 and it works. Thanks a lot 🫶

basilfx commented 2 years ago

It shouldn't be a problem, so I will fix it in the next release. Thanks for letting me know.

andyx87 commented 2 years ago

It’s a great app 👍 Thank you for programming it

basilfx commented 2 years ago

v0.3.0 is out and should contain the fix.