Tag Archives: HomeKit

Use IKEA TRÅDFRI Driver with HomeKit

You must use IKEA TRÅDFRI Gateway to add your drivers. Philips Hue Bridge can add TRÅDFRI drivers but they won’t appear in your Home app. That means TRÅDFRI drivers with Philips Hue Bridge won’t work with HomeKit. So dig into your pockets to buy a TRÅDFRI Gateway.

After you setting up your TRÅDFRI Gateway with IKEA Home smart app. The app will force you to add a controller (Wireless Dimmer, On-Off Switch/Dimmer, etc.) to control any smart devices. That prevents you from adding any driver directly to the app. You have to add the driver through a controller. So again, dig deeper into your pockets to buy a switch/dimmer. I recommend TRÅDFRI Wireless dimmer. I just bought one as the device adoptor since I won’t use it to control my devices.

You can pair the wireless dimmer with more than one drivers. When you push on/off on the dimmer. All paired drivers will respond. It’s okay if you just use it as the device adoptor like me. But if you want to use it later as a normal dimmer. Just remove it from the app and re-pair it the right driver.

Don’t buy any other IKEA smart devices at the time of writing. Like motion sensors, bulbs, etc. Blinds are okay but reported the motors are louder than other brands. That means most of them suck.

Low Latency HomeKit Camera Support: Homebridge FFmpeg Plugin with Custom Codec Configuration

Stream passthrough method for low latency HomeKit camera support:

  • Device: EZVIZ (萤石) CS-C6CN-3H2CWF (星光夜视版)
  • Low latency (as low as 100ms) from the camera to homebridge-camera-ffmpeg
  • Low CPU load since all streams are passthrough from FFmpeg without re-encoding
  • No audio support due to compatibility issue from the source stream

The configuration should be look like:

"videoConfig": {
    "source": "-rtsp_transport tcp -i rtsp://admin:<device_passcode>@<device_ip>:554/h265/ch1/main/av_stream",
    "maxFPS": 30,
    "audio": false,
    "vcodec": "copy",
}

Here’s the tricky part: the EZVIZ CS-C6CN-3H2CWF will output h265 by default, which is not supported by HAP. And the default bitrate is also too high to handle for iOS devices. So you will need to update some settings for the camera:

  • Download the Chinese version of EZVIZ Studio from the official website (direct link).
  • Install and run
  • Click 本地设备 (Local Devices) on the sidebar
  • Right-click the camera you want to modify, then choose 高级设置 (Advanced Settings)
  • In the popup window, click 图像 (Images) – 视音频 (Audio/Video) on the sidebar, change the following settings:
    • 编码类型 (Encoding Type): STD_H264
    • 码率上限 (Bitrate Limit): 1024 Kbps
    • (Optional) 分辨率 (Resolution): HD720P
  • Click 保存 (Save) to save the settings

Please note this step will slightly reduce the quality of your video stream when you view the stream in EZVIZ official app, but it’s mandatory for the camera to work with HomeKit.

Bonus: audio support without compiling FFmpeg after version 1.0.0:

"videoConfig": {
    "source": "-rtsp_transport tcp -i rtsp://admin:<device_passcode>@<device_ip>:554/h265/ch1/main/av_stream",
    "maxFPS": 30,
    "audio": true
}

This will make FFmpeg re-encode your stream and hurt your CPU. The latency is about 0.6-1 second. I suggest you install Homebridge on a Mac mini for better performance.

Update for homebridge-camera-ffmpeg 3.0.0 and later: It’s finally stable enough to stream passthough with audio support. You can now use the following config:

"videoConfig": {
    "source": "-rtsp_transport tcp -i rtsp://admin:<device_passcode>@<device_ip>:554/h265/ch1/main/av_stream",
    "maxFPS": 30,
    "audio": true,
    "vcodec": "copy",
}