I am struggling to get a script to work for raising the volume on one of my media players. I have the following config:
Call script from input_text with state_card_tiles:
- entity: script.media_player_volume_up
data: {mediaplayer: "media_player.kodi_kok"}
icon: mdi:volume-plus
Script:
media_player_volume_up:
alias: Volym upp
sequence:
service: media_player.volume_set
data_template:
entity_id: '{{mediaplayer}}'
volume_level: '{{ states.{{mediaplayer}}.attributes.volume_level | float + 0.1 }}'
My log tells me this, but I don’t why it doesn’t work:
2018-01-12 16:22:25 ERROR (MainThread) [homeassistant.config] Invalid config for [script]: invalid template (TemplateSyntaxError: expected name or number) for dictionary value @ data['script']['media_player_volume_down']['sequence'][0]['data_template']['volume_level']. Got None
invalid template (TemplateSyntaxError: expected name or number) for dictionary value @ data['script']['media_player_volume_up']['sequence'][0]['data_template']['volume_level']. Got None.