Skip to content

Mikrotik device_tracker login fails if RouterOS >= 6.45.1 #25189

Description

@Bouni

Home Assistant release with the issue:
0.95.4

Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io on RPi3B+

Component/platform:
mikrotik

Description of problem:
Mikrotik Router shows echo: system,error,critical login failure for user homeassistant from 192.168.23.1 via api in the logs. Device tracker is not working due to inability to login.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

- platform: mikrotik
  host: 192.168.23.1
  track_new_devices: false
  username: !secret mikrotik_username
  password: !secret mikrotik_password

Additional information:
From Mikrotik changelogs:

Important note!!!
Due to removal of compatibility with old version passwords in this version, downgrading to any version prior to v6.43 (v6.42.12 and older) will clear all user passwords and allow password-less authentication. Please secure your router after downgrading.
Old API authentication method will also no longer work, see documentation for new login procedure:
https://wiki.mikrotik.com/wiki/Manual:API#Initial_login

librouteros has a kwarg that allows to use a different login approach to allow for a successful login:
https://github.com/luqasz/librouteros/blob/2.x/librouteros/__init__.py#L39

I've already tested a fix that passes a tuple with the login methods to the connect method of librouteros that passes the plain method first followed by the token method.
As the methods are used in the given order, that works fine for me but will result in a error message in the router logs for users with RouterOS versions < 6.43.

Would you suggest a additional config option that allows to select a login method or live with the log entry and simply pass the plan method first?
Hopefully all users will get to a Router OS version > 6.43 within a certain amount of time and this will solve itself :-)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions