AdGuardHome Integration wont connect

I am unable to get AdGuardHome to connect from my Hassio system running the latest HA to my (self installed) secondary PI Running AdGuardHome. Even when i know 100% the username and password is correct i still get:

AdGuardHomeError: (401, {'message': 'Unauthorised.\n'})

I have tried both with and without a cert, currently its not got one. I can login fine to the AdGuardHome UI with the same port, username and password etc.

Any suggestions welcome. Thanks.

2019-07-03 21:26:06 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 33, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 67, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 216, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 115, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 46, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 86, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 87, in async_configure
    flow, cur_step['step_id'], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 123, in _async_handle_step
    result = await getattr(flow, method)(user_input)  # type: Dict
  File "/usr/src/homeassistant/homeassistant/components/adguard/config_flow.py", line 85, in async_step_user
    await adguard.version()
  File "/usr/local/lib/python3.7/site-packages/adguardhome/adguardhome.py", line 154, in version
    response = await self._request("status")
  File "/usr/local/lib/python3.7/site-packages/adguardhome/adguardhome.py", line 122, in _request
    response.status, {"message": contents.decode("utf8")}
adguardhome.exceptions.AdGuardHomeError: (401, {'message': 'Unauthorised.\n'})

Could you please post your configuration?

Trying to add it via the UI:

I my case the default port was not set to 3000 like the examples and AdGuard Instructions… I had to edit AdGuardHome.yaml and change the bind_port to 3000 and restart AdGuard then it worked. On a side note… AdGuard works fine but seems to break the internet on that machine itself… I can’t seem to find what settings I would need to change to do that but it is working fine as DNS server. (I actually did the same thing on my HA machine at first and spent hours messing with resolv.conf and other network settings to the point I don’t even remember how I actually fixed it… :confused:) Also… I am not using docker which is the “preferred” method from what I can tell so I’m not sure if that’s the reason.

Thanks @Bartem but its definatly set to 3000 and i can access the web url over that port fine.

Hi, did you solve?

where is that yaml file?

In the AdGuard installation directory… don’t remember what the default was I no longer use it

Thanks, found


bind_host: 127.0.0.1
bind_port: 45158
auth_name: ""
auth_pass: ""
language: ""

above an extract: so now I put the above values (no username and no password) and integrated … but just 3 sensors, no switch for on/off, parental guide and so on …

EDIT: its started populating by itself, now all is in place

1 Like

I am struggling with this as well. I have my AdGuard Container on my Synology using a macvlan address at 192.168.1.253 and I am trying to add the Integration in Config>Integration and I can’t seem to get any username and password or port to work. What should I be using?

Edit: this worked for me!
bind_host: 0.0.0.0
bind_port: 3000

1 Like

Bumping this simply to express my thanks. For those of us on remote remote docker container instances that require us to use a macvlan network, THIS is the only way to get HA to play nice with AdguardHome.

That worked. Thanks!