AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
5.07k stars 406 forks source link

HASS HomeKit to Apple HomeKit Bridge #79

Closed 5eeT0uc4 closed 1 year ago

5eeT0uc4 commented 2 years ago

Hi to all.

Please provide experience of Aqara G3 HomeKit camera connected to the HASS. I need to see this camera in Apple HomeKit on iOS devices and take control over the HASS.

My steps:

  1. Connect G3 to the HASS HomeKit - OK
  2. Add HomeKit Accessory integration of the camera in HASS - OK
  3. Pair iOS device with HASS HomeKitCamera - OK
  4. Camera shows with still images but doesn't stream - FAIL

What is the best practice to integrate the HomeKit devices thru the HASS in "transparent mode" for the cameras.

Best regards

AlexxIT commented 2 years ago

Unfortunately, Hass does not support streaming from HomeKit cameras. I plan to add streaming to HomeKit in the future, but it may take time.

You can try to find someone who can build app from this article: https://pvieito.com/2019/12/extract-homekit-pairing-keys

So everyone can extract pairing keys from Apple Home and use their cameras with all ecosystems simultaneously.

5eeT0uc4 commented 2 years ago

Hello Alex

Thank you I'll try to understand what and how it works)) Right now I don't understand how to start.

How long do you think it will take you to implement this functionality?

I have a big project now, where about 20 Aqara G3/G2H cameras will be installed.

If possible, I want to suggest that you implement the functionality of mirroring cameras in HomeKit for a fee. Would you be interested in implementing this as soon as possible and if so, how much could it cost?))

My client also has a large number of Xiaomi cameras installed at other sites and it is impossible to transfer them to Hass for further use in HomeKit / RTSP. Have you had any experience or information on how to bypass the Xiaomi cloud and add cameras to Hass.

Thanks again for the reply.

Have a nice day.

5eeT0uc4 commented 2 years ago

Hello

Please help me with exposing Aqara G3 to the HomeKit. I'm tried lot of combinations of RTSP streams but no way

What is my decision. Before I'm added integration of the Generic Camera in HASS and added the RTSP stream from go2rt web UI. Then I'm tried to add the stream in HomeKit:

- name: Living Camera 1
  port: 21078
  mode: accessory
  filter:
    include_entities:
      - camera.living_rtsp
  entity_config:
    camera.living_rtsp:
      stream_source: ffmpeg:rtsp://192.168.29.254:8554/aqara_g3_living?video=0&audio=1&resolution=640x480&framerate=5#video=h264#audio=pcma
      linked_motion_sensor: binary_sensor.living_camera_hub_g3_51fc_motion_sensor

AND

- name: Living Camera 2
  port: 21079
  mode: accessory
  filter:
    include_entities:
      - camera.living_rtsp
  entity_config:
    camera.living_rtsp:
      stream_source: rtsp://192.168.29.254:8554/aqara_g3_living
      linked_motion_sensor: binary_sensor.living_camera_hub_g3_51fc_motion_sensor

But no way only still image from the camera.

I see the RTSP streams with VLC

AlexxIT commented 2 years ago

Where you get all this params ?video=0&audio=1&resolution=640x480&framerate=5#video=h264#audio=pcma? They all wrong. This params only for ffmpeg:device source.

For getting RTSP from go2rtc you need to use this https://github.com/AlexxIT/go2rtc#module-rtsp

Try to view RTSP in VLC or ffplay. Check if it works fine.

5eeT0uc4 commented 2 years ago

Thank you for the ffmpeg explanation. Yes I;m tried lot of different ways but simple way doesn't work.

My steps:

  1. Connect the Aqara G3 to the HA with HomeKit Integration. Now five cams are connected.
  2. Add my cams to the go2rtc.json
    {"streams":{
    "aqara_g3_pool": "hass:Pool-Camera-Hub-G3-2FAB",
    "aqara_g3_office_sofa": "hass:Office-Sofa-Camera-Hub-G3-2CC9",
    "aqara_g3_office_table": "hass:Office-Table-Camera-Hub-G3-3B2B",
    "aqara_g3_kitchen": "hass:Kitchen-Camera-Hub-G3-2EE3",
    "aqara_g3_living": "hass:Living-Camera-Hub-G3-51FC"
    }}
  3. I see all streams in the WebUI and can check. WeRTC working fine into the browser and RTSP can viewing with VLC no problem
  4. Then I'm added cams with RTSP into HomeKit Integration. I see only prebuffered image and when I want to see live stream I saw the loading wheel. VLC see the stream and I can watch the cam.
    # aqara_g3_office_table
    - name: Office Table Camera
    port: 21075
    mode: accessory
    filter:
    include_entities:
      - camera.office_table_camera_hub_g3_3b2b
    entity_config:
    camera.office_table_camera_hub_g3_3b2b:
      stream_source: rtsp://192.168.29.254:8554/aqara_g3_office_table
      linked_motion_sensor: binary_sensor.office_table_camera_hub_g3_3b2b_motion_sensor
AlexxIT commented 2 years ago

I don't know how well the RTSP to HomeKit integration works inside Hass.

It is better for you to find someone to compile this app: https://pvieito.com/2019/12/extract-homekit-pairing-keys

Maybe you can find author and he will send binary to you.

With this app you can add cameras direct to Apple Home and get HomeKit keys for go2rtc.

I'm also very interesting with this way, but don't have time.

AlexxIT commented 1 year ago

Supported https://github.com/AlexxIT/go2rtc/releases/tag/v1.7.0