eufy-security-ws
eufy-security-ws copied to clipboard
Start the client with an initial command?
Hey,
Thanks for this tool, which I've just discovered.
What I want to achieve is running pan & tilt commands through SSH. I've successfully managed to run the server and the client, and the command to pan & tilt, using the client interface. Unfortunately, I haven't found a way to start the client and run a command automatically, without manual user input. What I'd like to do is something like eufy-security-client 'device.pan_and_tilt DEVICE_SN 0', so that it starts client and directly run said command, then exits. Is it something I can do with this tool?
Thanks! ✌️
Hi @AnthoPakPak,
at the moment this is not possible. Until now, this tool was only intended for interactive testing of the commands.
Marked as feature request.
@AnthoPakPak
This feature was implemented in the next release.
Hey mate!
Thanks for implementing this! 🎉
I've just updated to try it out. I've faced some issues 😕
I tried out some commands, like this one eufy-security-client -c device.set_motion_detection SERIAL_NUMBER true or eufy-security-client -c device.pan_and_tilt SERIAL_NUMBER 1, but whichever command always returned the help message (like this one). Which is weird because from what I see, the error should only be thrown when using an incorrect amount of params. And I think I use the correct amount 🤔
Am I doing anything wrong? Any advices? :)
Hey @bropat, not sure if you've seen my edit so here's just a heads up comment. Am I misusing the command? Could you maybe provide some example command please? :)
@AnthoPakPak
Am I doing anything wrong? Any advices? :)
There was an error parsing the values of the properties. This has been fixed in version 1.0.0. The above examples of commands are correct.
Sorry mate but I don't get it. I've just tried every possible combinations and still get the same error message...
For example, this command eufy-security-client -c device.pan_and_tilt SERIAL_NUMBER 1 leads to this message device.pan_and_tilt <device_sn> <direction>.
I've triple checked that the tool has been correctly updated:
- eufy-security-ws is 1.0.0
- eufy-security-client is 2.2.0
Is it working on your side?
Tomorrow I'll check your example and let you know.
@AnthoPakPak
In your example, one option (-a for the arguments) is missing.
Correct example:
eufy-security-client -c device.pan_and_tilt -a SERIAL_NUMBER 1
or
eufy-security-client --command device.pan_and_tilt --arguments SERIAL_NUMBER 1
Usage:
Usage: eufy-security-client [options]
Options:
-s, --schemaVersion <host> Schema version the server should support (default: max client supported version)
-H, --host <host> Host to connect to (default: "localhost")
-p, --port <port> Port to connect to (default: 3000)
-c, --command <command_name> Silent command to execute (choices: "driver.set_verify_code", "driver.set_captcha", "driver.poll_refresh", "driver.is_connected", "driver.is_push_connected",
"driver.connect", "driver.disconnect", "driver.get_alarm_events", "driver.get_video_events", "driver.get_history_events", "driver.set_log_level",
"driver.get_log_level", "driver.start_listening_logs", "driver.stop_listening_logs", "driver.is_mqtt_connected", "driver.isConnected",
"driver.isPushConnected", "device.get_properties_metadata", "device.get_properties", "device.set_property", "device.has_property", "device.start_livestream",
"device.stop_livestream", "device.is_livestreaming", "device.trigger_alarm", "device.reset_alarm", "device.pan_and_tilt", "device.quick_response",
"device.start_download", "device.cancel_download", "device.is_downloading", "device.get_voices", "device.get_commands", "device.has_command",
"device.start_rtsp_livestream", "device.stop_rtsp_livestream", "device.is_rtsp_livestreaming", "device.calibrate_lock", "device.calibrate",
"device.set_default_angle", "device.set_privacy_angle", "device.unlock", "device.start_talkback", "device.stop_talkback", "device.is_talkback_ongoing",
"device.talkback_audio_data", "device.snooze", "device.add_user", "device.delete_user", "device.get_users", "device.update_user_passcode",
"device.update_user_schedule", "device.update_user", "device.verify_pin", "device.set_status_led", "device.set_auto_night_vision",
"device.set_motion_detection", "device.set_sound_detection", "device.set_pet_detection", "device.set_rtsp_stream", "device.set_anti_theft_detection",
"device.set_watermark", "device.enable_device", "device.lock_device", "station.reboot", "station.is_connected", "station.connect", "station.disconnect",
"station.get_properties_metadata", "station.get_properties", "station.set_property", "station.has_property", "station.trigger_alarm", "station.reset_alarm",
"station.get_commands", "station.has_command", "station.set_guard_mode", "station.isConnected", "quit", "exit")
-a, --arguments <args...> Arguments for silent command if expected
-t, --timeout <seconds> Silent command timeout seconds (default: 30)
-v, --verbose
-h, --help display help for command
Oooh crap I didn't noticed that... 🤦♂️
Thanks a lot, everything works well now. I've just implemented the changes in my scripts and they're so smooth now! Awesome! 🎉