Using HA media cast in front end UI automation editor

Casting a radio browser streaming channel to a device in a automation that sets volume and media after a action and for a set amount of time.
This can be used to play a custom video file saved in media, camera video feed, or from a website to a Chromecast device.

Home assistant has come a long way the past few months.
Thanks to the HA team and @frenck working hard on front end visual UI automation.
Very easy to write new automations with the visual UI.
Casting media using the awesome media service using your own media and or the radio browser is so simple.

Just one example of a quick set up that would have required input booleans, scrips, custom yaml and or use node red.
Automation

When it’s time to go to sleep we just tell Alexa or Google to shut off our bed light home assistant does the rest.

This set up does require outside access from your home assistant to the web. I subscribed to nabucasa for ease and to support the HA team.
Link to video screenshot of visual automation
Video

description: ''
trigger:
  - platform: device
    type: turned_off
    device_id: 9ffeed6ea5ad40a0ad731d174b3419fe
    entity_id: light.bed_light
    domain: light
condition:
  - condition: time
    before: '02:00:00'
    after: '21:30:00'
    weekday:
      - sun
      - sat
      - fri
      - thu
      - wed
      - tue
      - mon
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.nestmini5944
    data:
      media_content_id: media-source://radio_browser/1814e16e-d488-4094-aab2-53b6e24bae5d
      media_content_type: audio/mpeg
    metadata:
      title: 100 GREATEST JAZZ LOUNGE BAR
      thumbnail: >-
        https://d1ujqdpfgkvqfi.cloudfront.net/favicon-generator/htdocs/favicons/2022-02-23/7c5c462edc7e1d15b23db169716e4ded.ico.png
      media_class: music
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: app
          media_content_id: media-source://radio_browser
        - media_content_type: music
          media_content_id: media-source://radio_browser/tag
        - media_content_type: music
          media_content_id: media-source://radio_browser/tag/ambient
  - service: media_player.volume_set
    data:
      volume_level: 0.01
    target:
      device_id: 0af84fce0987264fd057f7e7638b9b7e
  - delay:
      hours: 1
      minutes: 0
      seconds: 0
      milliseconds: 0
  - service: media_player.media_stop
    data: {}
    target:
      device_id: 0af84fce0987264fd057f7e7638b9b7e
mode: restart
1 Like