home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.41k stars 30.3k forks source link

Mikrotik HUB problem with multiple independent APs/HUBs #32584

Closed emresumengen closed 4 years ago

emresumengen commented 4 years ago

The problem

Running multiple independent Mikrotik APs (hubs?), HA integration seems to be able to track clients only on 1 of the APs (1st one added?). When the client roams to the 2nd AP, it is marked AWAY.

Environment

Problem-relevant configuration.yaml

No configuration in configuration.yaml. Used configuration flow within the UI.

Traceback/Error logs

2020-03-08 18:38:14 DEBUG (SyncWorker_4) [homeassistant.components.mikrotik.hub] Connecting to Mikrotik hub [10.0.0.1]
2020-03-08 18:38:14 DEBUG (SyncWorker_4) [homeassistant.components.mikrotik.hub] Connected to 10.0.0.1 successfully
2020-03-08 18:38:23 INFO (SyncWorker_0) [homeassistant.components.mikrotik.hub] Running command /system/identity/getall
2020-03-08 18:38:23 INFO (SyncWorker_0) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:23 INFO (SyncWorker_0) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:23 INFO (SyncWorker_0) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:23 INFO (SyncWorker_0) [homeassistant.components.mikrotik.hub] Running command /caps-man/interface/print
2020-03-08 18:38:23 INFO (SyncWorker_0) [homeassistant.components.mikrotik.hub] Running command /interface/wireless/print
2020-03-08 18:38:25 DEBUG (SyncWorker_19) [homeassistant.components.mikrotik.hub] updating network devices for host: 10.0.0.1
2020-03-08 18:38:25 INFO (SyncWorker_19) [homeassistant.components.mikrotik.hub] Running command /ip/dhcp-server/lease/getall
2020-03-08 18:38:26 DEBUG (SyncWorker_19) [homeassistant.components.mikrotik.hub] Hub supports wireless Interface
2020-03-08 18:38:26 INFO (SyncWorker_19) [homeassistant.components.mikrotik.hub] Running command /interface/wireless/registration-table/getall
2020-03-08 18:38:26 INFO (SyncWorker_19) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:26 DEBUG (SyncWorker_14) [homeassistant.components.mikrotik.hub] Connecting to Mikrotik hub [10.0.0.2]
2020-03-08 18:38:26 DEBUG (SyncWorker_14) [homeassistant.components.mikrotik.hub] Connected to 10.0.0.2 successfully
2020-03-08 18:38:27 INFO (SyncWorker_6) [homeassistant.components.mikrotik.hub] Running command /system/identity/getall
2020-03-08 18:38:27 INFO (SyncWorker_6) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:27 INFO (SyncWorker_6) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:27 INFO (SyncWorker_6) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:27 INFO (SyncWorker_6) [homeassistant.components.mikrotik.hub] Running command /caps-man/interface/print
2020-03-08 18:38:27 INFO (SyncWorker_6) [homeassistant.components.mikrotik.hub] Running command /interface/wireless/print
2020-03-08 18:38:28 DEBUG (SyncWorker_8) [homeassistant.components.mikrotik.hub] updating network devices for host: 10.0.0.2
2020-03-08 18:38:28 INFO (SyncWorker_8) [homeassistant.components.mikrotik.hub] Running command /ip/dhcp-server/lease/getall
2020-03-08 18:38:28 DEBUG (SyncWorker_8) [homeassistant.components.mikrotik.hub] Hub supports wireless Interface
2020-03-08 18:38:28 INFO (SyncWorker_8) [homeassistant.components.mikrotik.hub] Running command /interface/wireless/registration-table/getall
2020-03-08 18:38:28 INFO (SyncWorker_8) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 90:97:F3:04:11:5E (90:97:F3:04:11:5E)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker AC:5F:3E:B4:A6:C9 (AC:5F:3E:B4:A6:C9)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker rpizerow (B8:27:EB:32:38:3B)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 10:AE:60:48:A4:AA (10:AE:60:48:A4:AA)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mR4s (60:FA:CD:8A:35:25)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mRair (A0:CE:C8:0A:23:CB)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker aLLy-iXs (EC:2C:E2:30:6F:F9)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 78:4F:43:9E:3A:33 (78:4F:43:9E:3A:33)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 6C:F3:73:F1:B0:25 (6C:F3:73:F1:B0:25)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker hassio (08:00:27:58:38:35)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker Asemin6S (C8:D0:83:39:3D:5B)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker aLLyPro (78:4F:43:71:00:91)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker B8:17:C2:BB:07:DB (B8:17:C2:BB:07:DB)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker Asemin (B0:48:1A:72:55:A1)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker FatoPad (B0:34:95:E9:C7:A1)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mrWatch (EC:AD:B8:2D:05:6F)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 30:8C:FB:6B:4A:62 (30:8C:FB:6B:4A:62)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker GW-A0CC2B6D7AAF (A0:CC:2B:6D:7A:AF)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 00:D9:D1:50:9A:FF (00:D9:D1:50:9A:FF)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker MellanoX (E4:9A:DC:7E:46:C8)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 30:B5:C2:31:2A:A5 (30:B5:C2:31:2A:A5)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker wn8s-iPhoneu (E8:36:17:46:77:15)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 38:94:96:E2:1F:30 (38:94:96:E2:1F:30)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker Ceronimo (54:E4:3A:B0:DF:DB)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker sandbox (90:2B:34:9F:79:89)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker EQ-EQ6287015 (D4:25:8B:D4:12:23)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mrmt-ap1 (B8:69:F4:D4:9F:F4)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker SemaSirnsiPhone (B0:19:C6:B3:99:E9)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mrTab2 (00:90:4C:48:7B:18)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 30:B5:C2:31:2A:A2 (30:B5:C2:31:2A:A2)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mRxs (C0:A6:00:27:E4:37)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker ftm (30:63:6B:8B:33:32)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mRair (98:E0:D9:7D:5F:83)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker LGwebOSTV (20:17:42:50:1C:38)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mRpro10 (DC:A4:CA:7E:FC:6C)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker mR5 (1C:E6:2B:10:57:89)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker Asemin (F0:C3:71:72:77:0F)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker AA:00:00:00:00:FF (AA:00:00:00:00:FF)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker Theater (40:6C:8F:1C:07:55)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker AseminW (EC:AD:B8:10:F6:A1)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 5C:93:A2:40:8B:CF (5C:93:A2:40:8B:CF)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker atv4 (C8:69:CD:0E:EE:86)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker EgeK (68:FE:F7:BA:33:07)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker hassio (B8:27:EB:F0:8D:84)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker CosXSMAX (F8:38:80:4E:CF:1A)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker 98:5A:EB:CB:97:2C (98:5A:EB:CB:97:2C)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker FC:0F:E6:32:F8:64 (FC:0F:E6:32:F8:64)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker atv2 (B8:17:C2:BB:07:DA)
2020-03-08 18:38:35 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] New network device tracker Galaxy-J8 (D4:E6:B7:D8:27:09)
2020-03-08 18:38:35 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: device_tracker.asemin. Platform mikrotik does not generate unique IDs
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mr4s (60:FA:CD:8A:35:25)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ftm (30:63:6B:8B:33:32)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrair (98:E0:D9:7D:5F:83)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ac_5f_3e_b4_a6_c9 (AC:5F:3E:B4:A6:C9)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrxs (C0:A6:00:27:E4:37)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.lgwebostv_2 (20:17:42:50:1C:38)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.78_4f_43_9e_3a_33 (78:4F:43:9E:3A:33)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrpro10 (DC:A4:CA:7E:FC:6C)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.6c_f3_73_f1_b0_25 (6C:F3:73:F1:B0:25)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mr5 (1C:E6:2B:10:57:89)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mellanox (E4:9A:DC:7E:46:C8)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.asemin (F0:C3:71:72:77:0F)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.90_97_f3_04_11_5e (90:97:F3:04:11:5E)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.aa_00_00_00_00_ff (AA:00:00:00:00:FF)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.theater (40:6C:8F:1C:07:55)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.aseminw (EC:AD:B8:10:F6:A1)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.5c_93_a2_40_8b_cf (5C:93:A2:40:8B:CF)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.atv4 (C8:69:CD:0E:EE:86)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.egek (68:FE:F7:BA:33:07)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.hassio (B8:27:EB:F0:8D:84)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.gw_a0cc2b6d7aaf (A0:CC:2B:6D:7A:AF)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.cosxsmax (F8:38:80:4E:CF:1A)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.98_5a_eb_cb_97_2c (98:5A:EB:CB:97:2C)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.00_d9_d1_50_9a_ff (00:D9:D1:50:9A:FF)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.fc_0f_e6_32_f8_64 (FC:0F:E6:32:F8:64)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.atv2 (B8:17:C2:BB:07:DA)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.allypro (78:4F:43:71:00:91)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.30_b5_c2_31_2a_a5 (30:B5:C2:31:2A:A5)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.galaxy_j8 (D4:E6:B7:D8:27:09)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.wn8s_iphoneu (E8:36:17:46:77:15)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.38_94_96_e2_1f_30 (38:94:96:E2:1F:30)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.30_8c_fb_6b_4a_62 (30:8C:FB:6B:4A:62)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ceronimo (54:E4:3A:B0:DF:DB)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.fatopad (B0:34:95:E9:C7:A1)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.90_2b_34_9f_79_89 (90:2B:34:9F:79:89)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.asemin_2 (B0:48:1A:72:55:A1)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.eq_eq6287015 (D4:25:8B:D4:12:23)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrwatch (EC:AD:B8:2D:05:6F)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrmt_ap1 (B8:69:F4:D4:9F:F4)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.b8_17_c2_bb_07_db (B8:17:C2:BB:07:DB)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.semasirnsiphone (B0:19:C6:B3:99:E9)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.hassio_2 (08:00:27:58:38:35)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrtab2 (00:90:4C:48:7B:18)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.10_ae_60_48_a4_aa (10:AE:60:48:A4:AA)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrair_2 (A0:CE:C8:0A:23:CB)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.30_b5_c2_31_2a_a2 (30:B5:C2:31:2A:A2)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ally_ixs (EC:2C:E2:30:6F:F9)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.asemin6s (C8:D0:83:39:3D:5B)
2020-03-08 18:38:51 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.rpizerow (B8:27:EB:32:38:3B)
2020-03-08 18:38:51 DEBUG (SyncWorker_2) [homeassistant.components.mikrotik.hub] updating network devices for host: 10.0.0.1
2020-03-08 18:38:51 INFO (SyncWorker_2) [homeassistant.components.mikrotik.hub] Running command /ip/dhcp-server/lease/getall
2020-03-08 18:38:52 DEBUG (SyncWorker_2) [homeassistant.components.mikrotik.hub] Hub supports wireless Interface
2020-03-08 18:38:52 INFO (SyncWorker_2) [homeassistant.components.mikrotik.hub] Running command /interface/wireless/registration-table/getall
2020-03-08 18:38:52 INFO (SyncWorker_2) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mr4s (60:FA:CD:8A:35:25)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.asemin (F0:C3:71:72:77:0F)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ftm (30:63:6B:8B:33:32)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.10_ae_60_48_a4_aa (10:AE:60:48:A4:AA)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrxs (C0:A6:00:27:E4:37)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mr5 (1C:E6:2B:10:57:89)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.30_b5_c2_31_2a_a2 (30:B5:C2:31:2A:A2)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.rpizerow (B8:27:EB:32:38:3B)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrpro10 (DC:A4:CA:7E:FC:6C)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrtab2 (00:90:4C:48:7B:18)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.lgwebostv_2 (20:17:42:50:1C:38)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.semasirnsiphone (B0:19:C6:B3:99:E9)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.90_97_f3_04_11_5e (90:97:F3:04:11:5E)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrmt_ap1 (B8:69:F4:D4:9F:F4)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ac_5f_3e_b4_a6_c9 (AC:5F:3E:B4:A6:C9)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.aa_00_00_00_00_ff (AA:00:00:00:00:FF)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.eq_eq6287015 (D4:25:8B:D4:12:23)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.90_2b_34_9f_79_89 (90:2B:34:9F:79:89)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ceronimo (54:E4:3A:B0:DF:DB)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.38_94_96_e2_1f_30 (38:94:96:E2:1F:30)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.wn8s_iphoneu (E8:36:17:46:77:15)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.00_d9_d1_50_9a_ff (00:D9:D1:50:9A:FF)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.30_b5_c2_31_2a_a5 (30:B5:C2:31:2A:A5)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mellanox (E4:9A:DC:7E:46:C8)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.gw_a0cc2b6d7aaf (A0:CC:2B:6D:7A:AF)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.30_8c_fb_6b_4a_62 (30:8C:FB:6B:4A:62)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.fatopad (B0:34:95:E9:C7:A1)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrwatch (EC:AD:B8:2D:05:6F)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.galaxy_j8 (D4:E6:B7:D8:27:09)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.asemin_2 (B0:48:1A:72:55:A1)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrair (98:E0:D9:7D:5F:83)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.atv2 (B8:17:C2:BB:07:DA)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.b8_17_c2_bb_07_db (B8:17:C2:BB:07:DB)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.fc_0f_e6_32_f8_64 (FC:0F:E6:32:F8:64)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.allypro (78:4F:43:71:00:91)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.98_5a_eb_cb_97_2c (98:5A:EB:CB:97:2C)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.asemin6s (C8:D0:83:39:3D:5B)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.cosxsmax (F8:38:80:4E:CF:1A)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.hassio_2 (08:00:27:58:38:35)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.hassio (B8:27:EB:F0:8D:84)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.6c_f3_73_f1_b0_25 (6C:F3:73:F1:B0:25)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.atv4 (C8:69:CD:0E:EE:86)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.78_4f_43_9e_3a_33 (78:4F:43:9E:3A:33)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.egek (68:FE:F7:BA:33:07)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.ally_ixs (EC:2C:E2:30:6F:F9)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.theater (40:6C:8F:1C:07:55)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.mrair_2 (A0:CE:C8:0A:23:CB)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.aseminw (EC:AD:B8:10:F6:A1)
2020-03-08 18:39:07 DEBUG (MainThread) [homeassistant.components.mikrotik.device_tracker] Updating Mikrotik tracked client device_tracker.5c_93_a2_40_8b_cf (5C:93:A2:40:8B:CF)
2020-03-08 18:39:07 DEBUG (SyncWorker_13) [homeassistant.components.mikrotik.hub] updating network devices for host: 10.0.0.1
2020-03-08 18:39:07 INFO (SyncWorker_13) [homeassistant.components.mikrotik.hub] Running command /ip/dhcp-server/lease/getall
2020-03-08 18:39:07 DEBUG (SyncWorker_13) [homeassistant.components.mikrotik.hub] Hub supports wireless Interface
2020-03-08 18:39:07 INFO (SyncWorker_13) [homeassistant.components.mikrotik.hub] Running command /interface/wireless/registration-table/getall
2020-03-08 18:39:07 INFO (SyncWorker_13) [homeassistant.components.mikrotik.hub] Running command /system/routerboard/getall

Additional information

I am running 2 x Mikrotik APs on the same network. I cannot run CAPsMAN because of Mikrotik limitations. APs are 10.0.0.1 and 10.0.0.2. They are both added through configuration flow, and logs indicate HA connects to them both (at first). But then it seems that only 1st one is being queried. In the above logs, device_tracker.asemin (B0:48:1A:72:55:A1) was connected to the 2nd AP (10.0.0.2) but HA showed it as AWAY.

probot-home-assistant[bot] commented 4 years ago

Hey there @engrbm87, mind taking a look at this issue as its been labeled with a integration (mikrotik) you are listed as a codeowner for? Thanks!

engrbm87 commented 4 years ago

Hello @emresumengen , devices are identified by their MAC address, if you are using Wireless interface for detection then make sure that the device with same mac address is showing in the registration table in both hubs.

emresumengen commented 4 years ago

Hello @engrbm87, As these are two independent mikrotik APs, their wireless registration tables are also independent of each other. But, the device is seen on either R1 (10.0.0.1) or AP1 (10.0.0.2) registration table, depending on which device the client is connected to.

For example (my phone mRxs with mac C0:A6:00:27:E4:37): on R1 (10.0.0.1) clearly is connected:

/interface wireless registration-table print where mac-address="C0:A6:00:27:E4:37"
# INTERFACE                                                         RADIO-NAME       MAC-ADDRESS       AP  SIGNAL-STRENGTH TX-RATE UPTIME              
0 ;;; mrXS
wlan1-5g                                                                           C0:A6:00:27:E4:37 no  -83dBm@6Mbps    6Mbps   24s                 

and HA shows the device HOME.

Similarly, when I'm in the other room, same device is seen as such in AP1's registration table. But then HA shows it AWAY.

Essentially, it cannot be seen registered in the wireless registration table in both hubs at the same time, unless it's CAPsMAN, which means the registration table is centralized. Again, this is a setup where the devices are not centralized.

This was working perfectly fine, without CAPsMAN.

emresumengen commented 4 years ago

@engrbm87, any comments or questions? I can try to help diagnose further, if necessary to find a solution.

engrbm87 commented 4 years ago

I also have 2 hubs with separate registration tables and the entities are updating just fine. Can you please confirm if you have enabled force_dhcp or arp_ping? Also if you check the integration page are the devices showing under the second hub when the device is connected to that one?

emresumengen commented 4 years ago

Hello @engrbm87 , No, I don't have force_dhcp or arp_ping enabled on either of the hubs. Configuration is like this: image

Also, some devices are shown under each hub on the integration page. I tried to check for a specific device to see if it's shown under the specific hub, but when I click either of them, the page lists all devices found from Mikrotik integrations, independent of which. So, even if I click hub1 (R1), it shows all devices including that are connected to 2nd hub (AP1).

image

emresumengen commented 4 years ago

One thing to add, though: Some devices (like my phone - mRxs at the bottom) are shown as "Mikrotik, Mikrotik" as the "integration", while others only show "Mikrotik"...

I'm guessing this implies the relevant device is discovered through both hubs? image

Still, this device is shown as Away when my phone roams to AP1.

While connected to R1: image

But, when I move and roam to AP1: image

The device is clearly still connected to the network.

[emre@mrmt-ap1] > /interface wireless registration-table print where mac-address="C0:A6:00:27:E4:37"
 # INTERFACE                                                         RADIO-NAME       MAC-ADDRESS       AP  SIGNAL-STRENGTH TX-RATE UPTIME              
 0 wlan1-5g                                                                           C0:A6:00:27:E4:37 no  -60dBm@6Mbps    866.... 2m12s
engrbm87 commented 4 years ago

Do you have any devices that show Home while connected to AP1? What happens when these connect to R1?

emresumengen commented 4 years ago

No, not really. But it's mainly because I'm tracking only a few devices (mobile phones), and they are exhibiting this problem. I tried now, as an example, to turn off my Wifi, wait for HA to show me AWAY, walk to AP1 range, and reconnect. Even after 10 minutes, HA still showing me AWAY.

I can try to remove the integrations, reboot, add them back and then test with a mobile phone. I'll update as soon as I finish testing, but honestly, I don't think it will work as expected.

emresumengen commented 4 years ago

Hey @engrbm87 ,

I did some testing... First removed both Mikrotik integrations, rebooted, and added through the configuration flow. Did not choose arp_ping or force_dhcp, and left detection_time at default (300?)...

I used a laptop (mac address 30:35:AD:CA:6A:00) for the test. This laptop normally resides in AP1 coverage. So, it was first detected through it's integration. It was showing HOME...

While in AP1 coverage (where it was first detected while installing the integrations):

[emre@mrmt-ap1] > interface wireless registration-table print where mac-address="30:35:AD:CA:6A:00"                 
 # INTERFACE                                                          RADIO-NAME       MAC-ADDRESS       AP  SIGNAL-STRENGTH TX-RATE UPTIME              
 0 ;;; Asemin-MBA
   wlan1-5g                                                                            30:35:AD:CA:6A:00 no  -58dBm@6Mbps    173.... 1h4m11s             
[emre@mrmt-ap1] > 

image image image

Then I moved it into R1 coverage area... At first, it kept showing HOME. Everything was intact, besides the fact that the device had a name now (out of the blue, probably because R1 has DHCP leases and AP1 does not?).

While in R1 coverage (at first): image image image

Then, after a few minutes (without changing anything, laptop still in R1 coverage), it started showing AWAY.

While still in R1 coverage (after some time, like 5-6 minutes): image image

Nothing else changed.

When I took it back to AP1 coverage area, it started showing as HOME again...

It just is not logical, at least to me. Hopefully these tests show where the issue is.

emresumengen commented 4 years ago

By the way, when I move devices between the rooms, I get the below errors from [homeassistant.core]:

2020-03-17 23:42:09 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: device_tracker.mrpro10. Platform mikrotik does not generate unique IDs
2020-03-17 23:59:09 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: device_tracker.30_35_ad_ca_6a_00. Platform mikrotik does not generate unique IDs
2020-03-18 00:26:49 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: device_tracker.50_ec_50_41_e6_69. Platform mikrotik does not generate unique IDs

Within those logs, the entity device_tracker.30_35_ad_ca_6a_00 is the laptop I was moving around, as well as my iPad Pro (device_tracker.mrpro10) and the Xiaomi Hub (device_tracker.50_ec_50_41_e6_69) which sits in the overlapping wireless coverage area (thus, roaming from one to the other time-to-time).

emresumengen commented 4 years ago

Hello @engrbm87 ,

Anything else I can check?

This looks like a problem with the integration. Were you able to look into it (and hopefully identify the culprit)?

Because of this issue, I have no tracking at all, since 106.5... Would really appreciate a workaround or a solution...

engrbm87 commented 4 years ago

@balloob, need your help on this. What is happening is that when the device moves to another hub configured as a different integration, the integration tries to create the entity but it already exists. This stops the integration from updating the entity and the device_tracker becomes away because it is no longer connected to the first hub.

balloob commented 4 years ago

That means that the unique IDs are not unique. The unique IDs of an entity should be based on a unique identifier of the hub + device.

engrbm87 commented 4 years ago

But in our case we don't want to create a new entity. This is the same entity but discovered by a different hub. How can we link the entity (or device) to update via the new hub once it has been discovered by it?

MartinHjelmare commented 4 years ago

Devices are linked via the device registry, by setting the correct device id, eg mac address.

Multiple entities can be linked to the same device, so we probably want one entity per hub, for each device.

engrbm87 commented 4 years ago

Hello @MartinHjelmare , having mulitple device_tracker entities linked to the same device will not solve our problem. The user expects one device_tracker entity to represent the device state (home or away). is there a way to check if an entity already exists and then have it updated through a different integration (for example by subscribing to the other integration topic and update its state).

MartinHjelmare commented 4 years ago

The person integration can have multiple device tracker entities tracking for each person. Is it really a problem to have two or more entities per device?

engrbm87 commented 4 years ago

This would work for tracking persons, but for tracking other types of devices I don't think this would be practical. An idea would be to have a state for the registered device itself based on the states of the linked entities but that would require new code as devices don't have state right now.

engrbm87 commented 4 years ago

Unless there is a way to update an entity from multiple hubs (integrations) I guess our only option is to have multiple entities per device. What do you recommend?

balloob commented 4 years ago

Alternative solution is that you structure the integration differently. Your code should abstract the different hubs and just provide entities with an attribute which hub saw it instead of going through each hub and add entities for it.

engrbm87 commented 4 years ago

Thank you for the idea. If you can help me on this I would appreciate it. Is there any existing integration that uses this structure so that I can follow it. I am not an expert coder but I would like to enhance this integration.

balloob commented 4 years ago

I have no time to help with that.

I can give you a quick pointer. You need to create a class that is queried for available entities. That class will hold all data for all the hubs and exposes them to Home Assistant through the existing code, but as if it is 1 hub.

emresumengen commented 4 years ago

Unless there is a way to update an entity from multiple hubs (integrations) I guess our only option is to have multiple entities per device.

Hello @engrbm87 ,

I personally can say that using person entity as well as the composite custom-component, I can definitely make do with multiple entities per device (one per hub). But, if I can add the entities manually to a hub (like we did with known_devices.yaml file, instead of waiting for the device to be discovered automatically), it would be pretty well.

Just my 2 cents...

stale[bot] commented 4 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.