Online channel not working after upgrading UniFi Controller to 5.12.35

Hi,

Saturday evening I upgraded UniFi Controller from 5.10.24 to 5.12.35. Since then my two items linked to the Online channel of two different UniFi Wireless Client things haven’t been updated - they have been ON ever since.

Problem is related to the upgrade, but I don’t know if:

  • Ubiquiti introduced a bug in this new version.
  • Something went wrong when upgrading the Docker container with the Controller.
  • Something being corrupted in my openHAB installation because of the upgrade.
  • Or if there could be a bug in the UniFi binding.

I’m running openHAB 2.5.1 and UniFi Controller 5.12.35. I tried to enable debug logging with “openhab> log:set TRACE org.openhab.binding.unifi” in karaf console, and saw this:

(filtered two only the two devices in question and masked MAC addresses)
2020-01-14 20:56:34.109 [DEBUG] [i.internal.api.model.UniFiController] - Found 18 UniFi Insights(s):

  • UniFiClient{mac: ‘xx:xx:xx:xx:xx:xx’, ip: ‘null’, hostname: ‘oneplus5’, alias: ‘null’, wired: false, blocked: false, device: null}
  • UniFiClient{mac: ‘xx:xx:xx:xx:xx:xx’, ip: ‘null’, hostname: ‘anness-iphone’, alias: ‘null’, wired: false, blocked: false, device: null}
    […]

I don’t know if I’m looking at the right thing, but one thing sticking out is the lack of IP address in this list? Of course, hostname could be used, either configured for the things, or resolved and matched with configured IP address. But I assume binding will expect IP address to be there?

Also found this, which seems perhaps more relevant:

2020-01-14 21:31:18.679 [TRACE] [nal.api.model.UniFiControllerRequest] - >> GET https://diskstation.local:8443/api/s/oc9023uo/stat/alluser?within=168
2020-01-14 21:31:18.694 [TRACE] [nal.api.model.UniFiControllerRequest] - << 200 OK
{
“meta”: {
“rc”: “ok”
},
“data”: [
{
“_id”: “5cc8962d46e0fb0016dc485d”,
“mac”: “xx:xx:xx:xx:xx:xx”,
“oui”: “OneplusT”,
“is_guest”: false,
“first_seen”: 1555875741,
“last_seen”: 1579033469,
“is_wired”: false,
“hostname”: “oneplus5”,
“site_id”: “5cc8962c46e0fb0016dc4732”,
“duration”: 14753388,
“tx_bytes”: 67502167826,
“tx_packets”: 68857214,
“rx_bytes”: 56669118157,
“rx_packets”: 67773833,
“wifi_tx_attempts”: 63570429,
“tx_retries”: 0
},
[…]

I don’t know if this would be the response where IP address is supposed to be? I can also add that I tried adding an item for “Last Seen”, and it worked correctly. I also tried creating things and items from scratch, and it didn’t solve the problem.

Should I dig up more information - and has anyone else experienced this kind of problem with version 5.12.35 of the controller?

One more thing: I tried to manually update my item to OFF. After that, the binding was able to change it back to ON when I reconnected my phone. So maybe problem is related to some client data missing in responses when client is not connected?

Thanks in advance for any help sorting this problem out.

Best regards,
Jacob Laursen

As work-around I created a rule using LastSeen to mimic the needed logic. LastSeen is updated frequently:

var Timer timerUniFiJacob = null

rule "UniFi work-around Jacob"
when
    Item UniFi_OnePlus5_LastSeen changed
then
    if (Jacob_Home.state == OFF)
    {
        Jacob_Home.sendCommand(ON)
    }

    if (timerUniFiJacob === null)
    {
        timerUniFiJacob = createTimer(now.plusSeconds(180), [ |
            Jacob_Home.sendCommand(OFF)
        ])
    }
    else
    {
        timerUniFiJacob.reschedule(now.plusSeconds(180))
    }
end

Best regards,
Jacob Laursen

Hi Jesper,

Had the same issues but got it resolved by clearing the cache.

  • openhab-cli stop
  • openhab-cli clean-cache
  • openhab-cli start

Thanks for your hint with the trace log. In mine I found some missing cache hits and that put me onto clearing the caches.
Currently running latests editions of both OH2 and Unifi Controller.

Kind regards
Claus

Hi Claus,

Thanks for the tip. I tried cleaning the cache, got into a mess, then also did this:

  • openhab-cli reset-ownership

Unfortunately without any effect, Online channel still not working. :slightly_frowning_face:

/Jacob

Hello,

I’m facing the same issue, did you get it solved or not yet? I’m in the same version of you!

Hey, having the same problem here. OpenHAB 2.5.2 and UniFi Controller 5.12.35 for Windows.

I’ve also the same problem. Using OH 2.5.1 with Unifi 5.12.35. I’ve cleared the cache and restarted OH.

What can be the problem?

Not sure the problem I would love to figure it out. I noticed the issue pop up for me in the last few weeks also. I don’t rely on my Unifi presence right now I was just starting to test it.

I’ve reported it as a bug on github.

2 Likes

Thanks!!!

I was having this problem today after upgrading to 5.12.35. But, oddly, it was happening for one device, but not for another. On the “Insights” view on the controller, I “Forgot” the device that was having the problem. After that, the online channel started working again.

1 Like

one Question: Do you have set an alias before for the device? because i am facing the same issue. Phone with Alias saved and than i forget it in insight and it came back with original Name and after that the offline state works again.

Yes, I use aliases for all my devices in the Controller, so I’m certain this device had an alias.

maybe that is the issue?

installed new Version yesterday 5.12.72
Update works again

Updated to 6.0.28 a few days ago, not my presence detection doesn’t work anymore. IP address and MAC address is being reported empty by the binding. Anyone else having this issue?

image

I have similar problems after updating to 6.0.28. The presence detection toggles in a few seconds interval. Alexa which is announcing somebody coming home is talking all the time. I disabled it therefore. I don´t know if the binding could fix this or if this is a bug in the controller (which I assume).

Same with UniFi controller 6.0.38; opened an issue on Github:


Please feel free to add additional information to the issue.

FWIW i am having the same issue as most people here. My devices are constantly showing ‘ON’ and not changing. My devices are reporting the correct MAC and IP to the binding though. I am using controller version 6.0.28.

EDIT: In my case, clearing the Cache seemed to fix the issue.

Edit to my previous post: Clearing the Cache temporarily solved the issue but then it went back to being broken. The devices aren’t updating