mariusz-ostoja-swierczynski / tech-controllers

TECH Controllers integration for Home Assistant
MIT License
97 stars 67 forks source link

400 on modules request #11

Open rromrrom opened 3 years ago

rromrrom commented 3 years ago

Hello, I have M9 (v 1.3.6) and L-9. Trying to run HA with addon and manually using python code and chrome REST client as well. In all cases I can do authentication and get module list, but I can't do modules query and other things. I got 400 Bad Request for https://emodul.eu/api/v1/users/MY_USER_ID/modules/MY_MODULE_UUID Any ideas or hints? Thanks. BTW: is there any specs of API docs? Can't find it anywhere to dig myself.

mariusz-ostoja-swierczynski commented 3 years ago

Hi @rromrrom ,

Did you add Authorization header?

Here is API documentation provided by TECH Controllers company: https://emodul.eu/docs/api-v1.txt

Hope it helps, Cheers, Mariusz

rromrrom commented 3 years ago

Hi, Yes Authorization header is in place. I can do "modules" request successfully with it. But adding module_udid to request gives me 400, weird. The same result when I use tech_test.py

Screenshot (28) Screenshot (29)

mariusz-ostoja-swierczynski commented 3 years ago

It looks all correct in your request to me. One thing might be that TECH API doesn't officially support M-9 devices, but other user reported that it worked for him with M-9 (v1.0.12). If I have a chance, I will forward that question to TECH support.

Just to make sure, the same results you are getting for L-9 device, right?

Cheers, Mariusz

rromrrom commented 3 years ago

Hello, Thanks for your effort. I can't communicate with L-9 directly, cause it doesn't have internet access. M9 is only what I see in emodul.eu and android app. L-9 works through M9. M9 is what provides wifi and internet access capability for L9.

rromrrom commented 3 years ago

Hello For some reason this starts working. Now I'm able to perform GET request like https://emodul.eu/api/v1/users/{user_id}/modules/{module_udid} Looks like something fixed on server side. I guess this issue may be closed. Thanks.

rromrrom commented 3 years ago

JFYI: API stops working again. Error "bad request" and 400. Looks like server-side is not stable. Do you know how to report issues to Tech? Thanks.

mariusz-ostoja-swierczynski commented 3 years ago

Hi @rromrrom and thanks for reporting this. There is also other user who had this issue and reported that over Home Assistant Polska Facebook group, and it got fixed itself. I also think that the server side issue, as at that time I had this issue, the emodul.eu app did not work properly. I have a contact to TECH, but they are not very responsive. They offered help, but once I asked few questions, I am still awaiting answers. Maybe they are very, very busy :)

rromrrom commented 3 years ago

Hi @mariusz-ostoja-swierczynski thanks for the update.

rozmyty commented 3 years ago

Hi @mariusz-ostoja-swierczynski, @rromrrom Same problem on TECH: M-9r (v.1.3.2). I have tried to contact TECH via contact-form (https://www.techsterowniki.pl/serwis/kontakt-serwis) - I will keep you updated in case I receive any answer from them. Probably we would exert more pressure if each of us files a bug ;) Regards

rromrrom commented 3 years ago

Hi all, this is became irritating :) I have the only one unstable part of my whole HomeAssistant setup. And it is TECH server-side, which produces 400 error just from nowhere. Do you think it is possible to contact them again and give some momentum to the issue? Something happen on server side and everything stops working again and again.

jakublipinski commented 1 year ago

I think I'm experiencing a similar issue. The exactly same API request can return a proper result or return with 401 {"error":"Invalid user_id or module_udid"} depending on the authentication token provided. Some requests work well with a certain token but other ones return error.

Did you resolve your issue? Who do you contact at TECH?

rromrrom commented 1 year ago

hi @jakublipinski It was long time ago. But I contacted TECH using facebook few times. They said they are going to fix that. And after few weeks the issue gone for me. Works like a charm since then. Nothing was done on my device or HA side.

jakublipinski commented 1 year ago

I switched to the dev branch and the problem persists. I emailed TECH and will see if they respond.