I managed to get it working using python -m http.server 8080 (since I’m using Python 3.5) and the following code -
automation 4:
# If you select “FireplaceBurning”, play the “FireplaceBurning.avi” file
- alias: Play FireplaceBurning Lullaby
trigger:
platform: state
entity_id: input_select.lullaby
to: “FireplaceBurning AVI”
action:
- service: media_player.turn_on
- delay: 0:0:02
- service: media_player.play_media
data:
media_content_id: http://192.168.1.56:8080/FireplaceBurning.avi
media_content_type: video/avi
# If you select "Heavy Rain MP3", play the "Heavy Rain MP3" file
- alias: Play Heavy Rain Lullaby
trigger:
platform: state
entity_id: input_select.lullaby
to: "Heavy Rain MP3"
action:
- service: media_player.turn_on
- delay: 0:0:02
- service: media_player.play_media
data:
media_content_id: http://192.168.1.56:8080/Heavy Rain.MP3
media_content_type: audio/mp3
If you select "None, turn the Chromecast off
- alias: Stop the Lullaby
trigger:
platform: state
entity_id: input_select.lullaby
to: "None"
action:
service: media_player.turn_off
Define our dropdown list
input_select:
lullaby:
name: Lullaby
options:
- Heavy Rain MP3
- FireplaceBurning AVI
- None
initial: None
icon: mdi:weather-rainy
I could not get it to work at all with either streaming or MP4 files however AVI and MP3 work great.