Asuswrt config not working 0.83.1


#41

I’m using the new component and the existing one with the extra parameters and my devices show as away when they’re not. Logs look like the component keeps trying to establish an ssh connection (with the router?). Not sure if it’s related.

2018-12-05 00:11:29 INFO (MainThread) [homeassistant.components.device_tracker.asuswrt] Checking Devices
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=144] Requesting new SSH session
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=144]   Command: PATH=$PATH:/bin:/usr/sbin:/sbin && for dev in `nvram get wl1_vifs && nvram get wl0_vifs && nvram get wl_ifnames`; do if type wlanconfig > /dev/null; then wlanconfig $dev list | awk 'FNR > 1 {print substr($1, 0, 18)}'; else wl -i $dev assoclist; fi; done
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=144] Received exit status 0
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=144] Received channel close
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=144] Channel closed
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=145] Requesting new SSH session
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=145]   Command: PATH=$PATH:/bin:/usr/sbin:/sbin && arp -
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=145] Received exit status 0
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=145] Received channel close
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=145] Channel closed
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=146] Requesting new SSH session
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=146]   Command: PATH=$PATH:/bin:/usr/sbin:/sbin && ip neig
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=146] Received exit status 
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=146] Received channel close
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=146] Channel closed
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=147] Requesting new SSH session
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=147]   Command: PATH=$PATH:/bin:/usr/sbin:/sbin && cat /var/lib/misc/dnsmasq.leases
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=147] Received exit status 0
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=147] Received channel close
2018-12-05 00:11:29 INFO (MainThread) [asyncssh] [conn=0, chan=147] Channel closed

#42

Thanks everyone for your comments and information. I’m waiting for the update 0.83.3 to appear in Hass.io for me to be able to test this, but the challenge I have is I have an Asus DSL-N55U which doesn’t give me the option for SSH, so I’m stuck with Telnet. Once I get it working as a component I’ll try and set it up as a device tracker as per feedback above.


#43

Good points: HA account you mean “root”?

When I log in my host (that hosts HASS) in the HASS docker i log in with “root”, when I log in my host (that hosts HASS) I do with a user “user”

My router username is “admin”


#44

I use python version and HA is running with a “homeassistant” account. I had to ssh with this account to my router to get the thumbprint added to HA profile.


#45

I see, i use hassio


#46

Thanks for hint.
I managed to get it working in the same manner as before by changing config from:

device_tracker:
  - platform: asuswrt
    host: 192.168.0.1
    username: my_username
    ssh_key: /ssl/ssh_asus_private_key
    new_device_defaults:
      track_new_devices: False
      hide_if_away: False

to

asuswrt:
  host: 192.168.0.1
  username: my_username
  ssh_key: /ssl/ssh_asus_private_key

device_tracker:
  - platform: asuswrt
    new_device_defaults:
      track_new_devices: False
      hide_if_away: False

#47

I just updated to 0.83.3 found this thread because my device tracker broke. Fixed it with the information here. Now there upload and download speed and amount in my frontend, undocumented on the asuswrt documentation page, non functional, they all say zero. How do I hide them?


#48

Upgraded to 0.83.3. Still broken with this config:

asuswrt:
  host: 192.168.1.1
  username: admin
  port: 2222
  ssh_key: /config/.ssh/hassio_to_router_private_ssh_key

Works fine to log in to the router with this command from hassio (no password prompt):

ssh -p 2222 [email protected] -i /config/.ssh/hassio_to_router_private_ssh_key

What I am missing here?
From log:

2018-12-07 20:32:26 INFO (MainThread) [homeassistant.loader] Loaded asuswrt from homeassistant.components.asuswrt
2018-12-07 20:32:26 INFO (MainThread) [homeassistant.setup] Setting up asuswrt
2018-12-07 20:32:27 ERROR (MainThread) [homeassistant.setup] Error during setup of component asuswrt
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/asuswrt.py", line 57, in async_setup
  File "/usr/local/lib/python3.6/site-packages/aioasuswrt/connection.py", line 65, in async_connect

#49

my two cents: also had issues after upgrading from 0.80.x to 0.83.3.
changed my config to:

 asuswrt:
   host: 192.168.2.1
   username: !secret router_username
   password: !secret router_password
   protocol: telnet

device_tracker:
  - platform: asuswrt
    new_device_defaults:
      track_new_devices: False

Still asuswrt had errors.
Looking at the logs, it appears it was trying to connect to my router on port 22, however, it is clearly set to protocol telnet which means port should be 23.
after adding port: 23 to the asuswrt config it works!

This should be fixed in asuswrt.py. Telnet protocol should change default port to 23 and not 22.


#50

Tested replacing the ssh_key to password and that made it work. So it seems the ssh_key is broken in all new HA releases.


#51

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


#52

please help…

I upgraded to 0.83.3 and now the frontend won’t load, I can login over SSH.
but checking the confer results in:

core-ssh:~# hassio ha check
ERROR
INFO:homeassistant.util.package:Attempting install of colorlog==3.1.4
Testing configuration at /config
Failed config
  General Errors: 
    - Component not found: asuswrt
Successful config (partial)

while I have this in the configuration.yaml:

asuswrt:
  host: !secret asus_ip
  username: !secret asus_username
  password: !secret asus_password

and nothing left in the device_tracker setup.

One thing might be interfering?: because the base ip address is not usable since I have it set to use https and a https lan port:

I tested ipaddress:8443, but that didn’t make any difference…

If I use http in the router and rerun check:

core-ssh:~# hassio ha check

ERROR

INFO:homeassistant.util.package:Attempting install of colorlog==3.1.4

Testing configuration at /config

core-ssh:~#

so, error, but no clue…:-((

restart once more results in:

2018-12-11 15:10:43 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

device_tracker is not setup at all, startup hangs at this:

2018-12-11 15:11:23 INFO (MainThread) [homeassistant.setup] Setting up switch
2018-12-11 15:11:23 INFO (MainThread) [homeassistant.setup] Setting up light
2018-12-11 15:11:23 INFO (MainThread) [homeassistant.setup] Setting up script
2018-12-11 15:11:24 INFO (MainThread) [homeassistant.setup] Setting up device_tracker
2018-12-11 15:11:24 INFO (MainThread) [homeassistant.setup] Setting up automation
2018-12-11 15:11:39 WARNING (MainThread) [homeassistant.setup] Setup of script is taking over 10 seconds.
2018-12-11 15:11:41 INFO (MainThread) [homeassistant.setup] Setup of domain script took 17.9 seconds.
2018-12-11 15:11:42 INFO (MainThread) [homeassistant.setup] Setup of domain automation took 18.2 seconds.
2018-12-11 15:11:48 INFO (MainThread) [homeassistant.setup] Setting up webhook
2018-12-11 15:11:48 INFO (MainThread) [homeassistant.setup] Setup of domain webhook took 0.0 seconds.
2018-12-11 15:11:48 INFO (MainThread) [homeassistant.setup] Setup of domain switch took 24.6 seconds.
2018-12-11 15:11:48 INFO (MainThread) [homeassistant.setup] Setup of domain light took 24.7 seconds.
2018-12-11 15:11:51 INFO (MainThread) [homeassistant.setup] Setup of domain binary_sensor took 93.2 seconds.

nothing after that…
So, I’m lost really


#53

do you use the plain 192.168.1.1 or use it with a port?
I have secure connection setup:

and fear this is causing this error:

2018-12-11 16:14:33 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

any hints to get my frontend back are appreciated. The system is working, i can shell in ssh and see the mqtt hub working

should i use
host: 192.168.1.1
host: https://192.168.1.1
host: https://192.168.1.1:8443


#54

short post;
disabled Asuswrt completely (split setup between asuswrt: and device_tracker: as suggested here and elsewhere didn’t work either)

still no luck, no frontend… system works though.

Component device tracker was never setup properly according to the logs, so rechecked all, and found OwnTracks to have its own setup now, versus the device_tracker component. changed that, and finally got my frontend back.
Relying on Nmap for local network scanning seems to work allright.

Hope this helps getting my asuswrt back again too, up for test now…

33

nope…
so even correcting the OwnTracks issue doesn’t resolve the asuswrt config error.

cheers


#55

I used to have setup the connection via telnet. That is not a line which is added in config anymore but the router has still the setting turned on. I’m on the merlin router firmware though.