Home Assistant release with the issue:
0.83.3
Last working Home Assistant release (if known):
NA
Operating environment (Hass.io/Docker/Windows/etc.):
Docker
Component/platform:
https://www.home-assistant.io/components/asuswrt/
Description of problem:
This component only works for an hour and then all of it sudden stops working leaving all the devices as not_home. It works for a few minutes after restarting HA.
Problem-relevant configuration.yaml
entries and (fill out even if it seems unimportant):
asuswrt:
host: 192.168.2.1
username: xxxxx
password: xxxxx
Traceback (if applicable):
2018-12-05 06:45:39 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:45:52 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:46:05 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:46:13 ERROR (SyncWorker_15) [homeassistant.components.sensor.command_line] Command failed: head -5 /home/homeassistant/.homeassistant/.HA_VERSION
2018-12-05 06:46:18 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:46:31 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:46:44 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:46:57 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:47:10 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:47:14 ERROR (SyncWorker_18) [homeassistant.components.sensor.command_line] Command failed: head -5 /home/homeassistant/.homeassistant/.HA_VERSION
2018-12-05 06:47:23 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:47:36 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:47:49 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:48:02 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:48:14 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:48:14 ERROR (SyncWorker_18) [homeassistant.components.sensor.command_line] Command failed: head -5 /home/homeassistant/.homeassistant/.HA_VERSION
2018-12-05 06:48:27 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:48:40 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:48:53 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:49:06 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:49:15 ERROR (SyncWorker_10) [homeassistant.components.sensor.command_line] Command failed: head -5 /home/homeassistant/.homeassistant/.HA_VERSION
2018-12-05 06:49:19 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:49:32 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-05 06:49:45 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
Additional information:
Reference #18735 - different error log...
I have the same symptoms, devices go offline after a few minutes and never come back, but my error logs only show the speed and upload/download sensors failing. Those of course are flooding my logs, making it hard to troubleshoot. Seems to be regardless of tracker service though, my Google home Bluetooth tracker has the same result.
Same here!
It works for few min after reboot and then stops.
Also I get "upload/download failed"errors in my log.
The upload/download sensors always show 0 value.
I have AC66R router hence can only use telnet. I'm not sure if this problem is only with telnet protocol or this is the same case with ssh enabled routers as well.
Hoping that these issues will be fixed in next release.
Same on a RT-AC66U using Telnet. This has been an issue since v0.81.6.
I have this issue too. There was a similar issue a while back and it took many releases before it started to work again. I managed to fix it for me by hacking away at the old asuswrt.py device tracker script and then when I finally got it working I created a custom component called myasuswrt.py which is still working fine for me. I don't understand how this new code works so have no idea how to fix the new component. You're welcome to try my hacked custom component to see if it works for you - you'll find it through my GitHub profile.
Same here on a RT-AC66U using Telnet. Using 0.83.3
Also, my logs are spammed with failing up/download stats.
I've got the same problem with device tracking not working since upgrading to 83.3. I'm also getting the failed upload and download stats. I'm using telnet as well.
I'm pretty sure this is affecting a large number of people, forums are littered with unhappy campers.
I'm going to roll back to 82 until this is resolved, hope this issue gets the urgency it deserves.
I have the same problem.
I am running HassOS 1.13 on raspberry pi3 and the router is Asus RT-N18U in router mode. I use telnet. It was working fine until .83.
The log is full with "Update for sensor.asuswrt_xxxx fails". The device tracker works for a few minutes and then sets all devices as away. The speed sensors started working since .83.3 but only for a few minutes also.
I tried adding an edited version of assuswrt.py in config/custom_components , where I just removed the sensor init part. It worked for a few days on .83.2 but not anymore on .83.3.
It seems this issue has been narrowed to the telnet method. I am now using a modified version of the old device_tracker that works well.
https://pastebin.com/JHew4djg
Use this code instead of the new component as a custom component. Seems to be a functional replacement for the short term.
I'm not using the telnet method. I connect to the router with SSH and private key.
I too have the problem that devices go offline short time after they are seen. They never return to "home". I'm speculating that consider_home and interval_seconds does not work in the device tracker component.
It seems this issue has been narrowed to the telnet method. I am now using a modified version of the old device_tracker that works well.
https://pastebin.com/JHew4djg
Use this code instead of the new component as a custom component. Seems to be a functional replacement for the short term.
Where do you put that file, and how do you configure it in configuration.yaml?
It seems this issue has been narrowed to the telnet method. I am now using a modified version of the old device_tracker that works well.
https://pastebin.com/JHew4djg
Use this code instead of the new component as a custom component. Seems to be a functional replacement for the short term.Where do you put that file, and how do you configure it in configuration.yaml?
Just make sure you configured the device tracker as usual, there is no need for a special configuration.
Create a folder in your confid dir, ex: config/custom_components/device_tracker/ and put the file there. Rename it to asuswrt.py
It seems this issue has been narrowed to the telnet method. I am now using a modified version of the old device_tracker that works well.
https://pastebin.com/JHew4djg
Use this code instead of the new component as a custom component. Seems to be a functional replacement for the short term.
I just installed it and it is working for now without issues. Thank you!
Had to remove the pexpect requirement to get it to work.
It seems this issue has been narrowed to the telnet method. I am now using a modified version of the old device_tracker that works well.
https://pastebin.com/JHew4djg
Use this code instead of the new component as a custom component. Seems to be a functional replacement for the short term.Where do you put that file, and how do you configure it in configuration.yaml?
Just make sure you configured the device tracker as usual, there is no need for a special configuration.
Create a folder in your confid dir, ex: config/custom_components/device_tracker/ and put the file there. Rename it to asuswrt.py
Thanks, that worked out perfectly :D
Im testing the custom component, I'll let you guys know if it works for more than a day..
Update: it doesn't work for me (I even changed the permissions to 755).. I'm getting the same error message:
2018-12-10 19:35:53 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:36:06 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:36:19 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:36:32 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:36:45 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:36:46 ERROR (SyncWorker_0) [homeassistant.components.sensor.command_line] Command failed: head -5 /home/homeassistant/.homeassistant/.HA_VERSION
2018-12-10 19:36:58 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:37:11 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:37:24 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:37:37 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:37:47 ERROR (SyncWorker_2) [homeassistant.components.sensor.command_line] Command failed: head -5 /home/homeassistant/.homeassistant/.HA_VERSION
2018-12-10 19:37:50 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:38:03 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:38:16 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:38:28 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
2018-12-10 19:38:41 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from asuswrt took longer than the scheduled scan interval 0:00:12
I added the custom component yesterday evening and everything is still working after 12 hours.
Keep in mind that you need to use the old way of defining the device tracker.
Oh! Thanks for pointing out the custom component workaround requires the old original "-platform: asuswrt" config setup.
Can you guys explain how to set it up please?
I added the custom component yesterday evening and everything is still working after 12 hours.
Keep in mind that you need to use the old way of defining the device tracker.
what's the old way of defining the device tracker? I just bought the router..
Can you guys explain how to set it up please?
I added the custom component yesterday evening and everything is still working after 12 hours.
Keep in mind that you need to use the old way of defining the device tracker.what's the old way of defining the device tracker? I just bought the router..
Create the path custom_components/device_tracker in your Home Assistant config root folder and create a file asuswrt.py in the device_tracker folder. Copy and paste all the content from pastebin in it.
And then add this to your configuration file:
device_tracker:
- platform: asuswrt
host: 192.168.X.X
username: XXX
password: XXX
protocol: telnet
mode: router
track_new_devices: false
interval_seconds: 12
consider_home: 0:10:00
This is still not fixed for me in 0.84.2, same problem and error log as in the original issue description. AC68U with Merlin. Using SSH. I've noticed that exactly at 12:00AM (midnight) it stops working and shows all devices as not_home
. If I run the aioasuswrt
example script manually, I see all the devices returned properly.
EDIT: fixed after upgrading Merlin firmware to 384.8_2
I gave the new asuswrt component another try under 84.6 and have the exact problem as described by the OP. So it's not fixed for me either. The download/upload stats the new component provides did work, but were only mildly interesting to me.
This device tracker is working fine using the older modified version of asuswrt.py that @WreXplorer provided (using SSH).
Router: ASUS RT-AC86U - latest asuswrt firmware 3.0.0.4.384_45149. (I considered rebuilding it with Merlin but don't want to lose AIMesh capability, so staying stock for now.)
Before I open a new case on this, how does one run the test scripts on HassIO provided by @kennedyshead on his repo? It's not able to import AsusWrt from the main HASSIO Docker container.
python3 asusdebug test
Traceback (most recent call last):
File "asusdebug", line 7, in <module>
from aioasuswrt.asuswrt import AsusWrt
ModuleNotFoundError: No module named 'aioasuswrt'
I'm having the same problem again under 84.6 ... it was working fine for days until I updated HomeAssistant to the latest version.
The exact same error log..
I am also still suffering from this issue with 84.6 using telnet connection. In fact, since the 84.2 that was supposed to address this, using this component appears to break internet connection for most devices on my network until I disable the component and reboot the router. I have an ASUS RT-AC51U.
Running HassIO 0.84.6 and RT-N66U with latest Asus firmware and thus connecting via Telnet. I have no problems with presence detection anymore, but I had to significantly increase the consider_home
value (from 180 to 1200 seconds) (and also moved this parameter to the known_devices.yaml
file). I do have problems with the sensors. They have no values. In the log there are messages on asuswrt sensors. Examples are:
2019-01-02 09:48:22 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.asuswrt_upload_speed fails
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update
await self.async_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 88, in async_update
await super().async_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 53, in async_update
self._rates = await self._api.async_get_packets_total()
File "/usr/local/lib/python3.6/site-packages/aioasuswrt/asuswrt.py", line 194, in async_get_packets_total
data = await self.connection.async_run_command(_IP_LINK_CMD)
File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 90, in async_run_command
await self.async_connect()
File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 110, in async_connect
await self._reader.readuntil(b'Password: ')
File "/usr/local/lib/python3.6/asyncio/streams.py", line 581, in readuntil
yield from self._wait_for_data('readuntil')
File "/usr/local/lib/python3.6/asyncio/streams.py", line 452, in _wait_for_data
'already waiting for incoming data' % func_name)
RuntimeError: readuntil() called while another coroutine is already waiting for incoming data
2019-01-02 09:48:22 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.asuswrt_download fails
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state
await self.async_device_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update
await self.async_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 106, in async_update
await super().async_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 53, in async_update
self._rates = await self._api.async_get_packets_total()
File "/usr/local/lib/python3.6/site-packages/aioasuswrt/asuswrt.py", line 194, in async_get_packets_total
data = await self.connection.async_run_command(_IP_LINK_CMD)
File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 90, in async_run_command
await self.async_connect()
File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 110, in async_connect
await self._reader.readuntil(b'Password: ')
File "/usr/local/lib/python3.6/asyncio/streams.py", line 581, in readuntil
yield from self._wait_for_data('readuntil')
File "/usr/local/lib/python3.6/asyncio/streams.py", line 452, in _wait_for_data
'already waiting for incoming data' % func_name)
RuntimeError: readuntil() called while another coroutine is already waiting for incoming data
2019-01-02 09:48:32 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.asuswrt_upload is taking over 10 seconds
2019-01-02 09:48:53 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30
2019-01-02 09:49:24 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30
2019-01-02 09:49:55 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30
2019-01-02 09:50:26 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30
Running HassIO 0.84.6 and RT-N66U with latest Asus firmware and thus connecting via Telnet. I have no problems with presence detection anymore, but I had to significantly increase the
consider_home
value (from 180 to 1200 seconds) (and also moved this parameter to theknown_devices.yaml
file). I do have problems with the sensors. They have no values. In the log there are messages on asuswrt sensors. Examples are:2019-01-02 09:48:22 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.asuswrt_upload_speed fails Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state await self.async_device_update() File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update await self.async_update() File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 88, in async_update await super().async_update() File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 53, in async_update self._rates = await self._api.async_get_packets_total() File "/usr/local/lib/python3.6/site-packages/aioasuswrt/asuswrt.py", line 194, in async_get_packets_total data = await self.connection.async_run_command(_IP_LINK_CMD) File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 90, in async_run_command await self.async_connect() File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 110, in async_connect await self._reader.readuntil(b'Password: ') File "/usr/local/lib/python3.6/asyncio/streams.py", line 581, in readuntil yield from self._wait_for_data('readuntil') File "/usr/local/lib/python3.6/asyncio/streams.py", line 452, in _wait_for_data 'already waiting for incoming data' % func_name) RuntimeError: readuntil() called while another coroutine is already waiting for incoming data 2019-01-02 09:48:22 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.asuswrt_download fails Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 221, in async_update_ha_state await self.async_device_update() File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update await self.async_update() File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 106, in async_update await super().async_update() File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/asuswrt.py", line 53, in async_update self._rates = await self._api.async_get_packets_total() File "/usr/local/lib/python3.6/site-packages/aioasuswrt/asuswrt.py", line 194, in async_get_packets_total data = await self.connection.async_run_command(_IP_LINK_CMD) File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 90, in async_run_command await self.async_connect() File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 110, in async_connect await self._reader.readuntil(b'Password: ') File "/usr/local/lib/python3.6/asyncio/streams.py", line 581, in readuntil yield from self._wait_for_data('readuntil') File "/usr/local/lib/python3.6/asyncio/streams.py", line 452, in _wait_for_data 'already waiting for incoming data' % func_name) RuntimeError: readuntil() called while another coroutine is already waiting for incoming data 2019-01-02 09:48:32 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.asuswrt_upload is taking over 10 seconds 2019-01-02 09:48:53 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30 2019-01-02 09:49:24 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30 2019-01-02 09:49:55 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30 2019-01-02 09:50:26 WARNING (MainThread) [homeassistant.components.sensor] Updating asuswrt sensor took longer than the scheduled update interval 0:00:30
This will get solved in https://github.com/home-assistant/home-assistant/pull/19714
https://github.com/kennedyshead/aioasuswrt/commit/2469e2cbc9cdae8dcf1642663a7ffbfd19fe91f8
https://github.com/kennedyshead/aioasuswrt/commit/a7e869503175764ffa450e2b1c930ff24efd938d
This will get solved in #19714
kennedyshead/aioasuswrt@2469e2c
kennedyshead/aioasuswrt@a7e8695
I don't understand why it was working for several days and all of it sudden stopped working completely, I haven't changed anything in my HA configuration. I just upgraded to the latest version in docker.
It seems this issue has been narrowed to the telnet method. I am now using a modified version of the old device_tracker that works well.
https://pastebin.com/JHew4djg
Use this code instead of the new component as a custom component. Seems to be a functional replacement for the short term.
This custom component still working? For me, no longer working since 0.89.
I am still experiencing this on 0.94.0. I have been switching between ssh and telnet with no luck.
I have been using telnet since 0.93 and it appears stable. I stopped using the modified one then. Please make sure you are using an official power supply as the raspberry Pi seems to require the 5.1v to do anything without issues.
asuswrt:
host: 192.168.1.1
username: router_user
password: router_pass
protocol: ssh
port: 22
device_tracker:
- platform: asuswrt
new_device_defaults:
track_new_devices: False
Tried a whole bunch of configurations but this one got it working for me. Make sure to enable ssh with a password on your router.
Most helpful comment
Same here on a RT-AC66U using Telnet. Using 0.83.3
Also, my logs are spammed with failing up/download stats.