-
-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mi smart sensor gateway - check status #762
Comments
You can use
|
wow, that is super cool :) Thank you! |
Thanks to @starkillerOG who has been working on the gateway support :-) To the responsiveness issue, poor network connectivity, maybe? Some devices are also more reluctant to answer to the initial handshake sometimes, I suppose, so there may be some retries going on. |
I found out, that I can check status of device 3 or 5 times, each next time is response delayed +5 seconds more, and then device stops responding (no response anymore) with: but in the xiaomi home app everything is working and "ping ip" also works ok with 3ms response. that is strange. |
After a day I can confirm, that something is corrupted when using your library to get status of gateway (or any other cmd). After approx. 5 times of trials gateway switches to "No response from the device". |
Maybe it's related to the sequence numbers? miiocli doesn't save the last used numbers, so it could be that the device blocks the access after it has answered to the "same" request multiple times inside some time frame. You could try if the device keep responding to handshakes (e.g., |
|
Sorry, I forgot that miiocli didn't have that. You can use this for testing it: |
thanks, I am getting constantly this:
|
Hmh, maybe it is broadcasting over the wrong interface (if you have many), as it is not detecting any devices whatsoever. You could alternatively try a python script something like this:
|
hi, thanks, python script works and I am getting this every second (just removed data values):
|
What happens if you call |
|
Ah, sorry, |
ok, so I tried it and here are results: Then after few seconds I kill script. I am able to rerun script 5 times totally (run it, wait for info, then kill it). |
It really depends on what is your use case, to be honest. If it is your own python script you are using, you can simply save the sequence number and read it back when the script gets launched again. That approach used by the mirobo tool (here how it's read back from the file https://github.com/rytilahti/python-miio/blob/master/miio/vacuum_cli.py#L59 and here how it gets written back https://github.com/rytilahti/python-miio/blob/master/miio/vacuum_cli.py#L86). This should probably be made more generic for If you have a long running process (like homeassistant), there is no need such as the library handles increments and roll-overs of sequence numbers automatically. |
I experiemnted with it and tried something like |
See the links I gave above. A very minimalistic example could be something like this:
|
perfect thanks. This should work for Vacuum. |
Good catch! I thought it was part of the device class where it's supposed to be... I just created a PR to fix it: #776, but until then you can simply use |
I'll close this now, please feel to reopen if you still have issues. |
hi does your python library work for smart sensor gateway, too?
I would like to check status of smart sensor alarm gateway - how do do this please?
Also option to arm/disarm alarm would be great.
The text was updated successfully, but these errors were encountered: