Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: HDR Switch #480

Closed
oscarsiles opened this issue Dec 5, 2023 · 12 comments
Closed

Feature Request: HDR Switch #480

oscarsiles opened this issue Dec 5, 2023 · 12 comments
Assignees
Labels
Enhancement New feature or request Implemented Feature has been implemented.

Comments

@oscarsiles
Copy link

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.

@richilp
Copy link

richilp commented Dec 15, 2023

The AI detection mode it would be really appreciated, yes

@JurajNyiri
Copy link
Owner

#304

@JurajNyiri JurajNyiri changed the title Feature Request: C225/C325WB Feature Support Feature Request: HDR Switch Dec 28, 2023
@JurajNyiri
Copy link
Owner

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

@JurajNyiri JurajNyiri added the Help wanted Extra attention is needed label Dec 28, 2023
@oscarsiles
Copy link
Author

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!

@JurajNyiri JurajNyiri added Enhancement New feature or request and removed Help wanted Extra attention is needed labels Mar 2, 2024
@JurajNyiri
Copy link
Owner

@oscarsiles Looking into this now. We need to find one more call - to determine what is the HDR current state.

@JurajNyiri JurajNyiri added the Help wanted Extra attention is needed label Jul 4, 2024
@JurajNyiri
Copy link
Owner

In the meantime, I pushed the above functions into pytapo, you can test them now by manually downloading this branch and using it with python.

https://github.com/JurajNyiri/pytapo/tree/hdr

Once we have the function to get HDR state, I will implement it here as well. Unfortunately, none of my cameras support HDR so I cannot even guess the GET call or test this.

@oscarsiles
Copy link
Author

Thanks for this - I'll try to test it over the next couple of days.

We need to find one more call - to determine what is the HDR current state.

Would the getVideoQualities not work for this, as it has an hdr field at the very end?

@JurajNyiri
Copy link
Owner

You are right, I missed that! Let me implement it here. I will open new branch in upcoming hours for you to test.

@JurajNyiri
Copy link
Owner

Deployed pytapo 3.3.23, should make it a lot easier to test now.

@JurajNyiri
Copy link
Owner

@oscarsiles Try downloading manually https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/tree/hdr , it should have the HDR switch. I was not able to test so I was developing blind, let me know if it works. Thank you!

@oscarsiles
Copy link
Author

Just tested it by changing HDR on the Tapo app and via HA. Both work and reflect any changes from another source correctly. Thanks so much!

@JurajNyiri
Copy link
Owner

Released in https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/releases/tag/5.4.26. Thank you!

@JurajNyiri JurajNyiri added Implemented Feature has been implemented. and removed Help wanted Extra attention is needed labels Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Implemented Feature has been implemented.
Projects
None yet
Development

No branches or pull requests

3 participants