iOS WorkFlow to save videos to Home Assistant for media_extractor

This is a simple WorkFlow that saves the current web video from Safari to Home Assistant for viewing using media extractor. When you run this WorkFlow it will allow you to play immediately or it will create a sensor to save later streaming.

https://workflow.is/workflows/bded69b2058c4409b610e96429ab8d62

If you use media_extractor to view the video you can usually watch higher resolution and you can still use your device instead of leaving it on the airplay screen.

I created a few extra things in my Home Assistant setup to better support this WorkFlow even though you can use it without having these things added.

sensor:
  platform: template
  sensors:
    stream_video: 
      value_template: "{% if states.sensor.media_extractor_sensor.state %}{{ states.sensor.media_extractor_sensor.state }}{% else %}No Video{% endif %}"

apple_tv_stream:
  sequence:
    - service: media_extractor.play_media
      data_template:
        entity_id: media_player.living_room
        media_content_id: "{{ states.sensor.media_extractor_sensor.attributes.media_url }}"
        media_content_type: "video"

edit: Had to make a few small changes to ensure WorkFlow works with import questions

3 Likes