My children are sometimes watching great YouTube channels, I’ve created an automation that switches away from those channels. Only thing is that I would like to randomize the video it changes to.
alias: Turn off YouTube videos
description: ""
trigger:
- platform: state
entity_id:
- media_player.chromecast
attribute: media_artist
to:
- KOETLIFE
- MICK
- MICK 2
- Mickvanyoutube
- Mick & Giel
- Giel
- GIEL
- Noobspeler
- Kriekel
- Alex Klein
- Alex Klein 2
- Santino
- TopNL
- Jessy Knijn
- Serial
- FAMILIE LAKAP
- LAKAP JUNIOR
- DE BELLiNGA'S
- Familie Hauser
for:
hours: 0
minutes: 0
seconds: 2
condition: []
action:
- service: media_player.play_media
target:
entity_id: media_player.chromecast
data:
media_content_id: " { \"app_name\": \"youtube\", \"playlist_id\": \"PLC800B9699743BD19\", \"media_id\": \"iqYK79jCssA\" }"
media_content_type: cast
- service: media_player.media_next_track
data: {}
target:
entity_id: media_player.chromecast
mode: single
Better would be to block these channels on my entire network, but I haven’t found a suitable method (yet).