The Agent DVR docs do not explain how to use authentication when adding an instance to HA. In fact I couldn’t find an explanation anywhere.
This is also made worse by this HA issue comment that says API protection should be turned off. This is not true. You can actually add an Agent DVR instance with a username and password.
To add an Agent DVR instance with API protection enabled enter the host with the username and password like so:
myusername:[email protected]
So what I would like to see fixed:
- Update the component so it supports entering the username and password separately or at the very least give an example of how to set the username and password inside the host field.
- Update the docs to explain that API protected Agent DVR instance is supported and it should be recommended
- Update the error message so instead of “Failed to connect” it actually gives me the real reason it failed. If it had told me that the authentication failed that would have saved me so much time. Instead I had to debug networking, test curling the endpoint from my HA docker container, etc. Good error messages take very little time to implement but can save the end user tons of time in triage.
Anyways, glad I was able to figure it out and I hope this helps others out as well. For something like security cameras you should always protect those precious APIs.