I have a Bathroom project where i wanted to turn on 2 lights switches that are connected to speakers when i start an Airplay stream so i can have automated music in my bathroom while i shower :).
This is how i pulled it all together…
The Hardware:
- Apple TV 4 or 4K
- Klipsch Light Speaker
- HDMI Converter
- Z-Wave Light Switch
- Z-wave Outlet
The Software:
- Homebridge
- Homebridge-smartthings
- Homebridge-dacp
- Core or Webcore smartapp
The Wetware:
Smartthings Setup
I installed the first speaker in the light socket with the bathroom fan connected to a zwave switch named Bathroom Speaker 1. The second speaker was connected to a zwave outlet named Bathroom Speaker 2. Next i created a virtual switch named Bathroom Speaker This gets presented to Homekit through the JSON Complete API smartapp as apart of the Homebridge-smartthings install.
Core Automation:
Homekit setup
After adding your Apple TV 4 or 4K to homekit as a switch with Homebridge-dacp.
I named mine Bathroom2 you should have something like this in the home app.
And the final bits of automation
Now you can say “Hey siri, turn on the bathroom speaker” or simply Airplay to the bathroom everything will automagicly turn on and work like this.