Mikrotik devices not seen in known_devices.yaml

I am having trouble with using Mikrotik to track devices. I have a 2011UiAS as main switch which does the CAPsMAN part. I then have 3 952Ui-5ac2nD throughout the house for coverage.

Have setup the following in the config:

- platform: mikrotik
  host: 192.168.7.5
  username: assistant
  password: !secret mikrotik_password
  interval_seconds: 10
  consider_home: 180

I can see the following in the log:

2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '!re'                                                                                       
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=.id=*E75'                                                                                 
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=interface=<hidden>'                                                                  
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=ssid=<hidden>'                                                                            
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=mac-address=B8:27:EB:**:**:**'                                                            
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=tx-rate=72.2Mbps-20MHz/1S/SGI'                                                            
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=rx-rate=43.3Mbps-20MHz/1S/SGI'                                                            
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=rx-signal=-65'                                                                            
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=uptime=3h33m10s50ms'                                                                      
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=packets=91756,99668'                                                                      
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=bytes=14656141,73707442'                                                                  
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=tx-rate-set=CCK:1-11 OFDM:6-54 BW:1x-2x SGI:1x HT:0-7'                                    
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=eap-identity='                                                                            
2018-02-23 20:01:45 DEBUG (Thread-14) [librouteros] ---> '=comment=Raspberry Pi Wifi'

But the known_devices.yaml doesn’t get populated with any (new) devices, and also a device that I have put in there manually keep the state ‘not home’. I am following 2 other devices (mobiles) via GPSlogger which works perfectly.

Am I doing something wrong?

I’m using SNMP for device tracking with MikroTik 951 and 962 and it works flawlessly, here’s my configuration:

device_tracker:
  - platform: snmp
    host: !secret snmp_host
    community: !secret snmp_community
    baseoid: 1.3.6.1.2.1.4.22.1.2.9
    interval_seconds: 60
    consider_home: 180

You need to configure the mikrotik to give access via SNMP and ensure the OIDs. On https://home-assistant.io/components/device_tracker.snmp/ there’s an OID for a RB 2011.

As to tracking devices, you might need to configure the tracker to automatically add new devices:

new_device_defaults:
  track_new_devices: True

Thanks for that. I have already tried SNMP but was hoping that the actual module would work.

I have reverted back to SNMP, thank you for the example. The only thing is that I had to change the IOD to make it work to:

baseoid: 1.3.6.1.4.1.14988.1.1.1.5

Perhaps it’s a version mismatch and the API doesn’t return the expected format.