BaQs / pyEzviz

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

Support switch on Turn on the alarm sound on ezviz camera #33

Closed modestpharaoh closed 1 year ago

modestpharaoh commented 3 years ago

Hi @BaQs,

I wonder if you can sniff the app to check. which API method used for turning on/off the alarm manually!?

BaQs commented 3 years ago

Would you mind telling me exactly which feature ? A screenshot would be perfect 👌

modestpharaoh commented 3 years ago

image

Here is screenshot from the android app, while checking the camera from the application. if you hit "Active Defence", it activate the alarm sound for 60s.

BaQs commented 3 years ago

I think we merged this branch for exactly what you need. Need to be integrated inside the cli though.

https://github.com/BaQs/pyEzviz/commit/19c2129568617ca95a42033a1461d0f83b0546ba

modestpharaoh commented 3 years ago

I think we merged this branch for exactly what you need. Need to be integrated inside the cli though.

19c2129

I guess this is a different thing, it is basically change the defence mode from home to away or vice versa.. but the other switch that I am showing in the screenshot, it enable the alarm sound manually for 60s. similar to the left button that enable the floodlight on/off

RenierM26 commented 3 years ago

http/put: https://apiieu.ezvizlife.com/v3/devices/{devSerial}/0/sendAlarm

body: enable : 2 #make sound enable: 1 #disable

Just documenting. I'll add this to the "to do" list.

modestpharaoh commented 3 years ago

http/put: https://apiieu.ezvizlife.com/v3/devices/{devSerial}/0/sendAlarm

body: enable : 2 #make sound enable: 1 #disable

Just documenting. I'll add this to the "to do" list.

This definitely activate the alarm, thanks.

Is there away to know, if the alarm is currently activated!?

RenierM26 commented 1 year ago

Hi @modestpharaoh,

EZVIZ api doesn't return the status of the alarm. It just triggers a 60 second countdown and the camera firmware turns the siren off after 60 seconds.

I have implemented this in the latest Home assistant release (2023.9) if you use home assistant. Or you can find it in the latest custom integration (EZVIZ beta via HACS)

If you are using your own code then you'll need to implement a 60 second countdown to track it. You can retrigger it to reset the countdown btw. (On the 50 seconds mark for example then it will continue for 60 second more.)