JanLoebel / eufy-node-client

Experiment to talk to eufy security
43 stars 6 forks source link

http requests help #8

Closed martinorob closed 3 years ago

martinorob commented 3 years ago

Hi, I'm writing a simple bash script to turn on and off the night vision. I'm using this simple code to retrieve all the information that I need:

token=$(curl -s --header "Content-Type: application/json" --request POST --data '{"email":"my@email.com","password":"MyP455w0rd"}' https://mysecurity.eufylife.com/apieu/v1/passport/login | jq --raw-output '.data.auth_token')

curl -H "X-Auth-Token: $token" -H "Content-Type: application/json" --request POST --data '{"device_sn": "","num": 100,"orderby": "","page": 0,"station_sn": ""}' https://mysecurity.eufylife.com/apieu/v1/app/get_devs_list

curl -H "X-Auth-Token: $token" -H "Content-Type: application/json" --request POST --data '{"device_sn": "MyDevicesSN", "station_sn": "MyStationSN", "params": [{"param_type": 2002,"param_value": "1"}]}' https://mysecurity.eufylife.com/api/v1/app/upload_devs_params

but it doesn't works. Please may you give me same input to get this? Thanks a lot

M.

JanLoebel commented 3 years ago

As far as my experience with changing data/control cameras the REST-API is not able to handle that. Nearly all communication is done via the P2P-Protocol. If you're in the same network that can be done with the library. The P2P communication over the cloud service is not working yet.

martinorob commented 3 years ago

@JanLoebel thanks for your answer. I'm on the same network, can you help me to accomplish this Sith the library and the P2P-Protocol? 😊

JanLoebel commented 3 years ago

@martinorob That depends, which kind of device do you try to control?

martinorob commented 3 years ago

@martinorob That depends, which kind of device do you try to control?

Indoor cam 2k

JanLoebel commented 3 years ago

Sadly I don't have an indoor cam, so I'm not sure if it works like the device I have. Does it need the homebase 2 or is it standalone?

martinorob commented 3 years ago

It’s standalone, may you give me some example of script so i can try to “put” the 2002 parameter to the camera?

martinorob commented 3 years ago

@JanLoebel remember me! 😊

JanLoebel commented 3 years ago

Sorry, I don't have any standalone camera, therefore I can't say anything to that. Please check also the example repository and the FAQ there:

https://github.com/JanLoebel/eufy-node-client-examples