Alternate device_tracker component for ASUSWRT

Thanks for the report! I tried handling the AssertionError, and it helps. However, there are a lot of other unhandled errors from various failing connections to sensors, etc. due to the network being down. So, not sure if it makes a lot of sense to fix this, but I made a pull request with the handled error, nonetheless.

Sorry for the withdrawn message, I thought I’ll write an updated message since there’s a fix. You can find the change in the pull request here: https://github.com/home-assistant/home-assistant/pull/7750/files.

Strange, the component with the latest PR doesn’t re-connect after rebooting the router. The Home Assistant still displays:

2017-05-24 23:14:52 ERROR (Thread-4) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.
2017-05-24 23:15:05 ERROR (Thread-4) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.
2017-05-24 23:15:18 ERROR (Thread-12) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.
2017-05-24 23:15:31 ERROR (Thread-7) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.
2017-05-24 23:15:44 ERROR (Thread-6) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.
2017-05-24 23:15:56 ERROR (Thread-9) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.
2017-05-24 23:16:09 ERROR (Thread-3) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.
2017-05-24 23:16:22 ERROR (Thread-3) [homeassistant.components.device_tracker.asuswrt] Connection to router unavailable.

There is no information about connection attempt in the router log. This evening I will check the previous version of the component again.

Strange, indeed. I tested it at home, and it reconnected successfully once the router booted up. Let me know if anything changes, I’ll close the PR for now, until we know for sure it works properly.

EDIT: Can confirm, same thing happens here. Might be a statistical thing (sometimes happens, sometimes doesn’t). I’m trying out some changes to the code to make a consistent fix.

@Bieniu,

OK, I think I fixed it. I changed the way the pxssh object lifetime is handled, and now it seems to work properly, and the AssertionError handling is redundant (it never happens). I’ll leave the handling, just in case, but regardless, I’m pushing a PR with the fix (it’s the same PR from the previous message, you can get the updated version from there). Let me know if it works for you - I tried it several times in a row, and haven’t run into any problems.

@aronsky I’ll check tonight how it works with my config and I’ll let you know.

EDIT:
I have tried three times and so far so good. Moment after reboot component reconnect to the router. Greate job.

Excellent. Waiting for the PR to get accepted.

I’ve changed the interval seconds but nothing happened. Any suggestions? TY

Sorry for bothering you but the fix didn’t worked for me.

I still receive error when using the component:

[homeassistant.components.device_tracker.asuswrt] Connection refused. SSH enabled?

But SSH is enable and active.

This is my config:

  platform: asuswrt
  host: xxx.xxx.x.x
  username: admin
  password: xxxxxxxxxxxx
  interval_seconds: 20
  consider_home: 180
  track_new_devices: yes

Can someone please help me?

Thank you in advance

make sure SSH is enable on your router sign in to your router click on the administration tab then click on system you will see SSH by default is set to NO change it to YES click on apply them restart homeassistant

SSH in enabled and worked fine until a firmware upgrade.

Now i solved the issue using telnet :slight_smile: