pytapo
pytapo copied to clipboard
Extra methods for H200 and C420S2 battery cameras
Hi there, I have found several missing methods, that would be nice to add to pytapo and the HA assistant integration
Hub H200:
method | params | result | description |
---|---|---|---|
setSirenStatus | {"siren":{"status":"on"}} | {"time_left":60} | triggers the siren sound on the hub, maybe a HA service of the hub device? |
getSirenStatus | {"siren":{}} | {"status":"off","time_left":0} | status of siren and remaining time for change(only when on I think) |
getSirenConfig | {"siren":{}} | {"siren_type":"Doorbell Ring 5","volume":"6","duration":300} | syren type value from possible ones from getSirenTypeList method, volume [1-10], duration in seconds |
getSirenTypeList | {"siren":{}} | {"siren_type_list":["Doorbell Ring 1","Doorbell Ring 2","Doorbell Ring 3","Doorbell Ring 4","Doorbell Ring 5","Doorbell Ring 6","Doorbell Ring 7","Doorbell Ring 8","Doorbell Ring 9","Doorbell Ring 10","Phone Ring","Alarm 1","Alarm 2","Alarm 3","Alarm 4","Dripping Tap","Alarm 5","Connection 1","Connection 2"]} | possible sounds for siren |
setSirenConfig | {"siren":{"duration":60,"siren_type":"Doorbell Ring 5","volume":"6"}} | {} | for changing siren config |
getSdCardStatus | {"harddisk_manage":{"table":["hd_info"]}} | {"harddisk_manage":{"hd_info":[{"hd_info_1":{"disk_name":"1","loop_record_status":"1","rw_attr":"rw","total_space":"58.23 GB","write_protect":"0","type":"local","status":"normal","detect_status":"normal","percent":"100","free_space":"58.03 GB","video_total_space":"55.31 GB","video_free_space":"55.12 GB"}}]}} | I think video_free_space coudl be useful to know when the sd is getting full |
getSdCardChildUsedSpace | {"harddisk_manage":{"device_list":[]}} | {"harddisk_manage":{"device_list":[{"device_id":"80219A4604220FB13B5F559EC66882BA21C95CAD","used_space":"140.50 MB"},{"device_id":"80218F1DD507CADEC90325A7CD348EF421C9CDFF","used_space":"47.62 MB"}]}} | sd space used by device, don't sure if really useful |
C420S2 Cameras:
method | params | result | description |
---|---|---|---|
getBatteryStatus | {"battery":{"name":"status"}} | {"battery":{"status":{"power_mode":"BATTERY","battery_percent":87,"battery_charging":"NO","battery_voltage":4061,"battery_capacity":6700,"battery_temperature":28,"battery_vendor":"tp","battery_model":"tp","low_battery":false,"battery_overheated":false}}} | really useful data of battery |
setLensMaskConfig | {"lens_mask":{"lens_mask_info":{"enabled":"on"}}} | {} | method to set privacy mode(cameras turn off) |
getLensMaskConfig | {"lens_mask":{"name":["lens_mask_info"]}} | {"lens_mask":{"lens_mask_info":{"enabled":"off"}}} | get privacy mode status |
searchDetectionList | {"playback":{"search_detection_list":{"channel":0,"end_index":99,"end_time":1710298799,"start_index":0,"start_time":1710212400}}} | {'playback': {'total_num': 5, 'search_detection_list': [{'start_time': 1709902381, 'end_time': 1709902404, 'alarm_type': 6}, {'start_time': 1709902460, 'end_time': 1709902473, 'alarm_type': 6}, {'start_time': 1709902490, 'end_time': 1709902508, 'alarm_type': 6}, {'start_time': 1709954426, 'end_time': 1709954447, 'alarm_type': 6}, {'start_time': 1710025659, 'end_time': 1710025687, 'alarm_type': 6}], 'snapshot_enable': True}} | detections search by timestamp, type 6 is person detection, I have to do more research to find out the other types, it could be polled to generate HA events? |
Those are I think the most useful ones, let me know if there is any feature request for any other configuration, there are a lot of other methods available. I could find time to make a pull request for pytapo methods support but I'm a bit lost on HA custom components.