Agent DVR and API authentication

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.

Well as you know HA is an open source project and so everyone can contribute at it :wink:
Just click the edit Button at bottom of the Agent DVR - Home Assistant page and then make modifications you wish to improve the documentation and submit it (the process is quite simple and you are guided :wink: you’ll just need if you don’t have yet a github account !

I just wanted to have the component author check this out and see what his thoughts are on fixing this. If the dialog for adding the integration gets updated to explain this we could probably skip updating the docs or wait until the change is made.

When you push an update for an HA documentation, author of integration will be automatically notified and so you’ll be able to discuss with him about best way to update documentation :wink: