Skip to content
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

How to enhance the Xiaomi camera(chuangmi.camera.ipc019) function #655

Closed
Silence-kzp opened this issue Mar 28, 2020 · 9 comments · Fixed by #663
Closed

How to enhance the Xiaomi camera(chuangmi.camera.ipc019) function #655

Silence-kzp opened this issue Mar 28, 2020 · 9 comments · Fixed by #663

Comments

@Silence-kzp
Copy link

Currently, the chuangmi_camera.py module can be used to perform basic operations on the Xiaomi camera, but the camera cannot be controlled to move up, down, left, and right. I want to add these functions. After trying the methods provided on miio, I cannot parse the json file exported on wireshark The output is garbled, I ca n’t start now, I hope to provide some ideas for me.

@rezmus
Copy link

rezmus commented Mar 28, 2020

{"method":"set_motor","params":{"operation":2},"id":65877}
<{"result":["OK"],"params":{"angle":43,"elevation":34},"id":65877}

{"method":"set_motor","params":{"operation":2},"id":23977}
<{"result":["OK"],"params":{"angle":41,"elevation":34},"id":23977}

{"method":"set_motor","params":{"operation":2},"id":42474}
<{"result":["OK"],"params":{"angle":39,"elevation":34},"id":42474}

operation param is 1-4 (directions), but you can't set how much you want to move. in response you get angle/elevation (1-100) so you know where you are. if cam reaches far point you get some error.

@Silence-kzp
Copy link
Author

thx, I tried it and it works, the only thing I am wondering now is why my wireshark can't catch the data of udp port of 54321.
image

@rytilahti
Copy link
Owner

Could you please confirm the orientation directions? Also, @Silence-kzp, is this ipc009 or ipc019?

@Silence-kzp
Copy link
Author

yep, Is ipc019.

@rytilahti
Copy link
Owner

@Silence-kzp could you please confirm the orientation directions, so that we can get the PR merged for the next release?

@rezmus
Copy link

rezmus commented Apr 19, 2020

@rytilahti i just checked on ipc019e. 1 left, 2 right, 3 up, 4 down. btw: some new models have alarm_sound method (no params) which makes very loud alarm sound for 10s.

@rytilahti
Copy link
Owner

Great, thanks rezmus! 💯

rytilahti added a commit that referenced this issue Apr 19, 2020
…alarm (#663)

* Xiaomi camera (chuangmi.camera.ipc019): Add orientation controls

Related to #655

* Add a note about ipc019

* add ipc019 to discovery, closes #671

* use dashes instead of dots in the name

* fix rotation directions, add alarm_sound
@shummo
Copy link

shummo commented Apr 7, 2021

Can this model use with Home Assistant?

@rytilahti
Copy link
Owner

Not at the moment, as far as I know. See also #682 (comment) for my previous comment regarding to video stream, without video stream the camera integration on homeassistant would likely be rather limited.

xvlady pushed a commit to xvlady/python-miio that referenced this issue May 9, 2021
…alarm (rytilahti#663)

* Xiaomi camera (chuangmi.camera.ipc019): Add orientation controls

Related to rytilahti#655

* Add a note about ipc019

* add ipc019 to discovery, closes rytilahti#671

* use dashes instead of dots in the name

* fix rotation directions, add alarm_sound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants