merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
364 stars 62 forks source link

Xiaomi Human Body Movement Sensor #511

Open eric14142004 opened 11 months ago

eric14142004 commented 11 months ago
  1. Added motion detector module.
  2. Added a handler for the lumi motion sensor. This device always return value:true and won't update to reflect whether motion was detected. This issue was discussed in Issue #70.
  3. Currently there are delays for motion detection (same as in HA), not sure how to solve it yet.
merdok commented 11 months ago

Is this something that is ready for merge or not as you closed and reopened the PR multiply times πŸ˜…

eric14142004 commented 11 months ago

not ready yet, I found a bug and I thought I fixed it and then back and forth, haha πŸ˜…

merdok commented 11 months ago

ok πŸ‘

merdok commented 11 months ago

Thanks for the update! That already looks much more cleaner.

BTW, the device also has the motion-detected event, and I guess that would be the most correct way to go. Unfortunately I did not manage to get that to work, do you maybe have any info about the events and how to get them to work? I guess that would be the perfect way to make it work...

eric14142004 commented 11 months ago

Thanks for the update! That already looks much more cleaner.

BTW, the device also has the motion-detected event, and I guess that would be the most correct way to go. Unfortunately I did not manage to get that to work, do you maybe have any info about the events and how to get them to work? I guess that would be the perfect way to make it work...

Sorry, I also have no clue how events work. But I am guessing they managed to make it work in HA, so I will try to explore that a bit more when I have time this weekend :satisfied:

merdok commented 11 months ago

I guess this is how events work in HA. A push server would be needed to get them to work:

https://github.com/rytilahti/python-miio/tree/master/miio/push_server

merdok commented 7 months ago

Hi, i have added the motion sensor module in the recent update, but i skipped the device implementation as that kind of does not satisfy meπŸ˜… I will try to keep investigate in the direction of events so that we can properly handle that. I tried with the push server above but it seems that only works for the old miio device and not for devices using the miot protocol. I saw in some documentations that there is a miot sdk from xiaomi, i guess if we could get our hands on that then maybe that would be helpful.

eric14142004 commented 7 months ago

Fair enough! I have been busy recently, I will revisit this PR whenever I have free time!