API error: Unable to connect to the Protect controller.
<!-- BUG REPORTS THAT ARE NOT FILLED OUT COMPLETELY WILL BE CLOSED AUTOMATICALLY WITHOUT WARNING AND WILL NOT RECEIVE A RESPONSE. THE FORM IS HERE FOR A REASON. :). -->
<!-- Please ensure you read the documentation before creating a support request, especially the Troubleshooting page. -->
<!-- BUG REPORTS ABOUT BETA VERSIONS OF UNIFI / UBIQUITI FIRMWARE OR EARLY-ACCESS/BETA HARDWARE WILL BE CLOSED WITHOUT A RESPONSE. ALL BETA RELEASES FROM UBIQUITI ARE UNSUPPORTED -->

**Describe The Problem:**
<!-- A clear and concise description of what the issue is. -->
Unifi Protect Plugin  gives error: 

"API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates". 

To correct, I normally deactivate plugin for an hour of more.... Then reactivate.... Will work for a little..... then goes back to same error....

**To Reproduce:**
<!-- Steps to reproduce the behavior. -->

**Logs:**
<!-- In order to be helpful, include the relevant logs from Homebridge, if applicable. -->
[2023-10-04, 9:01:18 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:01:28 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:01:38 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:01:48 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:01:58 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:02:09 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:02:19 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:02:29 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:02:39 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:02:49 a.m.] [UniFi Protect] 192.168.2.1: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[2023-10-04, 9:07:49 a.m.] [UniFi Protect] 192.168.2.1: API error: Resuming connectivity to the UniFi Protect API after pausing for 5 minutes.
[2023-10-04, 9:07:49 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:07:59 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:08:09 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:08:19 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:08:29 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:08:39 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:08:49 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:08:59 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:09:09 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:09:19 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:09:29 a.m.] [UniFi Protect] 192.168.2.1: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[2023-10-04, 9:14:29 a.m.] [UniFi Protect] 192.168.2.1: API error: Resuming connectivity to the UniFi Protect API after pausing for 5 minutes.
[2023-10-04, 9:14:29 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:14:39 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:14:49 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:14:59 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:15:09 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:15:19 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:15:29 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:15:39 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:15:49 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:15:59 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:16:09 a.m.] [UniFi Protect] 192.168.2.1: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[2023-10-04, 9:21:09 a.m.] [UniFi Protect] 192.168.2.1: API error: Resuming connectivity to the UniFi Protect API after pausing for 5 minutes.
[2023-10-04, 9:21:10 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:21:20 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:21:30 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:21:40 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:21:50 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:22:00 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:22:10 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:22:20 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:22:30 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:22:40 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:22:45 a.m.] [InsteonLocal] Polling status for Conference Room...
[2023-10-04, 9:22:45 a.m.] [InsteonLocal] Getting status for Conference Room
[2023-10-04, 9:22:50 a.m.] [UniFi Protect] 192.168.2.1: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[2023-10-04, 9:23:35 a.m.] [InsteonLocal] Polling status for Elana's Office...
[2023-10-04, 9:23:35 a.m.] [InsteonLocal] Getting status for Elana's Office
[2023-10-04, 9:23:37 a.m.] [InsteonLocal] Polling status for Server...
[2023-10-04, 9:23:37 a.m.] [InsteonLocal] Getting status for Server
[2023-10-04, 9:26:05 a.m.] [InsteonLocal] Polling status for Hallway...
[2023-10-04, 9:26:05 a.m.] [InsteonLocal] Getting status for Hallway
[2023-10-04, 9:26:28 a.m.] [InsteonLocal] Polling status for Kitchen...
[2023-10-04, 9:26:28 a.m.] [InsteonLocal] Getting status for Kitchen
[2023-10-04, 9:26:38 a.m.] [InsteonLocal] Error getting power state of Kitchen
[2023-10-04, 9:27:50 a.m.] [UniFi Protect] 192.168.2.1: API error: Resuming connectivity to the UniFi Protect API after pausing for 5 minutes.
[2023-10-04, 9:27:50 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:28:00 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:28:10 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:28:20 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:28:30 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:28:40 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:28:50 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:29:00 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:29:10 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:29:20 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:29:30 a.m.] [UniFi Protect] 192.168.2.1: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[2023-10-04, 9:31:40 a.m.] [homebridge-ring] Office Detected Motion. Loading snapshot before sending event to HomeKit
[2023-10-04, 9:34:30 a.m.] [UniFi Protect] 192.168.2.1: API error: Resuming connectivity to the UniFi Protect API after pausing for 5 minutes.
[2023-10-04, 9:34:30 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:34:40 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:34:50 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:35:01 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:35:11 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:35:21 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:35:31 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:35:41 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:35:51 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:36:01 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:36:11 a.m.] [UniFi Protect] 192.168.2.1: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[2023-10-04, 9:41:11 a.m.] [UniFi Protect] 192.168.2.1: API error: Resuming connectivity to the UniFi Protect API after pausing for 5 minutes.
[2023-10-04, 9:41:11 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:41:21 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:41:31 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:41:41 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:41:51 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:42:01 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[2023-10-04, 9:42:09 a.m.] [HB Supervisor] Stopping services...
[2023-10-04, 9:42:09 a.m.] Got SIGTERM, shutting down Homebridge...
[2023-10-04, 9:42:09 a.m.] Got SIGTERM, shutting down child bridge process...
[2023-10-04, 9:42:09 a.m.] Got SIGTERM, shutting down child bridge process...
[2023-10-04, 9:42:09 a.m.] Got SIGTERM, shutting down child bridge process...
[2023-10-04, 9:42:09 a.m.] Got SIGTERM, shutting down child bridge process...
[2023-10-04, 9:42:10 a.m.] Got SIGTERM, shutting down child bridge process...
[2023-10-04, 9:42:11 a.m.] [UniFi Protect] 192.168.2.1: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates

**Homebridge Configuration:**
```
{
            "controllers": [
                {
                    "address": "192.168.2.1",
                    "password": "XXXXXXXXXXXXX",
                    "username": "XXXXXXXXXXXXX"
                }
            ],
            "name": "UniFi Protect",
            "options": [
                "Disable.Doorbell.Messages.F492BF75BFA1",
                "Disable.Doorbell.Messages.FromDoorbell.F492BF75BFA1",
                "Disable.Log.Doorbell.F492BF75BFA1",
                "Enable.Video.DynamicBitrate.F492BF75BFA1",
                "Disable.Log.Doorbell.AC8BA99F9339",
                "Disable.Log.HKSV.AC8BA99F9339",
                "Disable.Log.Doorbell.74ACB9016206",
                "Disable.Log.HKSV.74ACB9016206",
                "Disable.Log.Doorbell.68D79A8FFEA1",
                "Disable.Log.HKSV.68D79A8FFEA1",
                "Disable.Log.Doorbell.68D79A8FF76B",
                "Disable.Log.HKSV.68D79A8FF76B",
                "Disable.Log.Doorbell.74ACB90BC137",
                "Disable.Log.HKSV.74ACB90BC137",
                "Disable.Log.Doorbell.D021F9923AAF",
                "Disable.Log.HKSV.D021F9923AAF",
                "Disable.Log.Doorbell.74ACB90B94B1",
                "Disable.Log.HKSV.74ACB90B94B1",
                "Disable.Log.HKSV.74ACB901537F",
                "Disable.Log.Doorbell.74ACB901537F",
                "Disable.Log.HKSV.D021F9923495",
                "Disable.Log.Doorbell.D021F9923495",
                "Disable.Log.Doorbell.68D79A8FF645",
                "Disable.Log.HKSV.68D79A8FF645",
                "Disable.Log.Doorbell.D021F9924725",
                "Disable.Log.HKSV.D021F9924725",
                "Disable.Log.HKSV.F492BF75BFA1",
                "Disable.Video.DynamicBitrate.D021F9923AAF",
                "Disable.Video.HKSV.TimeshiftBuffer.D021F9923AAF",
                "Disable.Video.DynamicBitrate.AC8BA99F9339",
                "Disable.Video.DynamicBitrate.74ACB90BC137",
                "Disable.Video.DynamicBitrate.74ACB90B94B1",
                "Disable.Video.DynamicBitrate.74ACB901537F",
                "Disable.Video.DynamicBitrate.D021F9923495",
                "Disable.Video.DynamicBitrate.68D79A8FF645",
                "Disable.Video.DynamicBitrate.D021F9924725",
                "Disable.Video.DynamicBitrate.74ACB9016206",
                "Disable.Video.DynamicBitrate.68D79A8FFEA1",
                "Disable.Video.DynamicBitrate.68D79A8FF76B",
                "Disable.Video.HKSV.TimeshiftBuffer.AC8BA99F9339"
            ],
            "_bridge": {
                "username": "0E:67:71:D2:88:86",
                "port": 52622
            },
            "platform": "UniFi Protect"
        },

```

**Screenshots:**
<!-- If applicable, add screenshots to help explain your problem. -->

**Environment:**

* **Homebridge Version:** <!-- homebridge -V --> 1.6.1
* **Node Version:** <!-- node -v -->18.17.0
* **Homebridge-UniFi-Protect Plugin Version: 6.15.0
* **UniFi Protect Version:** <!-- Read the Protect version line from https://unifi-controller/protect/settings -->2.8.35
* **UniFi Protect Controller Type:** <!-- UCKgen2+, UDMP, UNVR, etc. -->UDM Pro
* **UniFi Protect Controller Firmware Version:** <!-- Read the firmware line from https://unifi-controller/settings/general -->
* **Apple Device and iOS / macOS / iPadOS / tvOS Version:**<!-- Type of Apple device you're using and associated OS version -->
* **Operating System and OS Version:** <!-- Raspbian / Ubuntu / Debian / Windows / macOS / Docker --> Raspbian GNU/Linux Buster (10)

<!-- Click the "Preview" tab before you submit to ensure the formatting is correct. -->
