Adding SimCam to HomeKit

Recently, SimCam.ai sent me one of their AI Security Cameras to test and review. Overall it works fairly well, but like all my smart home endeavors I like being able to see things from one place—the Apple Home app. SimCam doesn’t work natively with HomeKit, but when I discovered it puts out an RTSP stream the Homebridge cogs started turning in my brain.

Before getting started I recommend setting a static IP for your SimCam device. You can do this on almost all routers, but the steps will be different. Just search the name of your router + ‘DHCP assignment’ and follow the instructions presented!

After setting a static IP you’ll want to jump onto your Raspberry Pi running Homebridge. If you haven’t already got a Homebridge setup, check out my previous post.

Installing h264 and FFmpeg

Before installing the Homebridge plugin you’ll need to first install FFmpeg itself. Installing FFmpeg requires several commands, but the steps for this are detailed below! Firstly you’ll want to install several build tools, simply run the below command in terminal:

sudo apt-get install git pkg-config autoconf automake libtool libx264-dev

After this has installed you’ll need to download the h264 library. To do this run the following commands:

cd ~
git clone --depth 1 http://git.videolan.org/git/x264
cd x264

Once this has downloaded and you’ve navigated to the subfolder, you’ll need to configure the installation. To do this run the following command:

./configure --host=arm-unknown-linux-gnueabi --enable-static --disable-opencl

The next command you enter will depend on what Rasberry Pi you have.

If you have a model older than the 3B+ instead of make -j4 run the command make -j (the difference in command is due to the number of cores available in older Pis)

This process took around 3-4 minutes for me, so set it running and go make a cup of tea 🙂

make -j4
sudo make install.

After the above has finished, you now have all the prerequisites and can start to install FFmpeg itself. To do this first run the following commands:

cd ~
git clone git://source.ffmpeg.org/ffmpeg --depth=1
cd ffmpeg

Like before, you’ll need to configure the installation. To do this run the following command:

./configure --arch=armel --target-os=linux --enable-gpl --enable-libx264 --enable-nonfree

After this you will again want to run the make -j4 (or make -j) command. This process took around 30 minutes on my Raspberry Pi 3b+ and will take considerably longer when ran with make -j.

After this has completed the final step will be to run the command:

sudo make install

Homebridge Setup

Now that FFmpeg is installed we can start setting up and configuring the homebridge-camera-ffmpeg plugin. The first step to this will be to install the plugin itself. To do this run the following command:

sudo npm install -g homebridge-camera-ffmpeg

Before adding the plugin to Homebridge you’ll want to find out the RTSP stream URL for your SimCam. To find this:

  • Open the SimCam app and press the Settings cog on the camera you want to add.
  • From this list, select ‘Camera Information’.
  • Press the ‘Obtain’ button on the option ‘RTSP streaming address’
  • Write down this URL, as you will need to include it in your config.json.

Now you have the RTSP URL, open your config.json and add the following code underneath the platforms header. Substituting SIMCAM RTSP URL for the RTSP URL you just copied.

{
    "platform": "Camera-ffmpeg",
    "cameras" [{
        "name": "Camera Name",
        "manufacturer": "SimCam.ai",
        "model": "SimCam",
        "videoConfig": {
            "source": "-re -i SIMCAM RTSP URL",
            "videoFilter": "none",
            "vcodec": "copy",
            "maxBitrate": 200,
            "packetSize": 188
            }
        }
    ]
}

The above config is what I’ve found works best for the SimCam and gives me a low latency feed both at home and away. You may want to change the Camera Name as this is what will appear in HomeKit.

After saving your config.json restart Homebridge. After restarting, the camera won’t immediately appear in HomeKit, this is because it needs to be added directly.

If you’re running Homebridge as a systemctl and can’t see this log, the setup code is the same as your main Homebridge pin.

To add the camera to your HomeKit system:

  • Open the HomeKit app and press the + button.
  • Select the option ‘I Don’t Have a Code or Cannot Scan’.
  • Your SimCam camera will be listed at the top under ‘Nearby Devices’ click on the camera’s icon.
  • Enter your Homebridge Code.

After adding the camera it will appear at the bottom of your favorites page, and when full-screening the camera it loads quickly! You can also see what output quality and settings Homebridge is sending in the Homebridge Log.

Overall I’m extremely happy with the end results of this little project! It has definitely improved the usefulness of the SimCam cameras for me, and my grand quest to have any and all smart products I buy appear in the Apple HomeKit app. If you have any questions about this setup please drop me a comment below and I’d be more than happy to answer them!


I don’t run ads on my site, nor do I do this for profit, but if you found this post helpful and want to support me why not buy me a coffee!

Leave a Reply

Your email address will not be published. Required fields are marked *