The Ultimate Home Server - Component: Home Security

TODO

3 Likes

I’ve been playing with Home Assistant now for a few years and have used that as the “glue” that coordinates various pieces in my own personal setup combining lights, cameras, motion detection, etc… Couple thoughts:

IP Cameras:
These are readily available and are often setup with a main stream running at high resolutions such as 4K as well as a sub-stream running a much lower resolution. Software like Frigate is great for easily connecting to RTSP streams and recording video. Using hardware based decoding of h264 or h265 streams via your CPU or GPU can massively speed things up.

Motion/Object Detection:
Performing person or object detection in live video can be computationally taxing. You can do it with a CPU but your performance is going to be poor. Projects like Watsor can help by using pre-trained models (which you can swap out) and GPU hardware acceleration to perform object detection. For example, to identify people when they come into view. It sometimes can be a little hit-or-miss so you may want to fallback on something simpler like motion detection. I ended up coding my own option using the OpenCV library. When you’re running object detection or motion detection, make sure to run on the sub-stream. The higher resolution of the main stream probably won’t make much of a difference and it will tax your computer.

MQTT:
MQTT is a very popular messaging framework for IoT devices. This has been an excellent way to extend into Home Assistant without having to wrote code specifically for Home Assistant. I can write programs or utilities on my own, write to the MQTT stream and easily pick those up in Home Assistant to display images, messages, status, etc.

Alerting:
When something “happens” and comes through Home Assistant, you can use this to alert you. Home security 24/7 monitoring systems that cost $30 or more dollars per month can be circumvented if you have a “tinker-er” mindset. I use Discord integrations via Home Assistant to alert me if the cameras identify people at my door when I’m away. There are likely many other options.

Conclusion:
If you enjoy self-hosting, homelabs, etc. I think all of this is right up your alley and putting together a security system for your home is a really fun project to tackle.

4 Likes

Has anyone tried Konnected?
It’s an ESP module with relays on a PCB.
Promo material suggest you can either interface with a existing control board or replace the board with the conversion kit.

The Pro board can be setup with PoE.

On IP cameras, NVR software and motion detection.

The IP cameras themselves don’t matter that much to me, biggest problem I’ve found is those that use an old ActiveX software element for control. I consider h264/h265 streaming to be a minimum.

The software I have used for many years now is Shinobi. It works extremely well for native h265 recording and restreaming with very little CPU impact. I’m talking 3% CPU per stream (on an older Xeon e3). Key here is that the software is built around the idea that you don’t need to re-encoding if you’re already getting h264 in.

Final part, motion detection. I’ve set up Shinobi with motion detection and it keeps those events in system. But, it also has a reasonably well built plugin/api system which you can use to interact with MQTT and then by extention Home-Assistant. I’ve got it setup so that on my Home Assistant Dashboard there is an image of the latest motion event detected by Shinobi. It sends the motion event and image over MQTT to Home-Assistant. Not the most elegant and I don’t have notifications (yet) but it is a start.

3 Likes

@Sidiox Do you still use Shinobi?

I don’t know how I didn’t find these Ultimate Home Server threads sooner, they’re right up my alley.

I’ve reworked my entire system over the past year to use Home Assistant as the backend like @firefly2442 above. Nearly everything goes through that, even though Home Assistant isn’t the interface I generally use day-to-day. I’m an avid Apple user (I know…), so on the daily, HomeKit is what I interact with.

Surveillance:
Frigate - NVR
Scrypted - Camera → HomeKit Secure Video Gateway

Frigate handles all the local recording for my cameras, but I also use Scrypted to proxy all camera feeds to HomeKit. This can be done with Home Assistant, which is what I’ve done in the past, but Scrypted allows the cameras to be recognized as HomeKit Secure Video cameras. I have an AppleOne subscription, so Apple records 10 days worth of footage from all cameras, along with object and facial recognition. This allows my family to access the footage much more easily than going through Frigate or Home Assistant and works very well, although the facial recognition leaves something to be desired. It does however, use the names that are tagged in a users iCloud photo library to recognize the faces which greatly speeds up the training time.

Facial Recognition:
Frigate - Object Recognition
Double-Take - Facial Recognition Proxy
CompreFace - Facial Recognition Provider
Deepstack - Alternative Facial/Object Recognition Provider

Frigate is GREAT as a simple NVR/Object Recognition platform that ties in with Home Assistant. What I haven’t seen posted is Double-Take or CompreFace. Double-Take grabs “Person” events and performs facial recognition on the snapshot that’s pulled via Frigate’s API. It then sends those requests to CompreFace, Deepstack or another service I can’t recall, and publishes the results to MQTT. So far, I’ve trained quite a few family member’s faces, and its pretty reliable. Since it uses MQTT, its very straightforward to automate notifications, automations, or other cool stuff with Node-Red. I run all this locally, so it’s much faster than commercial cloud offerings like HomeKit Secure Video’s facial recognition.

Logo Detection:
I have an automation setup in Node-Red to send “Vehicle” and “Person” snapshots to Deepstack, where I have a Logo detection pre-trained model running. This works surprisingly well and I’ve been able to setup notifications that trigger when my driveway or eave cameras see UPS and FedEx trucks. I have yet to trigger on a person’s uniform logo, but I’m still trying to work out all the bugs!

Notifications:
I use Node-Red to format Home Assistant notifications which include snapshots from the facial recognition and logo recognition events and send those to my cell. Everything is snappy and works great, as long as there aren’t more than a few transcoding jobs running on my server at the same time. I also have some sensors in home assistant that display each camera and the logo or face that was seen last. It’s still a work in progress, but it’s been helpful.

I know this was long winded, but hopefully this is useful.
@wendell - I’d love to see you test facial/object recognition on your high powered machines to see how well that works!

Check out coral ai modules for frigate. Low power and better object detection than with GPU IMHO

Unfortunately, they are still impossible to find at non-scalper prices, but buying one has definitely been a goal! It appears that Frigate 0.12.0 Beta 8 includes support for CUDA/Tensor, so I may be able to put my lowly p400 to work. Based on documentation, inference times with nvidia can get close to or even surpass the coral chips.

1 Like

where do you find them tho thats the isssue with those

Worse price gouging then pi’s

I haven’t been able to find anything recently. The best deal I’ve seen is a package deal with an Odyssey Blue mini PC at SeedStudio for $328, but a while ago, I went to buy one and they were out of stock completely. All the major suppliers have 6-12mo lead times.

Yep, its probably just going to get worse, with current geopolitical situation

I ordered 2 dual modules from digikey in early 2022. they came in recently.

1 Like

https://www.mouser.com/ProductDetail/212-G650-04527-01

A/E key in stock for cheap, swap out your boards wifi and get some coral action

1 Like

Ive got to know whenever you get around to the TODO. I know the tick set stuff back. Hope you are feeling better

1 Like

Still in daily use here. 5 years total.

1 Like

Just ordered one.

Setting up cameras at the new place and am going to try and do the frigate+Coral setup

2 Likes

That’s my use case as well

1 Like

Probably going to go Amcrest on a isolated VLAN.

1 Like

I have an idea for this, but its probably over complicated and stupid to begin with but I may still explore it.

1.) Wifi is scary for a camera.
-wired fixes the problem…

BUT if wifi is still desired what to do?
Heres the idea…
I want to create a Solar camera that safe to use outdoors wirelessly

The idea would be two fold really
1.) Create a camera with a solar battery source that can run 24/7…this will be difficult (for me) to create the volatage regulation, charging and energy storage (li po, or Li may be viable rechargeable source, ill have to do the math on draw of power or using a step up or down to store at a higher rate etc etc etc) required for this type of operation…

2.) I want to try a Pi Zero W2 as a way to broadcast the video signal over wifi.

3.) I want to run Wireguard on its own subnet for all the video data ports to secure the video signal. (Tinkering with wire gurad is what got me into this whole idea).

This allows us to have a secure wifi camera! Cake and eat it too!

4.) The video would then be on its own wireguard network which I would also run on a VM in the main home server for recordings and such hopefully using Frigate which a number of people have mentioned.

Well I hope. Thats the idea anyway.

The hope is having a fully functioning lightweight linux distro will allow the pi zero to collect decent video, and transmit it via Wireguard.

This may be a dumb idea or a great one im not sure.

Im still in my research phase not development. Im working my way through all the pinouts and useages pi “can” do and its programing which is all new to me.

Im sure just running some PoE cameras over a Lan is easier and maybe cheaper, but Im hoping to explore this option.

Im still parsing through all the L1 videos that @wendell and Ryan have done and followup posts to get an idea of whats been explored or attempted so far, so sorry if this is redendant.

2 Likes