BaQs / pyEzviz

Python package for ezviz cameras
Apache License 2.0
105 stars 45 forks source link

move_coords does not work with y axis #73

Open I-Kryachko opened 2 years ago

I-Kryachko commented 2 years ago

My cam: c8c

My env:

Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Name: pyezviz
Version: 0.2.0.5
Summary: Pilot your Ezviz cameras
Home-page: http://github.com/baqs/pyEzviz/
Author: Pierre Ourdouille
Author-email: baqs@users.github.com
License: Apache Software License 2.0
Location: d:\anaconda3\lib\site-packages
Requires: paho-mqtt, pandas, requests, xmltodict, pycryptodome
Required-by:

The problem for me is that when I am using move_coords method via console camera moves only changing X direction. The problem persists in python scripts too. I use X and Y params in range [0.0;1.0].

I tried to dump the request via editing the ptz_control_coordinates method and check if Y param is corrupted but it seems to be OK. Also the response is: {"meta":{"code":200,"message":"操作成功","moreInfo":null}} which means that operation succeeded.

When I'm trying to move in the app - everything works. When I'm using the move method - everything works except some speeds of moving.

Also I've investigated that when you add some random keys and values to the data dictionary of move_coords method the response and status are still 200 and OK. That inspires that 'y' key in this dictionary is ignored and somehow not used. This could be due to problems on the server and due to wrong key naming in the dictionary of pyezviz.

How to solve this, any ideas? I need this method for some reasons and can not use move method because I can not store camera coordinated from time to time.

EDIT: Ok, it seems that I have found the problem. The problem is that this method uses PANO API of the application. Application resets Y coordinate to fixed state every time when you make a 360 image. That is why API does not use Y parameter when it is passed and ignores it. I do not know if this is the same for every model but I think this is how it works with C8C camera. Better it was documented.

Also, help with function that moves to custom Y coordinate for my camera would be nice.

andreyxc commented 2 years ago

Also no reaction to Y

rissato commented 1 year ago

Anyone ever had any luck with this?
I am trying to add preset ptz position buttons in Home assistant, if the Y coordinate issue is fixed we could probably add to the HASS component as well.