HomeAssistant-Tapo-Control icon indicating copy to clipboard operation
HomeAssistant-Tapo-Control copied to clipboard

Feature Request: HDR Switch

Open oscarsiles opened this issue 7 months ago • 4 comments

Is your feature request related to a problem? Please describe. I have a C325WB camera which works fine, but is missing a few features (e.g. #433). In particular of interest to me would be the ability to enable/disable the HDR functionality, as Tapo indicates it is best to keep it disabled at night. The firmware has no auto mode for this setting, and so it would be helpful to be able to automate this via HA.

Describe the solution you'd like Add support for the new features of C225/C325WB cameras (HDR, new AI detection modes)

Describe alternatives you've considered n/a - no firmware support for scheduling HDR mode

Additional context Happy to provide any logs/data that is needed. Have played around with pytapo a bit but didn't get very far.

oscarsiles avatar Dec 05 '23 23:12 oscarsiles

The AI detection mode it would be really appreciated, yes

richilp avatar Dec 15 '23 10:12 richilp

https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/issues/304

JurajNyiri avatar Dec 28 '23 16:12 JurajNyiri

Someone will need to document the https call for HDR switch on / off. Then it can be added.

JurajNyiri avatar Dec 28 '23 16:12 JurajNyiri

I intercepted the HTTPS request/responses (to the usual stok=/ds endpoint):

HDR on: {"method":"multipleRequest","params":{"requests":[{"method":"setHDR","params":{"video":{"set_hdr":{"hdr":1,"secname":"main"}}}}]}}

{"result":{"responses":[{"method":"setHDR","result":{},"error_code":0}]},"error_code":0}

HDR off: {"method":"multipleRequest","params":{"requests":[{"method":"setHDR","params":{"video":{"set_hdr":{"hdr":0,"secname":"main"}}}}]}}

{"result":{"responses":[{"method":"setHDR","result":{},"error_code":0}]},"error_code":0}

I also extracted the response of getVideoQualities method which shows the status of HDR for the camera: {"method":"getVideoQualities","params":{"video":{"name":["main"]}}}

{"method":"getVideoQualities","result":{"video":{"main":{"quality":"3","bitrate":"3072","frame_rate":"65556","smart_codec":"off","encode_type":"H264","resolution":"2688*1520","bitrate_type":"vbr","name":"VideoEncoder_1","default_bitrate":"3072","hdr":"1"}}},"error_code":0}

as well as getVideoCapability which references HDR as well ("hdrs"): {"method":"getVideoCapability","params":{"video_capability":{"name":"main"}}}

{"method":"getVideoCapability","result":{"video_capability":{"main":{"encode_types":["H264","H265"],"frame_rates":["65537","65546","65551","65556"],"bitrates":["256","512","1024","1536","3072"],"bitrate_types":["cbr","vbr"],"resolutions":["2688*1520","1920*1080","1280*720"],"qualitys":["1","3","5"],"hdrs":["0","1"],"minor_stream_support":"1"}}},"error_code":0}

Hopefully this is all that is needed!

oscarsiles avatar Jan 02 '24 12:01 oscarsiles