[PROJECT] Driver for Unifi Network Controllers

So we are partially there... I wonder if this is a case of Ubiquiti changing how some devices may report "not present" on the network. At the times the errors occurred, should both of those MAC addresses be on your network? I now have a device showing similar, but it is only one of the three I check, and it has been offline since December (it is a phone I replaced and forgot to remove). I am retesting with my newer phone...

I did notice something I forgot to do for the Presence child driver... so I will be posting an update in a second, but this would not affect your scenario.

Updated Version(s):

  • UnifiNetworkChild-Presence.groovy = 0.1.10

Change(s):

  • Attributes have been added for UptimeDays, UptimeHours, UptimeMinutes, and UptimeSeconds. These are all number attributes so can be compared to if someone needs to check how long something has been up rather than the string.

c8:84:48 is my iPhone and 18:c7:ff is my wife's iPhone.

There is no correlation between the times of the errors and the device's presence. The errors appear to occur every hour regardless of our device's status.

Both of the device's presence is displaying correctly in the Unifi Network console.

As of last night only my wife's phone is generating errors. I didn't change anything:

Hmm... Still failing every hour at basically the exact same time... This still feels like a conflict occurring in the timings for when it is checking this and the API is tied up with the response from something else. Looking back, did you post a screenshot of the parent device's Scheduled Tasks?

Considering that Presence Checks for 2 devices will happen every minute, it would check for one device, pause for 5 seconds, then check for the next device. That effect can be seen in the log by how your phone (I assume it was that one) happened at 6 seconds.

Thanks for continuing to bear with me...

Does not appear to be a scheduling issue really. You do not have Refresh scheduled and the times are not that close. I COULD see it possibly choking a bit around 10:02 (when the DailyCheck runs because of how much that can return) but you do not have anything that runs every hour...

Very much at a loss here as what might be happening EVERY hour to interfere like this.

I added a new presence device this morning and the errors stopped occurring...

Strange... I do not see any formatting issues with the two you had and if that had been the case it would have been every time.

Can you send me a message or otherwise get the Scheduled Tasks again? When you Save Preferences (including for changing Presence MACs) it resets the schedules... so I am curious what they are now such that they are not causing issues since that still seems like the most likely cause to me.

Historically I got this same error from time to time and I resolved it by going into my UDM device and click save preferences. This recalculates all the scheduled jobs so by you adding a new presence device that is why error went away.

FWIW I haven’t had the error since the latest update where @snell refactored the scheduled job code. I will admit I also simplified my setup too where I disabled the “Show Unifi Devices as Children” preference and don’t have child devices for all of my Unifi devices since I wasn’t really using them for any automations. Maybe this also helped solve the issue since there are less devices to update with all the polling.

I will continue to monitor and report back if I do experience the error again.

Thanks. Let me know if it starts happening again. The Login is only ~5 seconds before it so maybe I need to add some time there. Also, not sure if everyone needs it updating Presence EVERY minute... maybe I should make that configurable in the future. Things for me to think on.

@ritchierich:
Good to hear it is gone. Disabling the child devices should not have impacted it as all the data is received anyways (it just affects how that data is represented). Thanks though!

For both of you, please let me know if it starts happening again and if anything changed...

1 Like

And the errors are back...after I added our son's Apple Watch MAC addr.

Please try doing the "Save Preferences" again at some point to change the times and we will see if it gets rid of them. Again, odd that it MOSTLY only corresponds to one of the MAC addresses but DID have two errors with a different one early on.

@snell for a few days I was getting hourly read time out messages. Clicking save preferences solved it but wanted you to be aware

Thanks for letting me know... once an hour, just like the Presence Check fails... What a pain and that is with Login checks. But no other errors so your tokens and such must still be good even with those...

correct no other errors. Strange it randomly starts and only happens at a certain minute of the hour every hour.

Appears to eliminate the errors in Logs:

Well... that has worked before when this happens. I still have no idea what is really causing the conflicts. But usually the Save Preferences works because it resets when the checks occur to a different time (at least a new time based on when the Save is performed).

Do you have any ideas on debug statements that might help pinpoint the issue? Happy to modify my driver when this happens again to log additional details to help you. Let me know.