External integration - Unify network

Well… I felt like I had wings and decided to try something: developing an external integration!

It works on my end, I admit we’re in full vibe-coding mode, with Gemini 3.6 Flash (I don’t have a Claude subscription yet).

I admit I don’t know if best practices were followed, if I didn’t make any big mistakes, I had to do a lot of back-and-forth, with commits and tags all over the place, we’re already at version 1.4.7 in one day ^^

Here’s the image: Package gladys-integration-unifi · GitHub

Don’t hesitate to tell me if I’m on the wrong track, if there are any red flags, etc… :slight_smile:

Excellent!! Next step: Subscribe to Claude Code :joy:

Actually, I was just thinking about that, but too many AI subscriptions at the moment!!

After that, you can just do a month at 20€ to develop as much stuff as possible and then you cut it off

Oh, but I know myself, I’m going to find this awesome, endless possibilities, and I’m never going to cancel my subscription :joy:

Otherwise, there’s OpenCode Go at $5

But still, Claude is $20 and it’s the reference

Thanks for the link! I’ll check it out

Ooooh!! So cool :heart_eyes:

I’ll try it right away @guim31

It’s intense :sweat_smile:

Oh, it connects!!

Oh, it doesn’t work!! But no worries, it’s normal!! Well, at least it should be normal for the moment :sweat_smile: :face_with_peeking_eye:
Hey @pierre-gilles!! I think we’re waiting for the next version ^^

[2026-08-01T17:23:36.769Z] [INFO] onConfigUpdated -> new configuration received
[2026-08-01T17:23:36.955Z] [INFO] Successfully logged in to UniFi OS via /api/auth/login
[2026-08-01T17:23:36.955Z] [INFO] Connecting to UniFi WebSocket events at wss://1xx.xxx.xxx.xxx:443/proxy/network/wss/s/default/events...
[2026-08-01T17:23:36.960Z] [INFO] UniFi integration connected and active.
[2026-08-01T17:23:36.960Z] [INFO] Starting internal UniFi polling timer (every 30 seconds)...
[2026-08-01T17:23:36.971Z] [INFO] UniFi WebSocket connected successfully.
[2026-08-01T17:23:37.546Z] [INFO] UniFi getDevices returned 23 infrastructure device(s).
[2026-08-01T17:23:37.689Z] [INFO] UniFi getClients returned 123 active client(s), getKnownClients returned 462 known client(s).
[2026-08-01T17:23:37.709Z] [INFO] UniFi getWlans returned 6 wlan(s).
[2026-08-01T17:23:37.709Z] [INFO] UniFi Discovery scan completed successfully: 984 device(s) found.
[2026-08-01T17:23:40.212Z] [INFO] Successfully logged in to UniFi OS via /api/auth/login
[2026-08-01T17:23:59.618Z] [INFO] onScanRequest -> publishing UniFi discovered devices
[2026-08-01T17:23:59.711Z] [INFO] UniFi getDevices returned 23 infrastructure device(s).
[2026-08-01T17:24:00.212Z] [INFO] UniFi getClients returned 123 active client(s), getKnownClients returned 462 known client(s).
[2026-08-01T17:24:00.225Z] [INFO] UniFi getWlans returned 6 wlan(s).
[2026-08-01T17:24:00.225Z] [INFO] UniFi Discovery scan completed successfully: 984 device(s) found.

But the good thing is that it finds everything!!^^ I’m just too excessive :joy:

I’ll check that a bit later tonight :+1: we’ll get there!

But wait for the next update, there’s a chance it’s just due to an implementation that Pierre-Gilles is merging into master today. The workaround is to display fewer devices, because for now the core only allows a limited number of elements to be received.

But it’s code for not much at the moment since it will be resolved. I had the same issue with Shelly, and it was resolved by sending fewer devices and then, once added, not displaying those already added ^^

Let’s try again on Gladys v4.85 :sweat_smile:

Nice one, thanks for the advice! :+1:

It’s already live!

Everything is going too fast :scream:

Genius, thanks for the module! I’m still on vacation away from home, but I’ll test it when I get back :grinning_face_with_smiling_eyes:

Oh my, I can’t wait to try this out on Monday too, now that I’m out of the house :sweat_smile:

Oops!! SDK Problem:

[2026-08-01T19:56:58.973Z] [INFO] UniFi integration connected and active.
[2026-08-01T19:56:58.974Z] [INFO] Starting internal UniFi polling timer (every 30 seconds)...
[2026-08-01T19:56:58.982Z] [INFO] UniFi WebSocket connected successfully.
[2026-08-01T19:56:59.071Z] [INFO] UniFi getDevices returned 23 infrastructure device(s).
[2026-08-01T19:56:59.173Z] [INFO] UniFi getClients returned 127 active client(s), getKnownClients returned 462 known client(s).
[2026-08-01T19:56:59.187Z] [INFO] UniFi getWlans returned 6 wlan(s).
[2026-08-01T19:56:59.188Z] [INFO] UniFi Discovery scan completed successfully: 984 device(s) found.
[2026-08-01T19:56:59.198Z] [ERROR] Post-connection initialization failed: GladysApiError: devices: max 200 devices
    at HttpClient.request (/app/node_modules/@gladysassistant/integration-sdk/lib/http-client.js:49:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async GladysIntegration.<anonymous> (file:///app/index.js:387:5) {
  status: 400,
  code: 'BAD_REQUEST'
}
[2026-08-01T19:57:04.761Z] [INFO] onScanRequest -> publishing UniFi discovered devices
[2026-08-01T19:57:04.843Z] [INFO] UniFi getDevices returned 23 infrastructure device(s).
[2026-08-01T19:57:04.938Z] [INFO] UniFi getClients returned 127 active client(s), getKnownClients returned 462 known client(s).
[2026-08-01T19:57:04.954Z] [INFO] UniFi getWlans returned 6 wlan(s).
[2026-08-01T19:57:04.955Z] [INFO] UniFi Discovery scan completed successfully: 984 device(s) found.

Do you think I should take action to split the devices into groups of 150, for example, or should this quota of 200 devices max be increased on Gladys’ side?

Even if you split it up, it wouldn’t solve the real issue, everything else would remain invisible as long as the others aren’t integrated :sweat_smile:

I can’t see myself adding 1000 network devices to Gladys :joy:

I wonder if the solution wouldn’t be to limit to UniFi equipment + something else (in the settings maybe) allowing you to choose a device by its IP (or name) to make them appear in the discovery page!!

Reflection, reflection, but it shouldn’t impact a « normal » installation.

It could also be that, but only if the number of devices is greater than 50 for example?