This Arduino sketch allows you to send YouTube videos to a ChromeCast device when a motion sensor is triggered.
This sketch requires an Arduino Ethernet shield and a PIR motion sensor.
Use the Arduino IDE to upload the code onto an Arduino device. The code currently only loads the video once after the motion sensor is triggered, but it can easily be modified to trigger repeatedly.
Fonte e mais detalhes aqui.