Add-on: Scrypted (Homekit Secure Video)

UPDATE MAY 2023: I’ve been working with the Scrypted developer and they’ve implemented my project as the official Scrypted HA addon!

As a result I will not be maintaining this addon any further and you will need to add the Scrypted repository for the new one - see here for more details: Installation: Home Assistant OS · koush/scrypted Wiki · GitHub

I recommend following the instructions in my documentation on backup and restore in order to move your data over to the new addon.

Many thanks for all your support of this project, I am delighted with the outcome :blush:


A quick advert for an add-on I made which allows you to install Scrypted on your Home Assistant instance.

For those unaware, Scrypted is a new home automation platform built on node.js whose best feature is super fast, low-latency exposure of cameras to Homekit and adds features like Homekit Secure Video, and in some cases 2-way audio, to exposed cameras.

I’ve been using this on Home Assistant OS running on a Pi 4 and performance has been fantastic, I have 3 cameras on Homekit through this method. On home network, latency is usually <1s, even with 2K streams!

  • New for 2023 - Ingress support (at last!)

Add the following repository to install:

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

For more information on Scrypted, go to https://www.scrypted.app.

26 Likes

Hey thanks for sharing, do you have an example configuration for your mentioned use case? I got a bit overwhelmed with this scrypted thing there🙈

It’s really straightforward. You just install the HomeKit plugin then any other plug-in that you want to be exposed to HomeKit. It creates a bridge in your home app, just like HASS does with the HomeKit integration.

It works well and the creator is constantly updating/improving.

My use case for it is to expose my rtsp cameras and let’s me use them with HomeKit Secure Video.

One thing to add though, HomeKit Secure Video only supports 1080p. So if your camera is higher resolution, it would just reduce it.

1 Like

@ajoyce Very cool add-on, thanks to you for your awesome work! It did crash my HA which runs on a pi4 twice during setup of individual cameras, I think the CPU/memory load was just too high. Now that it has been set up it seems to be running smoothly.

@Flipso installation is pretty straight forward. Check out this youtube video for help configuring your cameras

1 Like

Thank you so much for your work! I’ll test de addon. I wait for the ingress integration :smiley:

Hope it works ok! Ingress may take me a while as it will require completely recompiling the image…

Thank so much, If I add my camera to scrypted . ( amcrest) will I be able to access the stream in home assistant ( and/or the amcrest app) and HomeKit at the same time? Or will it just be in HomeKit ? Thanks

Currently there are no direct links between the add-on and Home Assistant, it’s just a way to get the two different softwares running on the same server. Scrypted will let you see your Amcrest camera in Homekit, but you can still add the ONVIF/FFmpeg stream manually in Home Assistant to be able to see it there too. You’ll still be able to access the camera in the app regardless of what you do with Scrypted or HA.

2 Likes

Is there a preferred way of updating the add-on while still retaining plugins and settings?

In the past, I’ve been able to do it by using the save plugins script within Scrypted, but ever since v0.0.177, Scrypted updates to a new installation and I have no way of restoring my plugins.

Thanks in advance!

Follow the instructions here:

Do I still have to manually import the config backup, or has this been automated somehow in the new versions.

v0.0.177 To v0.1.4

Hey just wanted to share a success story for future reference: 5 cameras RLC-410-5MP all working perfectly. Only problem is you’re stuck with the substream for HKSV but I haven’t figured out transcoding yet. When you set things up the onvif url is just you camera url WITHOUT the http:// or the /onvif/device_server parts and make sure to put in the http override port 8000 (or whatever you have it set to on the camera). If it works you should see the streams show up to choose. Select the homekit plugin, and set it to accessory mode. RESET the pairing then reload the homekit plugin. Afterwards come back to the camera and you should see a qr code to add the camera. This is way faster than the built in integration for homeassistant. Hopefully they figure out transcoding and HKSV for the homeassistant integration but I might honestly just get cameras that directly support HKSV

Edit to make more clear:
Install the Scrypted Addon
Use something other than Safari to login to avoid login loop
Install plugins: homekit, onvif, rebroadcast
Go to the onvif plugin and add camera
set username, password, and onvif url (onvif url is just the url, no http:// or /onvif/device_service), make sure to click the arrow or it won’t save
set HTTP port override to whatever port you have onvif on, for my camera it is 8000
check that the streams are correct
check homekit plugin
for homekit pairing check standalone accessory mode, then type reset and hit enter
go to the homekit plugin and reload it
go back to the camera homekit pairing section for the pairing qr code

Edit2: Fine tuning: if it lags while opening:
In scrypted for each camera you’ll see the stream tabs, click then and see what resolution and bitrate scrypted is getting. You want those 2 to be as close to 1920x1080 and 2048 as you can. In the reolink camera settings adjust the bitrate to 2048 and play with the resolution and frame rate until the compression puts out the right bitrate. Mine works fine at 10fps and max resolution for all except a camera that overlooks some flowers which apparently takes more compression so I had to lower the resolution

2 Likes

Should only have to manually import as per instructions posted above the one time, due to relocating config files to conform with HA standards. After this you shouldn’t have any issues.

I can’t get it work…

For what it’s worth, I have two HA instances running at different locations and different installations.

The first one is HA supervised, and I tried everything, but no matter what, I couldn’t get it to restore my settings.

On my second installation, I’m running HassOS, and I was able to update, modify the backup and restore successfully on the first try.

Might be helpful to note that I didn’t have to extract anything from the backup. I just opened it in 7zip and added the Scrypted data folders into the tar file within the backup.

I installed the Docker version of Scrypted on my NAS, pulls in my Unifi cameras and Ring Cam flawlessly. The feed into HomeKit is substantially faster and enables all of the benefits of HSV on your phone. If you use the Home app in iOS to control your HA instance like myself, I highly recommend!

https://www.scrypted.app

2 Likes

Scrypted would crash and take down homeassistant with it for me, whether using a single ONVIF or RTSP camera on a raspi3b. I had to jump through some hoops to get homebridge installed but it works fine so far with camera ui.

Pi 3B won’t be powerful enough. 4 is fine but only for a few cameras. Any more than that and I’d recommend more powerful hardware

The camera has a processor, ram etc just like a computer. If it has on board motion detection it means it’s constantly analyzing each frame for detection, if you have person detection turned on at the camera level that’s another thing for it to analyze, also complexity matters. Lots of moving shadows or a busy street is a lot more taxing on resources.

Now we are adding constant streaming of the feed to your HA … and at the same time to Scrypted etc … what I am saying is the more stuff you turn on the quicker you can max out your camera and it will start glitching.

For me lowering the resolution, fps and bandwidth helped me a lot in reducing the glitchiness. If you have Scrypted doing motion processing then you can turn those off on your camera level to reduce resource usage. You also didn’t say what camera you have