How to easily change network connection of AppleTV over different NordVPN tunnels with an automation

I am looking for a way to change the network connection of my AppleTV through home assistant’s interface. I don’t want to change the network connection manually in the AppleTV settings on the devices

I want to have a kind of list-element with listing 4 different networks my AppleTV could connect to. Each network will lead the network traffic over different Nord-VPN tunnels (Nord-VPN) representing different countries.

I have a Ubiquity Unifi Dream Machine Pro and Unifi Wifi AP’s on which I can define the 4 different networks with associated VPN tunnels. The connection to the Apple TV can be over Wifi or cabled.

Who can give me tips, hints or instructions how to automate this in Home Assistant?

Ton,
I can think of two possibilities. The first will work, but is a bit fragile, the second might work, but I don’t know the details:

  1. You can use the AppleTV integration to simulate button presses. So you could make a script that does up/down/press/etc. in the right pattern to switch networks using the AppleTV UI.
  2. You could use a router that can switch the device to another network itself. E.g., if the AppleTV is connecting via DHCP, I suspect you could use HA to control a router to change the IP to be one on a different VPN. However, I’m not sure how easily you can get the AppleTV to request a new DHCP lease after such a change.
    -David
1 Like

Very good suggestions! Thank you.

On possibility #2: I have a Ubiquity Unifi router (UDM Pro) that has the ability to push a device to a network. So far I have not found a HA Integration that allows me to do this push from within Home Assistant. That is required, as it needs to adhere Home Automation Rule #1: be spous-proof!

Looks like there is some kind of Unify API, but I have no idea how well-supported it is.

-David

1 Like