Asuswrt device tracker is broken - please release a fix

Just for those who are still struggling to find out if it could/should work. The confuration below does work for me.
Config: Asus-RT66U Hass.io version: 0.83.3

Configuration.yaml:
asuswrt:
host: 192.168.1.1
username: !secret Asus_User_Name
password: !secret Asus_Password
protocol: telnet
port: 23

device_tracker:
- platform: asuswrt
consider_home: 180
new_device_defaults:
track_new_devices: True
hide_if_away: False

Hope this helps a little.
Jan

3 Likes

You need to post your code in the proper format per the box at the top of the page.

Hi all, next config, work for me :slightly_smiling_face:

Router

HOME ASSISTANT

Configured using SSH with user/pass
Version Home Assistant 0.83.2

configuration.yaml

asuswrt:
      host: 192.168.2.1
      username: superadmin
      password: secret

I wasn’t actually on Merlin on this router. Changing firmware, and using ssh did the trick.

I still have poroblem, do you have as this in you router?

Confirm it worked with telnet enabled on standard firmware of RT-N65U. Hass version: 0.83.3
Edit: only works for a limited time after restart (ca.15 minutes), so no luck.

For those who still has issues, this worked for me. Pretty much gives you the good old component.

just a +1 for the OP : please release a fix…

moved today to 83.3 changed all according to the docs (including the new Owntracks component, which is working just fine) and this config:

#configuration.yaml

asuswrt:
  host: !secret asus_ip
  username: !secret asus_username
  password: !secret asus_password
  # port: 22 tried with and without

fyi: these secrets are the exact same as previously used in the device_tracker. So plain ip address, no http(s) in front of it, no port.

my router uses ssh port 22.

still this happens in the log:

2018-12-11 17:59:51 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform asuswrt
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/__init__.py", line 174, in async_setup_platform
    hass, {DOMAIN: p_config})
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 46, in async_get_scanner
    await scanner.async_connect()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 71, in async_connect
    data = await self.connection.async_get_connected_devices()
  File "/usr/local/lib/python3.6/site-packages/aioasuswrt/asuswrt.py", line 165, in async_get_connected_devices
    dev = await self.async_get_wl()
  File "/usr/local/lib/python3.6/site-packages/aioasuswrt/asuswrt.py", line 101, in async_get_wl
    lines = await self.connection.async_run_command(_WL_CMD)
  File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 31, in async_run_command
    await self.async_connect()
  File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 62, in async_connect
    self._client = await asyncssh.connect(self._host, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/misc.py", line 169, in __await__
    return (yield from self._coro)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/connection.py", line 5442, in connect
    conn, _ = yield from create_connection(None, host, port, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/connection.py", line 5100, in create_connection
    local_addr=local_addr)
  File "uvloop/loop.pyx", line 1879, in create_connection
  File "uvloop/loop.pyx", line 1858, in uvloop.loop.Loop.create_connection
ConnectionRefusedError: [Errno 111] Connection refused

I’ve deleted the old device_tracker settings, so why it is complaining about that is a true mystery? Unless the new asuswrt is still a device_tracker in the backend of course.

Any suggestions for a solution other than wait for the next release…?

The docs have been updated to say that enabling the asuswrt component automatically configures the asuswrt device_tracker.

I don’t remember, do you use hassio, hass in a venv or hass in docker?

I am using Hassio 0.83.3, and all I have set now is what I posted above.

router:

dont suppose the https and lan port 8443 are causing trouble?

the reason I asked is that I am running hass in docker and there have been a couple of instances that I suddenly lost permission to log in to the router. Once was when I upgraded my router to a new one but I don’t remember what the cause was the second time. But I know then that I had to console into the hass container and try to login to my router via SSH from there. It then gave me an error stating that my host keys were invalid. It even told me what to do to fix the problem.

Here is the thread I made to help anybody else in the future:

And I’m also using the same configuration that you have in your screenshot above aside from only a couple differences in that I have mine set up for lan access only so I only use http for access, not https.

thank you vm.
I tried your commands from the terminal, but none of these work unfortunately…
What i did try is disable ssh, save, and enable again. Maybe that takes care of things internally in the router, rebooting as we speak.

Still, since I didn’t change anything in he router setup, I wonder if this issue could be caused by a setup change on HA side. Suppose it might have been there before, but Ive never seen anything directly related to asuswrt in the logs.

to be sure, what would be the ssh command to login in the router?

restarting still has an issue its asuswrt, but this time it is different:

2018-12-12 00:48:39 ERROR (MainThread) [homeassistant.setup] Error during setup of component asuswrt
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
    hass, processed_config)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/asuswrt.py", line 57, in async_setup
    await api.connection.async_connect()
  File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 65, in async_connect
    self._client = await asyncssh.connect(self._host, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/misc.py", line 182, in __await__
    return (yield from self._coro)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/connection.py", line 5451, in connect
    conn, _ = yield from create_connection(None, host, port, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/connection.py", line 5100, in create_connection
    local_addr=local_addr)
  File "uvloop/loop.pyx", line 1879, in create_connection
  File "uvloop/loop.pyx", line 1858, in uvloop.loop.Loop.create_connection
ConnectionRefusedError: [Errno 111] Connection refused

my username is ‘testing’ and my router IP is 192.168.1.1 so it would be:

ssh -l testing 192.168.1.1

Have you tried to change the “enable SSH” setting to “LAN only” and change the “authentication method” to “http” instead of “https” in the router config? Like I noted above those are the only differences between my router set up and yours.

keep getting this:

ssh: connect to host 192.168.1.1 port 22: Connection refused

Ive now changed to http and Lan only, and rebooting. Maybe this helps. thanks for your assistance. Would seem strange though if using an un-secure http connection would be needed for connecting…

well, it doesn’t help:

2018-12-12 01:16:08 ERROR (MainThread) [homeassistant.setup] Error during setup of component asuswrt
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
    hass, processed_config)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/asuswrt.py", line 57, in async_setup
    await api.connection.async_connect()
  File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 65, in async_connect
    self._client = await asyncssh.connect(self._host, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/misc.py", line 182, in __await__
    return (yield from self._coro)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/connection.py", line 5451, in connect
    conn, _ = yield from create_connection(None, host, port, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/asyncssh/connection.py", line 5100, in create_connection
    local_addr=local_addr)
  File "uvloop/loop.pyx", line 1879, in create_connection
  File "uvloop/loop.pyx", line 1858, in uvloop.loop.Loop.create_connection
ConnectionRefusedError: [Errno 111] Connection refused

Do you have another machine to SSH into your router from to verify it’s not a router issue?

yes, I am trying to do so from my mac and can’t get in. keep getting:

ssh: connect to host 192.168.1.1 port 22: Connection refused

so it seems this is caused on the Router. I don’t understand though, why the HA upgrade has caused this, or, if not, how the previous settings before the update weren’t bothered.

My asus app logs in without trouble so it seems, and I can see my router page in the browser and change settings. But that is using the https connection method of course…

you need some more feedback from ssh. -v goves you verbose output, and every time you add another v you get more feedback. So try

ssh -vvv [then the rest of your normal ssh command]

nice! didn’t know that, thanks.

result:

OpenSSH_7.7p1, LibreSSL 2.7.3

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: /etc/ssh/ssh_config line 48: Applying options for *

debug2: resolve_canonicalize: hostname 192.168.1.1 is address

debug2: ssh_connect_direct: needpriv 0

debug1: Connecting to 192.168.1.1 [192.168.1.1] port 22.

debug1: connect to address 192.168.1.1 port 22: Connection refused

ssh: connect to host 192.168.1.1 port 22: Connection refused

was thinking maybe the firewall causes this, but disabling that gives the same result.

I guess the other test is

nmap -p 22 IPADDR

and see if the port is even open (or run ssh with another v)

I tried adding another v but that didn’t change the output.
nmap sint recognized:

nmap -p 22 192.168.1.1

-bash: nmap: command not found

just to be 100% positive about the ip address:

https://192.168.1.1:8443 logs me in to the webinterface .

I had capitals in my username, thought that might trouble the setup, so took these out. Still no luck…
btw, I use a RT-AC3200

—UPDATE—

I am in! after changing all obvious and less obvious settings in the router, I changed login name to lowercase only and logged out to login with the new username. Of course I was locked out… simply no way to login anymore, mac or app.

decided the last and final option before resetting factory settings, and hardware rebooted.
et voilà: the ssh into the router went smooth as silk:

debug2: we sent a password packet, wait for reply

debug3: receive packet: type 52

debug1: Authentication succeeded (password).

Authenticated to 192.168.1.1 ([192.168.1.1]:22).

now hoping HA can log in too…#fingerscrossed

–UPDATE2–

bingo!

2018-12-12 10:01:00 INFO (MainThread) [homeassistant.setup] Setup of domain asuswrt took 13.4 seconds.

13

thanks for all your help!!