Move iOS app - and share data - to AppleTV

I've developed an iPhone app that controls some HomeKit devices automatically. There are limitations of that approach, in particular 1) the iPhone app cannot control HomeKit devices while in the background and 2) a hub such as AppleTV or iPad is required to have control when the user is outside his home network.


Here's what I'd love to do: I want my HomeKit controller app to run on an AppleTV hub so that it can operate autonomously, but have the iPhone app be the user's primary interface to the app on the hub. So preferences and settings changed in the iPhone app get mirrored to the hub app, which actually does the control.


My app uses a lot of personal preference settings, which may change hourly, and I feel getting that input from the user only at the AppleTV would be a huge PITA. I want to use the phone interface I've already spent so much time developing.


Does this make sense? Are there examples somewhere that I could follow to get started on my first AppleTV app?

Replies

Can't wait for some answers to your questions! At this point, my (limited) understanding of the matter is as follows:


a) only an Apple TV or an iPad can function as a hub that monitors and controls Home devices on its network;

b) access to the "Home service" running on the hub is possible only through an iOS client Home app (and Siri);

c) it is generally not possible to run a backround Home app that periodically communicates with Home devices;

d) some device data cannot be programmatically accessed (e.g., you may not be allowed to read data from your temperature sensor even if you can set temperature-based triggers).


Hoping that I got some of these wrong 😉


Cheers!

"Can't wait for some answers to your questions!"

My advice: Don't hold your breath! I'm not sure why nobody seems to have any thoughts. All I really need is a way to send a user preferences file from their iPhone to their hub. The hub could then run my app 'autonomously' (no interface needed).

Here are my understandings to add to yours.

"a) only an Apple TV or an iPad can function as a hub that monitors and controls Home devices on its network;"

Agreed, at least as far as HomeKit is concerned. The device manufacturer can provide a cloud server that enables out-of-home-network control of their devices. As far as I can tell, a HomeKit developer has no access to this capability. Users are constrained to using only the apps that came with their devices if they want out-of-home access without an AppleTV or iPad hub.

"b) access to the "Home service" running on the hub is possible only through an iOS client Home app (and Siri); "


Well I'm not entirely sure what you're saying. My custom app is able to remotely access and control the HomeKit devices in my home because I have an AppleTV. My beta testers don't have AppleTVs and cannot access their devices with my app once they leave their home network. They CAN get control through the supplier's provided app. It's very frustrating to me as a developer that I cannot also accomplish this.


"c) it is generally not possible to run a backround Home app that periodically communicates with Home devices;"


Correct, a phone app cannot do HomeKit chores while in the background. I don't really understand how HomeKit on a hub device works but I suppose it must be able to act in the background?


"d) some device data cannot be programmatically accessed (e.g., you may not be allowed to read data from your temperature sensor even if you can set temperature-based triggers)."


I think I agree. My thermostat has a motion detector and many users were hoping to access that sensor, but could not until the manufacturer enabled that with a firmware update. I haven't had any personal experience with this while working on my app.

'"b) access to the "Home service" running on the hub is possible only through an iOS client Home app (and Siri);


Well I'm not entirely sure what you're saying. My custom app is able to remotely access and control the HomeKit devices in my home because I have an AppleTV. My beta testers don't have AppleTVs and cannot access their devices with my app once they leave their home network. They CAN get control through the supplier's provided app. It's very frustrating to me as a developer that I cannot also accomplish this."'


Yes, this is what I meant. To "talk to" a HomeKit device from outside your network you need a HomeKit hub and an iOS app or, as you pointed out, a custom cloud server.

>To "talk to" a HomeKit device from outside your network you need a HomeKit hub and an iOS app or, as you pointed out, a custom cloud server.


Thanks for confirming, but we've been around that tree already 😉


See Remote control of HomeKit devices without a hub

> I'm not sure why nobody seems to have any thoughts.


Say what?

Remote control of HomeKit devices without a hub