Homekit native cameras in HA

i own a few homekit enabled d-link omna cameras. these work great with homekit but i want to migrate away from apple’s half-stable home automation system. I have tried to add the camera in HA with only half success - i get to see the motion sensor in HA but not the camera/video stream itself as the homekit controller does not support cameras.
any idea is there is work being done on adding camera support for the homekit controller or if there is any other plugin around which would solve this issue?

thanks!

Can you raise an issue on GitHub for this. You are right that they just aren’t supported right now - it would be good to have a holding ticket for it though.

I’m the only dev actively working on homekit_controller. This is on my radar, though quite far down my list right now.

I do have some homekit cameras but my requirement is that everyone in my house can access them via the Home app. homekit is unmaintained right now and can’t re-export cameras to iPhones, so moving my cameras to Home Assistant would be counter productive.

2 Likes

fair enough. i just wanted to ditch homekit and am stuck with it due to the camera :slight_smile:
i do hope this will get implemented at some point in time.
anyways thanks for the great work so far!

Hi @Jc2k - This is kind of an unrelated topic, but since you said you’re working on homekit_controller I thought I might ask you. I have some HomeKit devices that I would like to export to HA. For example, Koogeek and iDevices switches. But I don’t want to export all of my HomeKit devices. Is it possible to use homekit_controller to specify only the devices I want to pull in to HA while ignoring all others? Thanks in advance for your help!

Yes. It doesn’t involve your iOS devices or accounts or icloud or anything. You unpair any given accessory from your iOS and re-pair it with HA and they are completely disconnected and unaware of each other. It’s like you have 2 completely unrelated phones with 2 distinct houses.

The exception is bridges. As the pairing is with the bridge, all the accessories on that bridge can only be used by a single controller at once.

1 Like

Thanks @Jc2k ! I got it set up, and see my device (Koogeek power strip)

image

But when I try to pair it, I get this error. Any ideas?

image

Already replied to this here, but for any one else - if homekit_controller is spitting out an error like this please raise a ticket on GitHub so I can help you and track where things are at. I use GitHub all the time, and the forums rarely. So you’ll get much more help on GitHub. Cheers.

Are there any news to get the Omna 180 HD (nativ HomeKit Camera) in homeassistant?

I would also like to see this functionality in the HomeKit Controller component. I have my Nest Cams integrated into HomeBridge (with live stream) and I would love to be able to get the streams in HA. The current Nest Camera integration is a 10 second snapshot and not live video.

Is there already github issue for camera support with homekit controller? I could not find one here : https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+homekit_controller
I can create one for eufy cam and help testing it as well.

Thanks @Jc2k for homekit controller integration. I was not even know this possible with home assistant until last week. I now have my switches and thermostat controlled locally without cloud service.

Hi @sacdroid - creating a GH issue not needed for this, cameras are on my radar. When I posted originally I wasn’t aware of HA’s policy of not having feature requests in GH.

homekit is no longer unmaintained. And it gained support for exporting camera to iOS devices. This removes one of the barrier to me moving my cameras to Home Assistant.

I also have EuFy cameras myself.

What’s more of an issue is my time. I’m really struggling to find time for “big” pieces of work on homekit_controller at the moment. I’m about half way though adding support for remote controls like this one, and stalled. And i’d want to finish off that work before picking up something new.

sounds good @j2ck. I am able to use camera with hass’s native camera rtsp stream for now.

Hi @Jc2k has there been any further progress on this? What support would you need to proceed?

If you have a way to make time in a day that would be great! I just don’t have time like i used to at the moment. For small self contained pieces i can spend an hour here or there and fix something but the streaming part of cameras is quite different to every other HomeKit entity we support. It means starting from scratch compared to other entities - for those i am able to really leverage a couple years of investment in test tooling and utilities and helpers we’ve built up.

Months ago I added some of the TLV parsing to aiohomekit so we could enumerate the various streaming endpoints on the devices. This is now in the aiohomekit used by HA. (I’ve since forgotten how it works but thats a seperate problem).

A week or so back i merged this: https://github.com/home-assistant/core/pull/43100. It doesn’t support the full quality stream of camera, it just implements the JPG interface. I believe that will be in HA 0.119.

Hi, @Jc2k !

This is exactly the functionality I have been hoping to find - after struggling a few years (!) trying to achieve a local stream for my Netatmo cameras, without any luck.

More detailed - my Netatmo (Presence) cameras have an API for a video stream which forces the users to have them connected to the internet. Once the internet connection goes down, you are unable to reach the cameras even though you have the local stream. Which is bad for privacy reasons, I don’t want my cameras to access the internet. HOWEVER, the homekit stream from these cameras still function with the abscence of an internet connection, in addition to being live (whereas the API stream is 5 seconds delayed).

Have you had any more progress on this? Can I support in any testing if that helps you moving on? Thanks for your great contributions!

I’ve made progress in so much as I’m able to dev against my eufy cams without it making it a pita to actually use my eufy cams. The JPG part also got more reliable. And there are tests in aiohomekit for parsing the control structures needed to set up a stream. But having time to do the rest eludes me as ever, unfortunately.

Thank you so much for your swift answer and update.

This would be a killer feature for cloud-disconnecting a bunch of security cameras for the sake of security in the future!

I will not force you into any new endeavours, however hoping to hear back from you if your time and efforts are aligned sometime :slight_smile:

I had a quick look after my last reply to refresh my memory. I stopped because I think it’s going to require someone who is an expert in the HA camera entity. Wiring up the HomeKit side shouldn’t be too hard. I can probably get to the point of being able to generate the ffmpeg parameters required, but there are extra steps with homekit rtsp. We need to open up a port on the HA instance for the camera to connect to. That’s the inverse of how normal rtsp cameras do it. And I think some bits of HA might assume that’s how all cameras work (eg I don’t think I can provide a stream_source value because there isn’t one as such). If anyone knows of another camera that works like that so I can look at it’s HA code that would be most useful.

Thanks again for your reply!

Sorry if I misunderstand the technical aspects here - but are you saying that you at the moment can generate a ffmpeg stream/video stream capturable by a third party application such as Blue Iris / Synology Surveillance Station using ffplay or by setting up a rtsp server, just not directly to Home Assistant? If so, that is actually my main, main goal, going through HA is the next-best thing.

However, if that code is to function on its own outside of HA, I guess even more needs to be done…

No.

I’m saying I know in a very broad way (as in I don’t know the details but I know how to find them) how a hypothetical function in the HA integration could negotiate an RTSP stream over HAP (the homekit protocol) and start ffmpeg with the right encryption keys (which is how most cameras seem to work in HA) but I lack the knowledge of the camera entity to know which interfaces I need to implement to get the feed into HA - especially if we want the best quality stream or support hls for the mobile app.

Because the camera streams to HA (the inverse of HA connecting to and streaming FROM a camera) I have not yet found a good example implementation to figure out the relevant HA internals from.

None of that code exists yet.

And we won’t ever really support allowing use of the stream outside HA. It (homekit) is just not designed for that. You have to get new encryption keys from HAP every time the connection drops. So the target endpoint would need constant restarts with new keys. And at least with the cameras I’ve tested that’s once every few minutes.

None of this matters because I don’t have time to work on it :crazy_face:

If you know python you could use aiohomekit or homekit_python to make your own app for this, which would be preferred for non HA use cases.