The integration works OK but I can’t configure consider_home nor track_new_devices. I’m not sure what’s the default values for those now or how to change them.
I followed the HA 0.9 release post and also checked the PR and could not find anything about this topic.
I’m having the exact same issue. Not clear how to tweak it as “consider_home” isn’t accepted as a valid configuration.
It pretty much made my device tracking useless.
I’m thinking of using the “wait” option for track depended automation until i’ll get a better picture how to change it.
To trigger a action based on my phone I use the following in automations.yaml
- id: '1539016025565'
alias: Light On Arriving Home After Dark
trigger:
- entity_id: device_tracker.myphone
from: not_home
platform: state
to: home
action:
- entity_id: switch.living_room_light_switch
service: homeassistant.turn_on
I could not find a way to solve it without editing component files. I wrote to the devs on the github repo on a related issue. I’ll post back here if/when I get an answer.
I tried creating another tracker (ping the gateway) to be able to set the global values for the device tracker. Unfortunately only the ping tracker obeyed the configured interval, the frequency which the mikrotik was queried did not change (appears to be around 12s). I didn’t experiment to see if the consider_home value was used.
I was on 0.98 and it was working, I just upgraded to 0.98.2 and it’s working.
But in the past I was using SNMP to track as I found that method more reliable and have added that method back in. I just took my Pixel off wi-fi and within a few minutes my device went into “not_home”. Turned wi-fi back on and within changed back to “home”…so working for me.
Obviously you have to have SNMP enabled on the Mtik if you go this route.
I have entered the settings as above but now I am getting this error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 65, in async_setup_legacy
self.platform.get_scanner, hass, {DOMAIN: self.config}
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 35, in get_scanner
return scanner if scanner.success_init else None
UnboundLocalError: local variable 'scanner' referenced before assignment
Enable SNMP on the Mtik and track that way, this has been for me the most reliable method of tracking devices whether DHCP or static, but this is only for wi-fi.