Adguard missing some entitities (Sensors)

Hi,

I’m running the latest Adguard Version (v0.98.1-174-gbfc6) and I’m missing all the sensors and one switch ( AdGuard Filtering).

I already removed the integration and re-added it. Now it’s only showing one sensor (rule_count) that does not work.

In the logs I can see a few errors, seems that AdGuard changed something in their API:

Oct 14 11:24:19 homeassistant hass[25399]: 2019-10-14 11:24:19 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.adguard 
Oct 14 11:24:19 homeassistant hass[25399]: 2019-10-14 11:24:19 INFO (MainThread) [homeassistant.components.switch] Setting up switch.adguard 
Oct 14 11:24:19 homeassistant hass[25399]: 2019-10-14 11:24:19 ERROR (MainThread) [homeassistant.components.sensor] adguard: Error on device update! 
Oct 14 11:24:19 homeassistant hass[25399]: Traceback (most recent call last): 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity 
Oct 14 11:24:19 homeassistant hass[25399]:     await entity.async_device_update(warning=False) 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 446, in async_device_update 
Oct 14 11:24:19 homeassistant hass[25399]:     await self.async_update() 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/adguard/__init__.py", line 157, in async_update 
Oct 14 11:24:19 homeassistant hass[25399]:     await self._adguard_update() 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/adguard/sensor.py", line 153, in _adguard_update 
Oct 14 11:24:19 homeassistant hass[25399]:     self._state = await self.adguard.stats.replaced_parental() 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/adguardhome/stats.py", line 37, in replaced_parental 
Oct 14 11:24:19 homeassistant hass[25399]:     return response["replaced_parental] 
Oct 14 11:24:19 homeassistant hass[25399]: TypeError: string indices must be integers 
Oct 14 11:24:19 homeassistant hass[25399]: 2019-10-14 11:24:19 DEBUG (MainThread) [homeassistant.components.adguard] An error occurred while updating AdGuard Home sensor. 
Oct 14 11:24:19 homeassistant hass[25399]: Traceback (most recent call last): 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/adguard/__init__.py", line 157, in async_update 
Oct 14 11:24:19 homeassistant hass[25399]:     await self._adguard_update() 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/adguard/sensor.py", line 222, in _adguard_update 
Oct 14 11:24:19 homeassistant hass[25399]:     self._state = await self.adguard.filtering.rules_count() 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/adguardhome/filtering.py", line 39, in rules_count 
Oct 14 11:24:19 homeassistant hass[25399]:     response = await self._adguard._request("filtering/status") 
Oct 14 11:24:19 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/adguardhome/adguardhome.py", line 122, in _request 
Oct 14 11:24:19 homeassistant hass[25399]:     response.status, {"message": contents.decode("utf8")} 
Oct 14 11:24:19 homeassistant hass[25399]: adguardhome.exceptions.AdGuardHomeError: (404, {'message': '404 page not found\n'}) 
Oct 14 11:24:20 homeassistant hass[25399]: 2019-10-14 11:24:20 ERROR (MainThread) [homeassistant.components.switch] adguard: Error on device update! 
Oct 14 11:24:20 homeassistant hass[25399]: Traceback (most recent call last): 
Oct 14 11:24:20 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity 
Oct 14 11:24:20 homeassistant hass[25399]:     await entity.async_device_update(warning=False) 
Oct 14 11:24:20 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 446, in async_device_update 
Oct 14 11:24:20 homeassistant hass[25399]:     await self.async_update() 
Oct 14 11:24:20 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/adguard/__init__.py", line 157, in async_update 
Oct 14 11:24:20 homeassistant hass[25399]:     await self._adguard_update() 
Oct 14 11:24:20 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/adguard/switch.py", line 219, in _adguard_update 
Oct 14 11:24:20 homeassistant hass[25399]:     self._state = await self.adguard.querylog.enabled() 
Oct 14 11:24:20 homeassistant hass[25399]:   File "/srv/homeassistant/lib/python3.7/site-packages/adguardhome/querylog.py", line 17, in enabled 
Oct 14 11:24:20 homeassistant hass[25399]:     return response["querylog_enabled] 
Oct 14 11:24:20 homeassistant hass[25399]: KeyError: 'querylog_enabled'

Yes I have the same error.
Only Have

I used the Integrations and used port 83 as I had to use this port as when setting up Adguard Home it said port 80 was inuse.

Hope someone knows a solution.

Adguard is on 0.99 already. There was an update for python-adguardhome recently and since @frenck is developing it, I’m pretty sure that there will be an update for HA soon, too :slight_smile:

Yes but I am not using Hassio or Frenck’s add on.
I use the raspberry pi version Adguard home.

There’s an alert about AdGuard support breaking: https://alerts.home-assistant.io/#adguard.markdown

Thanks I will have to wait for the next HA Version.

I’m not solely Hassio or add-on focussed :wink: I wrote this integration as well.

What has happened, is that AdGuard made some changes to their API (and added some bugs in the process). I’ve adjusted the integration (and its underlying library) to deal with that, however, that requires a release of Home Assistant.

The bugs have been reported with the AdGuard team and I’ve been told that another release is expected this week. Nevertheless, the adjustment to the integration should be able to deal with both the current release and the upcoming one.

Everything is in place, and it will be part of the upcoming release (beta starts upcoming Wednesday).

1 Like

Thank you, @frenck :heart_eyes:

1 Like

Thanks @frenck for all your work and your live streams which I have just started to watch. I will hopefully be setting up a new Hassio system soon from my docker system because it will be so nice to have the add-ons that you have been making. :ok_hand::+1::+1:

1 Like

HA just had an update to 0.100.3 but still no fix for AdGuard Home.

Latest update is 0.101.2 and that’s fixes the sensors.

Just noticed. Thanks.

I’ve just installed Adguard Home (2.4.1) through the home assistant (0.110.5) add-on menu. It’s up and running, blocking ads; however, I don’t see any sensors, switches nor services registered with the name “adguard”. I’ve restarted HA which hasn’t helped.

Thoughts?

Thanks for the awesome work with this plugin! Super straightforward to install.

Did you add the AdGuard integration in HA settings?