Switching Aqara G4 to Home Assistant Like a Pro

getting it into home assistant for the g4 is really easy with access to apple device, first add the doorbell into homekit, then open up home assistant down, remove device from homekit on apple device, then it should pop up in auto discovery.

(you should have a notification down the bottom of the menu of home assistant showing discovered a homekit device).

this is how devices should look when discovered.

1 Like

Hey thanks SO much for this. I’ve gone as far as moving it over to the HomeKit integration in HA and the bell already exists, I’ll work on scripting notifications etc later. Indeed the video is a bit random so I’ll do the go2rtc option … probably tomorrow as I have a few other things to do.

Really appreciate this and I hope this post helps other people in the future.

I know how adding a device in HA works but this option does not allow me to keep it in HomeKit with HKSV and HA at the same time.

I think explaining and about taking a device from homekit ha back to homekit real is a long topic very long.

ill try it quickly, remove from real homekit follow instructions above to get it into go2rtc

but for pass through back to homekit via homekit bridge in home assistant you need to do this in go2rtc so add to go2rtc as above then click on links once its in. as you need to add rtsp feed to code bellow in config.yaml

one quick way to test if your system is upto it is to add

homekit:
  - name: Front Door Doorbell
    mode: accessory
    port: 21062
    filter:
      include_entities:
        - camera.doorbell entity from home assistant
    entity_config:
      camera.doorbell entity from home assistant:
        name: Doorbell
        stream_source: -rtsp_transport tcp -re -i (rtsp link from go2rtc under links)
        video_codec: copy
        audio_codec: libopus
        support_audio: True
        linked_doorbell_sensor: (doorbell press from home assistant)
        linked_motion_sensor:  (doorbell motion sensor)

once you have added to home assistant add the advance camera card to get better use and streaming quality of the camera, there are many options for which stream from go2rtc to use :slight_smile:

ok I’m on the way but not there yet. Installed go2rtc, found the add-on, went to the config, listed the devices to add and got

]

so I tried this config

but after save and restart hitting the stream button I get this.

switching to the camera name

looks like I have issues with both the URL and ‘aqara_g3’

ok so the ‘aqara_g3’ in the URL should be ‘doorbell’ I think to match the stream entry name. That gets further however now I’m failing on both methods (name and url) unable to get an rtsp stream. This is the failure using the ‘homekit’ URL

and this with ‘hass’

I’ve poked around the other links but they all end up with an unable to open rtsp stream issue. Is there some piece of config I need to add to tell go2rtc that my stream is not rtsp?

also where do I get the client_id or client_private from (which I assume I stuff into the URL)

ok the magic appears to be getting the ‘hass’ line right, what I needed was
- "hass:Doorbell Repeater-5146"

It seems that just a bare ‘hass:’ was being interpreted as a map (and yes I’m pretty sure I didn’t have a space)

1 Like

if you are still finding the stream laggy in home assistant one work around is to take the go2rtc frigate link (from under links from the camera in go2rtc) and add that under generic camera.

Strange but it works for those with stuttering image.