- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Sticky This Topic
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 09:16 AM
You installed Homebridge AND a plugin. Sounds like you installed the unifi-video plugin. I believe you're using Protect? That plugin is not for you.
I use homebridge-camera-ffmpeg-omx plugin. I'm having some problems livestreaming with the homebridge-camera-ffmpeg plugin.
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 11:24 AM
@BrianErdelyi - I installed the plug-in that you mentioned but still getting these error.
I'm not sure if I have the config.json correctly. I added the camera rtsp url under source. Any idea?
root@homebridge:~# homebridge /usr/lib/node_modules/homebridge/lib/server.js:219 var username = config.bridge.username; ^ TypeError: Cannot read property 'username' of undefined at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:219:32) at new Server (/usr/lib/node_modules/homebridge/lib/server.js:56:38) at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:30:16) at Object.<anonymous> (/usr/lib/node_modules/homebridge/bin/homebridge:17:22) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Function.Module.runMain (module.js:694:10)
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 12:17 PM
Anyone running Homebridge in a RPi connected to Protect can share their config.json file? I'm trying to have mine setup but I'm having hard time.
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 01:10 PM
Here’s my config:
{
"bridge":{
"name":"Homebridge",
"username":"11:22:33:44:55:66",
"port":51826,
"pin":"123-45-678"
},
"platforms":[
{
"platform":"Camera-ffmpeg-omx",
"cameras":[
{
"name":"UniFi G3 Flex",
"videoConfig":{
"source":"-rtsp_transport http -re -i rtsp://192.168.2.26:7447/pqSBSzLFBznJlUHn",
"vcodec":"h264_omx",
"audio": true,
"maxStreams":2,
"maxWidth":640,
"maxHeight":480,
"maxFPS":15,
"debug": true
}
}
]
}
]
}
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 01:12 PM
I think this is my problem. I have missing these values. From where I get them? BTW: Thanks in advance for the help / share.
{
"bridge":{
"name":"Homebridge",
"username":"11:22:33:44:55:66",
"port":51826,
"pin":"123-45-678"
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 01:15 PM
Also notice I’m using the homebridge-camera-ffmpeg-omx plugin.
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 01:24 PM
Those values are configurable. You can set them to whatever you want.
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 01:27 PM
Here’s is how I setup my RPi using Raspbian Stretch Lite.
Update package database
sudo apt-get update
Upgrade installed packages
sudo apt-get -y upgrade
Install Node.js repository
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
Install Node.js
sudo apt-get install -y nodejs
Install avahi
sudo apt-get install -y libavahi-compat-libdnssd-dev
Install ffmpeg
sudo apt-get install -y ffmpeg
Install homebridge
sudo npm install -g --unsafe-perm homebridge
Install Homebridge camera plugin
sudo npm install -g homebridge-camera-ffmpeg
Configure Homebridge
Homebridge (need to launch and close Homebridge once before editing config file)
sudo nano /home/pi/.homebridge/config.json
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 01:52 PM
@BrianErdelyi - You config.json example works for me. I'm up and running. Few questions; On the main screen of the Home App the App seems to update the image every 12 or so seconds, is this configurable? When I select the camera it keeps Loading and then I get "No response". Is your setup working fine? You can see the live stream?
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 02:08 PM
First, what device are you using to view the camera? I use my iPhone.
it is normal that the thumbnail refreshes ever 10s. When you open the camera it will take about 10s then you’ll see “live”.
Same config but if I use the homebridge-camera-ffmpeg plugin I get an error when I try live streaming.
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 02:14 PM
@BrianErdelyi wrote:First, what device are you using to view the camera? I use my iPhone.
it is normal that the thumbnail refreshes ever 10s. When you open the camera it will take about 10s then you’ll see “live”.
Same config but if I use the homebridge-camera-ffmpeg plugin I get an error when I try live streaming.
I'm using an iPhone X.
The thumbnail refresh every 10s without ploblems. But when I open the camera I get this error;
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 03:00 PM

Alternatively, try using the non On my way! Plugin and see what the output says.
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 03:29 PM
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 03:50 PM
@BrianErdelyi wrote:
@fpbCan you remove the line where audio is set to true?
Just tried but the live video doesnt work.
I also tried with homebridge-camera-ffmpeg-omx and homebridge-camera-ffmpeg with the same result. The snapshots works ok.
With the homebridge-camera-ffmpeg plugin on the debug results I see these errors;
Codec AVOption profile () specified for output file #1 (srtp://192.168.1.233:60250?rtcpport=60250&localrtcpport=60250&pkt_size=1316) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. [swscaler @ 0x19b4070] deprecated pixel format used, make sure you did set range correctly Output #0, rtp, to 'srtp://192.168.1.233:65339?rtcpport=65339&localrtcpport=65339&pkt_size=1316': Metadata: title : 802AA84ED26C_0 encoder : Lavf57.56.101 Stream #0:0: Audio: pcm_mulaw, 11025 Hz, mono, s16, 88 kb/s Metadata: encoder : Lavc57.64.101 pcm_mulaw [mpeg4 @ 0x19ae800] Either both buffer size and max rate or neither must be specified Stream mapping: Stream #0:0 -> #0:0 (aac (native) -> pcm_mulaw (native)) Stream #0:1 -> #1:0 (h264 (native) -> mpeg4 (native)) Error while opening encoder for output stream #1:0 - maybe incorrect parameters such as bit_rate, rate, width or height
but I'm playing with the settings without luck yet.
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 03:57 PM
I had a bit of a breakthrough with the non-omx plugin. It appears that Protect may have two separate streams. I’ll try and swap the commands.
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 04:00 PM
I did a clean install again and used your steps. with the only difference that later I noticed that the instructions points to the non omx plugin and then I unistalled the non-omx and installed the omx.
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 04:18 PM
@BrianErdelyi wrote:
I can only get video with the omx plugin. I’d still like to know how you installed ffmpeg since this is the reason for most issues.
I had a bit of a breakthrough with the non-omx plugin. It appears that Protect may have two separate streams. I’ll try and swap the commands.
The plug-in web point to another source to download the ffmpeg, but I can't access it. Did you used that one originally?
homebridge-camera-ffmpeg-omx
ffmpeg plugin for Homebridge. Optimized for Rapsberry Pi via GPU encoding.
Installation
Install ffmpeg on your Raspberry Pi.
a. Download this package: sudo wget goo.gl/gMGA81 -O ffmpeg.deb
b. Install this package: sudo dpkg -i ffmpeg.deb
c. Ensure that the user you are running homebridge as has access to /dev/vchiq. ie sudo usermod -aG video login where login is the user you are running homebridge as.
Install this plugin using: npm install -g homebridge-camera-ffmpeg-omx
Edit config.json and add the camera.
Run Homebridge
Add extra camera accessories in Home app. The setup code is the same as homebridge.
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-23-2018 08:49 PM
I don’t like the omx docs. I follow all steps for the non omx plugin. It works fine.
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-24-2018 05:47 AM
@jclarkenz - out of curiosity what plugin are you using for the Protect / homebridge integration? The question is because I tried two different plugins and I can't get live video on the Home App.
Re: Native Apple HomeKit integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
11-24-2018 05:49 AM
FYI, I have finally resolved a problem with the homebridge-camera-ffmpeg plugin and Protect.
Protect seems to include the audio in the first stream and video in the second stream. I had to modify the homebridge-camera-ffmpeg plugin to have it expect video in the second stream. I have also disabled audio in my homebridge configuration. My next testing will be to see if it works with audio enabled.
See the following thread for details. https://github.com/KhaosT/homebridge-camera-ffmpeg/issues/222#issuecomment-441333661
My UniFi equipment: Cloud Key, Cloud Key 2+, Gateway (USG), PoE Switch (US-8-150W), Access Point (UAP-AC-Pro), UniFi G3 Flex
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Sticky This Topic
- Bookmark
- Subscribe
- Printer Friendly Page