question

samsamsamsamsam avatar image
samsamsamsamsam asked

Homebridge or similar solutions on Cerbo GX for Apple Homekit PoE Camera Solution

Hello

I like to install, Homebridge or similar solutions on Cerbo GX, for a Apple Homekit PoE Camera Solution.


Is that possible?

With my own Raspberry Pi on which Homebridge is installed, this should not be a problem.

But I would like to run Homebridge directly on the Cerbo GX to save power and money.

The PeE cameras should only be available in Apple Homekit to store the entire stream in the iCloud for 10 days free of charge.

The motion detection etc. is done by the Reolink camera software on the camera itself, well enough with the Reolink app.

So the demand on the computing power of the Cerbo GX should not be very high.

I currently have the normal Venus firmware installed and only three devices connected.

Thank you

Samuel

cerbo gxVenus OSNode-RED
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
samsamsamsamsam avatar image
samsamsamsamsam answered ·
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

samsamsamsamsam avatar image
samsamsamsamsam answered ·

(Reolink or other) RTSP livestream cameras, integrate into Apple Homekit, via Victron Venus OS (Cerbo GX or others).


Feasible, even for non-programmers, with a little patience and willingness to learn.


Here are the steps I have taken:


1.

If you want to use older Apple devices, take note of this.

https://discussions.apple.com/thread/254934792?sortBy=best

For example, I use an Apple iPad Air 2 from 2014 as an Apple Home Hub.


2.

You may also need to reset your Apple Home.

Use this one.

http://appldnld.apple.com/iOSProfiles/HomeKitReset.mobileconfig


3.

Test RTSP Livestream and set RTSP Camera IP to Static.

There is a high-resolution and low-resolution stream.

https://support.reolink.com/hc/en-us/articles/900000630706-Introduction-to-RTSP/


4.

Install Victron Venus OS Large firmware on Cerbo GX.

And activate Node Red on Venus OS.

https://www.victronenergy.com/live/venus-os:large


5.

Log in to Node Red with the user name admin and the password for the Victron Remote console.

https://community.victronenergy.com/questions/175440/login-username-and-password-for-first-use-of-node.html


7.

Install and test the node-red-contrib-homekit-bridged v1.6.1.

https://youtu.be/QTK2wM7vCRI?si=NeaiaGohUyiLxVfP


8.

Set up root access on Venus OS.

The default root password is ZZZ.

And free up hard disk space using the script:

/opt/victronenergy/swupdate-scripts/resize2fs.sh

https://www.victronenergy.com/live/ccgx:root_access#partitions_read-only_rootfs_and_available_disk_space%E2%80%8B%E2%80%8B%E2%80%8B


9.

Download and install FFmpeg Static Builds, for ARMHF, directly on Venus OS.

https://www.johnvansickle.com/ffmpeg/faq/


10.

Set up the Apple HomeKit Node Service in Node Red.

Depending on the camera.

https://nrchkb.github.io/wiki/service/camera-control/#-reolink

11.

Deactivate root user access to Venus OS again.


A live stream should now be available in the Apple Home.


If there are problems, it sometimes helps to restart the Venus OS completely by cutting the power supply.

And switching the Apple Home app and the Apple Home Hub on and off.


Otherwise, a re-installation of the Node Red installation can also help, with

rm -rf /data/home/nodered/ && svc -t /service/node-red-venus/

https://community.victronenergy.com/questions/156632/node-red-repairre-install.html

And or

rm -rf /data/home/root/.node-red && rm -rf /data/conf/signalk

https://github.com/victronenergy/venus/issues/809


Use the “top” command in the terminal to check whether there is enough memory and processor power available.


ATTENTION:

The ffmpeg installation and root access will be lost after a firmware update. This must therefore be reinstalled after a firmware update.


Saving the livestream in iCloud and motion detection do not yet work for me.

This could be because the Apple iPad Air 2 is too old.

Or, I still need to install other services, such as


CameraRecordingManagement

Apple HomeKit status

CameraRecordingManagement

CameraRTPStreamManagement


I have not found any information on this.

If anyone knows more, please reply.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

samsamsamsamsam avatar image
samsamsamsamsam answered ·

Second way to use almost any PoE camera in Apple Home, with Homebridge and CameraUI.


Since I have not been able to save recordings to the Apple iCloud with the Node Red plugin and get motion messages.

I have now chosen this way.


However, it could be that it was my mistake, as I did not define a motion sensor, because only recordings in which movements are detected are saved in iCloud.


I would recommend the previous method with the Node Red plugin because it is more stable.

However, I have decided to use this method for now.


The motion messages of this method are also worse than those of the camera's own software.

No idea what you can do about it.


Incidentally, Apple Home only saves 7-second clips of movement, which is impractical for backups.

In addition, you can only access the recordings on iOS devices.

So I decided to also use the camera's own motion detection and save the recordings to an FTP server using the camera's own software.

And then to save the recordings from the FTP server to my iCloud using Multcloud

https://www.multcloud.com


I would say that Apple Home with surveillance cameras makes little sense, it's too immature.

The only advantage is that you can watch the live stream and recordings on the Apple Watch.

However, CameraUI offers many functions that might be helpful.


Here are the steps I took:


1.

If you want to use older Apple devices, take note of this.

https://discussions.apple.com/thread/254934792?sortBy=best

For example, I use an Apple iPad Air 2 from 2014, as an Apple Home Hub.


2.

You may also need to reset your Apple Home.

Use this one.

http://appldnld.apple.com/iOSProfiles/HomeKitReset.mobileconfig


3.

Test RTSP Livestream and set RTSP Camera IP to Static.

There is usually a high-resolution and low-resolution stream.

https://support.reolink.com/hc/en-us/articles/900000630706-Introduction-to-RTSP/


4.

Install Victron Venus OS Large firmware on Cerbo GX.

https://www.victronenergy.com/live/venus-os:large


5.

Set up root access on Venus OS.

The default, root, password is ZZZ.

Assign a root password

SSH to LAN, switch on


6.

Log in to Venus OS via a terminal

ssh root@192.168.XXX.XXX


7.

And free up hard disk space using the script:

/opt/victronenergy/swupdate-scripts/resize2fs.sh

https://www.victronenergy.com/live/ccgx:root_access#partitions_read-only_rootfs_and_available_disk_space%E2%80%8B%E2%80%8B%E2%80%8B


8.

Download and install FFmpeg Static Builds, for ARMHF, directly on Venus OS.

mkdir /data/download

cd /data/download

wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-armhf-static.tar.xz

wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-armhf-static.tar.xz.md5

md5sum -c ffmpeg-git-armhf-static.tar.xz.md5

tar xvf ffmpeg-git-armhf-static.tar.xz

https://www.johnvansickle.com/ffmpeg/faq/

https://johnvansickle.com/ffmpeg/


9.

Copy ffmpeg to /usr/bin

cp /data/download/ffmpeg-git-20240524-armhf-static/ffmpeg /usr/bin


10.

Install Homebridge on Venus OS

npm install -g --unsafe-perm homebridge

https://github.com/homebridge/homebridge-config-ui-x/wiki/Manual-Configuration


11.

Install camerUI for Homebridge

npm install -g homebridge-camera-ui@latest


12.

Start Homebridge

homebridge -I


13.

Close Homebridge again.


14.

Create config.json for Homebridge, with nano, in the folder

/home/root/.homebridge


Check the config.json

https://jsonlint.com


I have used this config.json.

Replace PASSWORD with your camera password


{

"bridge": {

"name": "Homebridge 5125",

"username": "0E:91:0A:8F:51:25",

"port": 51077,

"pin": "111-11-111",

"advertiser": "bonjour-hap"

},

"accessories": [],

"platforms": [

{

"name": "CameraUI",

"port": 8081,

"logLevel": "debug",

"mqtt": {

"active": false,

"tls": false,

"port": 1883

},

"http": {

"active": false,

"port": 7272,

"localhttp": false

},

"smtp": {

"active": false,

"port": 2727,

"space_replace": "+"

},

"ftp": {

"active": false,

"useFile": false,

"port": 5050

},

"ssl": {

"active": false

},

"cameras": [

{

"name": "Reolink",

"motion": true,

"unbridge": true,

"hsv": true,

"prebuffering": true,

"prebufferLength": 4,

"hksvConfig": {

"source": "-i rtsp://admin:PASSWORD@192.168.1.101//h264Preview_01_main",

"maxWidth": 1920,

"maxHeight": 1080,

"maxFPS": 25,

"maxBitrate": 3000

},

"videoConfig": {

"source": "-i rtsp://admin:PASSWORD@192.168.1.101//h264Preview_01_main",

"subSource": "-i rtsp://admin:PASSWORD@192.168.1.102//h264Preview_01_sub",

"stillImageSource": "-i http://192.168.1.101:80/cgi-bin/api.cgi?cmd=Snap&channel=0&user=admin&password=PASSWORD“,

"readRate": true,

"rtspTransport": "tcp",

"maxStreams": 2,

"maxWidth": 0,

"maxHeight": 0,

"maxFPS": 0,

"vcodec": "copy",

"acodec": "libfdk_aac",

"encoderOptions": "-tune zerolatency",

"mapvideo": "0:0",

"mapaudio": "0:1",

"audio": false,

"debug": true

},

"videoanalysis": {

"active": true

},

"motionTimeout": 15,

"smtp": {

"email": "Reolink"

},

"mqtt": {}

}

],

"platform": "CameraUI",

"atHomeSwitch": false,

"options": {

"videoProcessor": "/usr/bin/ffmpeg"

}

}

]

}


15.

Open CameraUI in the browser

http://192.168.1.100:8081


16.

Set cameras in Apple Home

https://support.apple.com/de-de/guide/iphone/iph7bc5df9d9/ios


The settings for other cameras can be found here

https://sunoo.github.io/homebridge-camera-ffmpeg/configs/


If this does not help:

Install homebridge-config-ui-x on a more powerful operating system.

And then copy the config.json to the /home/root/.homebridge directory on the Venus OS and customize it.

https://github.com/homebridge/homebridge-config-ui-x


If something goes completely wrong

Reinstall Venus OS completely

ATTENTION the link is only for Cerbo GX

https://www.victronenergy.com/media/pg/Cerbo_GX/de/reset-to-factory-defaults-and-venus-os-reinstall.html

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.