Controling Apple TVs with Hubitat / RM

One of my favorite app/integrations for HE has been in the ability to control our Roku Powered TV as I've posted a few times.

We now have a few Apple TVs, and the ability to do the same has been limited to hosting Homebridge on a RaspberryPi until the recent Homekit integration. Thought I'd post on what we are now doing so others can enjoy as well.

Context: I have very young kids, and they have started to silently exit their room after we put them down. We caught our son sitting silently on the stairwell watching the TV we were watching which isn't age appropriate. We lucked out that for those 5 min nothing truly horrible happened beyond bad language.

Solution:
Use a contact sensory, a virtual switch, and homekit automations to pushnotify us, flash the lights and pause the TVs.

  1. I installed a contact sensor on their door. I now have a RM rule that when their door opens when we are in "Kids sleep mode" which is 7:30-10:30pm, it triggers a virtual switch I've called "Pause TV". I have the virtual switch set for "Enable auto-off" for 2seconds.

  2. I have exposed Pause TV in the official Homekit integration and setup a homekit rutine that when it triggers will 'pause media' playing on the Apple TVs I have.

  3. I have another RM rule that will cause the downstairs light to slightly turn on then dim back off (like a soft-flash)

  4. I also have the Roku Integration mentioned above if the Roku TV is playing, also pauses the show we are watching.

It was a bit tricky to figure out how to do step #2's routine as Apple TVs don't show up all the time in the Routine accessories, here's how I did it.

Setup the Routine

  1. Find the TV on your Homekit app, and go to "Accessory Details",

  2. Scroll down or tap the confige icon on the bottom-right, then go to "Add Automation"

  3. Click "An Accessory is Controlled"

  4. Choose the Virtual Switch you exposed to Homekit
    image

  5. Set the conditions (for me it's when it's flipped on)

  6. Next then Select your AppleTV
    image

  7. Top on the AppleTV(s) to toggle from play to pause

  8. Try the "Test This Automation" to make sure this part works, then do the same by flipping your virtual switch manually.

Bonus, on the Apple TV, you can have notifications show up for Homekit devices, so we also get a "Kids door opened" or "back door unlocked" notifications while we watch TV.

This is what our RM Rule looks like:
image

Hope others find this useful!

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.