jaroschek / home-assistant-myuplink

Custom Home Assistant integration for devices and sensors in myUplink account.
39 stars 8 forks source link

400, message=Bad Request from oauth #31

Open soulfire89 opened 8 months ago

soulfire89 commented 8 months ago

There seems to be a problem with oauth since yesterday image

And the following DEBUG information: Where can I reconfigure the authentication process, without loosing my setup? My Hardware: VVM225 E EM 3x400V Firmware: 9586R4

2023-10-18 12:03:08.515 DEBUG (MainThread) [custom_components.myuplink] API error: 400 (Bad Request) 2023-10-18 12:03:29.137 DEBUG (MainThread) [custom_components.myuplink] API error: 400 (Bad Request) 2023-10-18 12:03:32.042 DEBUG (MainThread) [custom_components.myuplink.api] Update systems 2023-10-18 12:03:32.043 DEBUG (MainThread) [custom_components.myuplink.api] Fetch parameters for device emmy-r-134958-20230612-06922721137002-68-27-19-05-f3-13 2023-10-18 12:03:32.357 DEBUG (MainThread) [custom_components.myuplink] Finished fetching myUplink data in 0.315 seconds (success: True) 2023-10-18 12:04:09.657 DEBUG (MainThread) [custom_components.myuplink] API error: 400 (Bad Request) 2023-10-18 12:04:32.042 DEBUG (MainThread) [custom_components.myuplink.api] Update systems 2023-10-18 12:04:32.043 DEBUG (MainThread) [custom_components.myuplink.api] Fetch parameters for device emmy-r-134958-20230612-06922721137002-68-27-19-05-f3-13 2023-10-18 12:04:32.532 DEBUG (MainThread) [custom_components.myuplink] Finished fetching myUplink data in 0.490 seconds (success: True) 2023-10-18 12:05:29.969 DEBUG (MainThread) [custom_components.myuplink] API error: 400 (Bad Request) 2023-10-18 12:05:32.042 DEBUG (MainThread) [custom_components.myuplink.api] Update systems 2023-10-18 12:05:32.043 DEBUG (MainThread) [custom_components.myuplink.api] Fetch parameters for device emmy-r-134958-20230612-06922721137002-68-27-19-05-f3-13 2023-10-18 12:05:32.301 DEBUG (MainThread) [custom_components.myuplink] Finished fetching myUplink data in 0.258 seconds (success: True) 2023-10-18 12:06:32.042 DEBUG (MainThread) [custom_components.myuplink.api] Update systems 2023-10-18 12:06:32.043 DEBUG (MainThread) [custom_components.myuplink.api] Fetch parameters for device emmy-r-134958-20230612-06922721137002-68-27-19-05-f3-13 2023-10-18 12:06:32.457 DEBUG (MainThread) [custom_components.myuplink] Finished fetching myUplink data in 0.415 seconds (success: True) 2023-10-18 12:06:50.168 DEBUG (MainThread) [custom_components.myuplink] API error: 400 (Bad Request) 2023-10-18 12:07:32.042 DEBUG (MainThread) [custom_components.myuplink.api] Update systems 2023-10-18 12:07:32.042 DEBUG (MainThread) [custom_components.myuplink.api] Fetch parameters for device emmy-r-134958-20230612-06922721137002-68-27-19-05-f3-13 2023-10-18 12:07:32.593 DEBUG (MainThread) [custom_components.myuplink] Finished fetching myUplink data in 0.551 seconds (success: True)

EDIT: I've checked application_credentials. Entries are still correct and the same then listed at myuplink credentials.

jaroschek commented 8 months ago

Hello @soulfire89, today I had the same issue. Without any action on my side the entities of the myUplink integration became unavailable. And all requests to the API resulted in the same error Bad Request.

I also checked the credentials using the swagger API tool at https://dev.myuplink.com. So I decided to create new credentials as I was sure something must have happened on the API side.

Fortunately all entity and device identifiers are created from the devices serial number and data point ids. So whenever you delete the integration or device from home assistant you can reconfigure/install the integration for the same device and don't loose your entities history. You will only get gaps in charts for the time the entities are not available.

So I removed the integration devices from home assistant and installed/reauthorized the myUplink API with newly created application credentials. And after all the device and entities are back and available all my the entity history ist still here too.

So to answer your question: When you remove and reinstall the integration/device, you will not loose your entities history. But you could loose any special dashboard configuration you may have created.