Blue Iris with motion events
**Manufacturer/Model:**
Blue Iris

The Blue Iris (BI) server collects all of the camera streams, does motion detection and a lot of great stuff, even supports MQTT, but doesn't connect into HomeKit. This configuration allows you to pull BI camera streams into homebridge-camera-ffmpeg, and take advantage of the built-in MQTT alerts for motion sensing. This can be useful for providing a subset of cameras for easy use by anyone with access to the connected HomeKit home, without having to add more users to BI or deal with the BI client app.

**Homebridge Config:**

```json
{
    "platform": "Camera-ffmpeg",
    "name": "Camera FFmpeg",
    "mqtt": "127.0.0.1",
    "cameras": [
        {
            "name": "Camera 1",
            "manufacturer": "August",
            "model": "Doorbell Cam Pro",
            "videoConfig": {
                "source": "-rtsp_transport tcp -re -i rtsp://192.168.1.23:5000/Doorbell01",
                "stillImageSource": "-i http://192.168.1.23:5000/image/Doorbell01?q=75",
                "maxWidth": 480,
                "maxHeight": 640,
                "audio": true,
                "debug": false,
                "vcodec": "libx264"
            },
            "mqtt": {
                "motionTopic": "BlueIris/MotionAlarm/Doorbell01/",
                "motionMessage": "ON",
                "motionResetMessage": "OFF",
                "motionResetTopic": "BlueIris/MotionAlarm/Doorbell01/"
            },
            "serialNumber": "12345678",
            "firmwareRevision": "BR-549",
            "motion": true
        }
    ]
}
```

**Additional Information:**

In this example, 192.168.1.23 is the BI server IP, and 192.168.3.19 is the homebridge server IP.

This example is pulling the BI stream of an August Doorbell Cam Pro that is identified in BI as "Doorbell01" (the short name that appears in the header of the camera's video window). Adjust maxWidth/maxHeight etc. for your specific camera, based on its BI config. Use "vcodec": "copy" if possible, since it is less resource-intensive, but I had to use libx264 to make it work. There's probably a way to fix that in the BI config, but I haven't found that setting yet.

This requires an MQTT broker & client, for example:

```# sudo apt-get install mosquitto mosquitto-clients```

Edit /etc/mosquitto/mosquitto.conf and set "allow_anonymous true" unless you want to force authentication, in which case you’ll have to dig up that configuration magic yourself. Add your MQTT config per [instructions](https://sunoo.github.io/homebridge-camera-ffmpeg/automation/mqtt.html).

If audio is not enabled on the camera in Blue Iris, be sure to set "audio": false in the homebridge-camera-ffmpeg config, or the stream will always fail to load.

**Blue Iris configuration:**

In _Blue Iris Settings --> Web server --> Advanced:_
1. Add the IP address of your homebridge server with a leading carat "^" to avoid having to add username:password in every URL in the plugin json. Note that this requires a user account named "admin" but it does not require admin privileges (see the Blue Iris documentation).
2. Uncheck "Use secure session keys and login page" to allow embedded usernames/passwords.

<img width="685" alt="WebserverAdvanced" src="https://user-images.githubusercontent.com/10470394/194379195-b0a478c6-cf53-4468-b9ad-3ed802fde28b.png">

In _Blue Iris Settings --> Digital IO and IoT --> MQTT,_ enter the homebridge MQTT server config details, and be sure "Enabled" is checked. Use the "Test" button to verify that it's working.

<img width="610" alt="MQTTconfig" src="https://user-images.githubusercontent.com/10470394/194382280-db56f5bd-e85c-45f1-8647-a613cc830bad.png">

In the Blue Iris settings for the specific camera, go to the _Alerts_ tab.
1. Click the "On alert" button and add an "MQTT topic" action.
2. Set the "MQTT topic" to match the path in the "motionTopic" in the plugin json.
3. Set the "Post/payload" to match the "motionMessage" in the plugin json.
4. Click OK.
5. Click the "On reset" button and repeat the procedure, making the "Post/payload" value match the "motionResetMessage" in the plugin json.

<img width="962" alt="Actionset" src="https://user-images.githubusercontent.com/10470394/194382129-6cbd090b-af08-483b-b72c-b7f84ff2fa58.png">


