bropat / eufy-security-ws

Small server wrapper around eufy-security-client library to access it via a WebSocket.
MIT License
169 stars 24 forks source link

[Question]: Pan&Tilt camera API: Rotate is OK but the other directions don't work #258

Closed lxrootard closed 10 months ago

lxrootard commented 11 months ago

Ask your question

Hello @bropat One of my Jeedom end-users is asking if I can add Pan & Tilt support for T841x. I don't have this device so I can't test. What is the direction parameter value format for the device.pan_and_tilt API ? text? integer?

Thanks

fuatakgun commented 11 months ago

You can work backwards from here: https://github.com/fuatakgun/eufy_security/blob/master/custom_components/eufy_security/eufy_security_api/camera.py#L187

lxrootard commented 11 months ago

hello

My user made the test unfortunately it does NOT work ??

` import json from websocket import create_connection ws = create_connection("ws://127.0.0.1:3000") print(ws.recv())

print ('\n Init ') ws.send(json.dumps({"command": "start_listening"})) print(ws.recv())

print ('\n Device pan & tilt ') ws.send(json.dumps({"command": "device.pan_and_tilt","serialNumber": "T8410xxxx", "direction": "1" })) print(ws.recv())

ws.close() `

Result:

` Init {« type »:« result »,« success »:true,« result »:{« state »:{« driver »:{« version »:« 2.6.2 »,« connected »:true,« pushConnected »:true},« stations »:[{« name »:« Salon »,« model »:« T8410 »,« serialNumber »:« T8410XXXXXXXXX »,« hardwareVersion »:« P2 »,« softwareVersion »:« 2.1.9.5 »,« lanIpAddress »:« 192.168.1.10 »,« macAddress »:« 8CXXXXXXXXXXXX »,« currentMode »:1,« guardMode »:1,« connected »:true}],« devices »:[{« name »:« Salon »,« model »:« T8410 »,« serialNumber »:« T8410XXXXXXXXXX »,« hardwareVersion »:« P2 »,« softwareVersion »:« 2.1.9.5 »,« stationSerialNumber »:« T8410XXXXXXXXXX »,« enabled »:true,« motionDetected »:false,« personDetected »:false,« personName »:« »,« soundDetected »:false,« petDetected »:false,« cryingDetected »:false,« autoNightvision »:true,« motionDetection »:true,« soundDetection »:false,« petDetection »:false,« rtspStream »:true,« pictureUrl »:« /media/mmcblk0p1/Camera00/20230729190418n.jpg »,« ledStatus »:true}]}}}

Device pan & tilt {« type »:« result »,« success »:false,« errorCode »:« unknown_command »} `

lxrootard commented 11 months ago

Hello Forget my previous message it works with integer instead of string

lxrootard commented 10 months ago

Hello

I'm reopening this issue as the device.pan_and_tilt command doesn't work as expected on T8410: My end-user has determined that ROTATE360 = 0 works OK but the other commands eg LEFT = 1, RIGHT = 2, UP = 3, DOWN = 4 also rotate the camera instead of moving it.

@fuatakgun I understand you've implemented this feature in HA. Does it work???

fuatakgun commented 10 months ago

I have one 2k indoor pan/tild and it is working as expected

lxrootard commented 10 months ago

I have one 2k indoor pan/tild and it is working as expected

strange...could you please indicate which FW you're using? [EDIT] It works the issue was on my side