Open bertocea85 opened 1 year ago
when do you get this? when running the integration or using postman?
in both.
Both in Home assistant and through postman.
Home Assistant:
this is mitm's capture
request
Response
can you confirm in postman you send it like this: (it might be that your robot does not support this API and we need to find another one for you. What model of robot do you use?
this is mitm's capture request
Response
so the MITM is when you use the app rigth? seems that you are using V2 and that is the issue with you ...
Puede confirmar en Postman que lo envía así: (puede ser que su robot no admita esta API y necesitemos encontrar otra para usted. ¿Qué modelo de robot utilizas?
Vortex OV5490 IQ ZODIAC
Mi captura de postman,
Esta es la respuesta de solicitud
de captura de mitm
así que el MITM es cuando usas la aplicación derecho? parece que estás usando V2 y ese es el problema contigo ...
Correct, it is the traffic captured with mitm when using the iaqulink application for IOS.
then, the next one in mitm is this one
and this is Response
the timestamp is just calculated as you can take from this site: https://current-timestamp.com/#result
but the signature one ... does it correspond to anything you get back from the login api?
good to see you got the control traces too, that way we are sure what we can expect it to work. I'll try to add these too, but I would like to help you out on fixing the basics first.
For me and the others it seems to work, so it must be your robot that goes to the V2 that is a little different that we must tackle.
I have already looked to see if it was a login value. there is nothing similar.
in each call it uses a different signature and timestamp. then it does a get of the device to see the status.
post 500 is when the device is offline
taking your code and testing it in visual studio, this is the answer.
Modifying the "Shadow" by values of the API here https://github.com/tekkamanendless/iaqualink, I get different values
it seems that its using Google API's ... so after a little round of google:
I'm not sure what values to use though to make this work ...
so your device is not supporting the shadow API right ... ? it says it does not belong to you when you use another value?
the good news is I managed to get the stop/start command working thanks to your traces ... the bad news is ...it always returns offline while it is online ...
after looking into the traces I see that I have the same behaviour as ppastur, it switches to websocket, so your robot seems to have total different approach ... will need other tactics...
@galletn do you want me to try the same to see if I get the same issue with it returning offline?
the timestamp is just calculated as you can take from this site: https://current-timestamp.com/#result
but the signature one ... does it correspond to anything you get back from the login api?
Did you do that via websocket? if so, perhaps we didn't leave the socket open long enough to receive the stream showing updates. My trace seemed to show plenty of updates from the device?? just a random thought?
@galletn do you want me to try the same to see if I get the same issue with it returning offline?
yes might be handy to know if you get the same results
@galletn do you want me to try the same to see if I get the same issue with it returning offline?
yes might be handy to know if you get the same results
Can you send me steps to reproduce - perhaps postman collection or code to run?
![]()
![]()
@galletn do you want me to try the same to see if I get the same issue with it returning offline? @galletn @ppastur one question guys, where do you get the value for "Authorization"?
@bertocea85 , authorization for me is the IdToken obtained in the post login
@bertocea85 , authorization for me is the IdToken obtained in the post login
![]()
Thanks!!!!
@bertocea85 still having issues with the latest release?
@galletn hello!! Sorry I've been away for a few days. Now with the latest update, I see the entity and I see the buttons to start cleaning and stop, but it gives an error in the call to the service.
Looking at the logs I see the following
Registrar: homeassistant.helpers.entity Source: helpers/entity.py:944 First occurred: 12:19:11 (59 occurrences) Last login: 13:17:10
Update for vacuum.robot_piscina fails Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/config/custom_components/iaqualinkRobots/vacuum.py", line 404, in get_device_status message = await websocket.receive() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client_ws.py", line 244, in receive msg = await self._reader.read() ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 681, in read return await super().read() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 640, in read await self._waiter asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 944, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1296, in async_device_update await self.async_update() File "/config/custom_components/iaqualinkRobots/vacuum.py", line 254, in async_update data = await asyncio.wait_for(self.get_device_status(request), timeout=30) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 519, in wait_for async with timeouts.timeout(timeout): File "/usr/local/lib/python3.12/asyncio/timeouts.py", line 115, in aexit raise TimeoutError from exc_val TimeoutError
@bertocea85 can you maybe change your password and send me over your credentials so that I can have a look? you can send them over to nicolas.gallet@skynet.be if you are willing. Thanks!
@galletn Hi! Sure! I just sent you an email with the details. Thanks for your help!
@bertocea85 okay so I had a look and indeed your robot uses other api's as it is another device type. Can you have your robot being online? then I can see what happens when it is there...
the issue will be that it has very different behaviour then the other robots, as we can get the status it had previously even when its offline... so I also will need to think on how to handle that part ...
hello @galletn !! Yes, I can put it in online mode, next Monday I will start it, I am not there right now to be able to turn it on
Thanks for your time
@galletn , is online now
@bertocea85 okay so took some first traces, I'll keep you posted once I have a first test version.
It will probably just be to report if its running yes/no, stop start & lift will be supportable, but I don't see sensor data nor in the app nor in the returns of the calls so it will be more basic info compared to the other robot models.
hello! @galletn Can I help you with anything else? Do you need any information or proof?
Thank you!
hi @bertocea85, can you leave the robot in the pool tonight? I would be able to continue my work on it.
So far what you could already test if it is correctly online/offline.
I'll upload the code in a jiffy in a new branch that supports the i2drobot.
So far the code here runs fine!
tonight I plan to create the stop start and get the status idle/running correctly, but for that I would prefer your robot to be for sure in the pool 😄
Spectacular!!! Thank you for your time and dedication. Yes, the robot is currently in the water and online, there is no plan to take it out, hahaha
@bertocea85 last update of the code now supports stop start on your robot, the time remaining and lift will be next! feel free to test already! https://github.com/galletn/iaqualink/tree/galletn-patch-4
hello!!
I have tested the code and it works perfectly!!! I can turn it on/off and see if it's cleaned.
Thank you @galletn
Excellent! I'll see what more I can do, but might be a busy week so depending on my schedule I'll add more functionality.
@bertocea85 can you confirm all is okay with the robot 😄 tested the return to base function and want to make sure it's fine before I test the time remaining while cleaning now.
I just updated the code, switching modes and getting the robot out of the water should work.
@galletn hello! Yes, the robot is fine and works perfectly!
great! I'm away for one week, upon my return I'll reach out again to continue the work on this!
when I make a POST to https://prod.zodiac-io.com/devices/v2/xxxxxx/shadow it returns the following error:
Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header.
With mitm proxy I see that it does a GET against https://r-api.iaqualink.net/v2/devices.json?user_id=xxx&signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx×tamp=1683216063
any idea? maybe it does a calculation of the signature and timestamp?