Sennevds / media_player.template

Template media_player for Home Assistant
MIT License
126 stars 23 forks source link

set_volume with number entity #52

Open enry86cami opened 7 months ago

enry86cami commented 7 months ago

Hello, I set the volume by "entity_id: number.volume".

I'm trying with this code but the volume doesn't work:

media_player:
  platform: media_player_template
  media_players:
    2bagno:
      value_template: >
        {% if is_state("switch.omnilink_zone_2", "on") -%}
          on
        {%- else -%}
          off
        {%- endif %}
      turn_on:
        service: switch.turn_on
        data_template:
          entity_id: switch.omnilink_zone_2
      turn_off:
        service: switch.turn_off
        data_template:
          entity_id: switch.omnilink_zone_2
      set_volume:
        service: number.set_value
        data:
          entity_id: number.volume
          value: "{{volume}}"

only input_text entity are admitted?