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.
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.
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.
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