I have this template to raise or low the volume of a media_player:
- service: media_player.volume_set
data_template:
entity_id: media_player.salotto_audio
volume_level: >
{% if trigger.event.data.action_value | float > 0 %}
{{ states.media_player.salotto_audio.attributes.volume_level | float + 0.5 }}
{% else %}
{{ states.media_player.salotto_audio.attributes.volume_level | float - 0.5 }}
{% endif %}
And i get this error:
2018-11-16 11:40:39 ERROR (MainThread) [homeassistant.core] Invalid service data for media_player.volume_set: value must be at most 1 for dictionary value @ data['volume_level']. Got '1.050000011920929'
How to set a max value in that template?