API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
### Homebridge UniFi Protect Version

7.0.0

### Homebridge Platform and OS

MacOS Sonoma

### Homebridge Version

1.8.2

### Node Version

20.12.2

### UniFi OS Version

3.2.12

### UniFi Protect Controller Version

4.0.21

### Describe the problem

I'm seeing API errors once/second. I was seeing a lot of errors before, but after updating to 7.0 it's worse. 1 error per second:

`API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.`

Also getting the livestream connection errors frequently:

`The livestream API connection was unexpectedly closed by the Protect controller: this is typically due to device restarts or issues with Protect controller firmware versions, and can be safely ignored. Will retry again shortly.`



### Homebridge HBUP JSON configuration

```json
{
    "controllers": [
        {
            "address": "192.168.2.115",
            "password": "********",
            "username": "Homebridge"
        }
    ],
    "name": "UniFi Protect",
    "_bridge": {
        "username": "0E:72:73:B6:14:AD",
        "port": 32833
    },
    "options": [
        "Enable.Video.Transcode.Hardware.60223295E385",
        "Enable.Motion.SmartDetect.60223295E385"
    ],
    "platform": "UniFi Protect"
}
```


### Relevant log output

```shell
[6/4/2024, 12:47:36 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:36 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:38 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:38 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:38 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:39 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:39 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:39 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:40 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:40 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:40 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:41 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:41 PM] [UniFi Protect] 192.168.2.115: API error: Unable to connect to the Protect controller. This is usually temporary and will occur during Protect controller reboots and firmware updates.
[6/4/2024, 12:47:41 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:42 PM] [UniFi Protect] 192.168.2.115: API error: Throttling API calls due to errors with the 10 previous attempts. Pausing communication with the Protect controller for 5 minutes.
[6/4/2024, 12:47:42 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:43 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:44 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:45 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:46 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:47 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:48 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:49 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:50 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:51 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:52 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:53 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:54 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:55 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:56 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:57 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:58 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:47:59 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:00 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:01 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:02 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:03 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:04 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:05 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:06 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:07 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:08 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:09 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:10 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:11 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:12 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
[6/4/2024, 12:48:13 PM] [UniFi Protect] 192.168.2.115: API error: Unable to retrieve the livestream websocket API endpoint from the UniFi Protect controller.
```


### Acknowledgment that you are only running UniFi OS and UniFi Protect releases from the Ubiquiti Official release channel

- [X] I acknowledge that I am not running any early access / beta firmwares or operating systems from either Ubiquiti or Apple.