Git Product home page Git Product logo

media_player.template's Introduction

media_player.template

media_player template for Home Assistant

GitHub Release hacs_badge License

Project Maintenance GitHub Activity

Community Forum

Current implemented features:

  • on_action
  • off_action
  • play_action
  • play_pause_action
  • stop_action
  • pause_action
  • next_action
  • previous_action
  • volume_up_action
  • volume_down_action
  • mute_action
  • source list
  • current source
  • title
  • artist
  • album
  • current volume
  • set_volume action
  • play_media action (not tested)
  • media_content_type_template
  • media_image_url_template
  • media_episode_template
  • media_season_template
  • media_series_title_template
  • media_album_artist_template
  • current_is_muted_template
  • device_class

media_content_type_template can be one of the following values:

  • tv_show
  • music
  • movie
  • video

based on this value other parameters are shown ex artist is only shown when type is music

Variables used:

set_volume:

  • {volume}

mute:

  • {is_muted}

play_media:

  • {media_type}
  • {media_id}

Preview config:

media_player:
  - platform: media_player_template
    media_players:
      receiver:
        friendly_name: Receiver
        device_class: receiver
        current_source_template: "{{ states('input_text.selected_source') }}"
        value_template: >
          {% if is_state("input_boolean.receiver_on", "on") -%}
            on
          {%- else -%}
            off
          {%- endif %}
        turn_on:
          service: switch.turn_on
          data_template:
            entity_id: switch.receiver_on
        turn_off:
          service: switch.turn_on
          data_template:
            entity_id: switch.receiver_off
        volume_up:
          service: switch.turn_on
          data_template:
            entity_id: switch.volume_up
        volume_down:
          service: switch.turn_on
          data_template:
            entity_id: switch.vol
        inputs:
          source 1:
            service: input_boolean.turn_on
            data_template:
              entity_id: input_boolean.source_1
          source 2:
            service: input_boolean.turn_on
            data_template:
              entity_id: input_boolean.source_2
        set_volume:
          service: input_text.set_value
          data:
            entity_id: input_text.selected_volume
            value: "{{volume}}"
        mute:
          service: input_number.set_value
          data:
            entity_id: input_number.selected_is_muted
            value: "{{is_muted}}"
        current_is_muted_template: >
          {{ states('input_boolean.is_muted') }}
        album_art_template: "{{ states('input_text.album_art') }}"
        title_template: "{{ states('input_text.title') }}"
        album_template: "{{ states('input_text.album') }}"
        artist_template: "{{ states('input_text.artist') }}"

media_player.template's People

Contributors

sennevds avatar golles avatar chbartsch avatar ehendrix23 avatar colinrobbins avatar antoni-czaplicki avatar ktibow avatar maxi1134 avatar pschmitt avatar seperis avatar wrt54g avatar dvv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.