FIXED - Google Volume template with helper

Hello every one,
i would like set the volume level of my speaker based on the time and two helper. One for day volume level and onother for the night volume level.
I tried the follow but it dowsn’t work even if there is any error on the automation.

service: media_player.volume_set
data_template:
  volume_level: >-
    {% if now().hour > 22 or now().hour < 7 %} 
    {{states('input_number.volume_speaker_notte')|int / 100}}
    {% else %} 
    {{states('input_number.volume_speaker_giorno')|int / 100 + 0.15}} 
    {% endif %}
target:
  entity_id: media_player.gruppo_casa

Any one knows where the problem is?
Thanks

FIXED

service: media_player.volume_set
data:
  volume_level: >
    {% if now().hour > 22 or now().hour < 7 %} {{
    states('input_number.volume_speaker_notte')|int / 100}} {% else %} {{
    states('input_number.volume_speaker_giorno')|int / 100 + 0.15}} {% endif %}
target:
  entity_id: media_player.google_home_sala