Control Google home volume with slider (error float expected)

hello all,

I try to make a doorbell with my google nest audio. the doorbell work great and i can change the volume with a fix number like this :

service: media_player.volume_set
target:
  entity_id: media_player.nest_salon
data:
  volume_level: 0.8

but i can’t use the slider to determine the volume. it return the error :
Failed to call service media_player/volume_set. expected float for dictionary value @ data[‘volume_level’]

here is my code for the slider :

volume:
  name: volume_doorbell
  initial: 50
  min: 20
  max: 100
  step: 1

And here is my code for set the volume to google nest :

service: media_player.volume_set
target:
  entity_id: media_player.nest_salon
data:
  volume_level: '{{ states.input_number.volume.state | float / 100 }}'

i tried several forms for the volume_level i found on the forum. no one works for me

thanks in advance for your help.

Guillaume

What do you see if you paste this into Developer Tools / Template?

{{ states.input_number.volume.state | float / 100 }}

Example for one of my input_numbers:

Also, what HA version are you running? If it’s more than a few months old, you’ll need data_template instead of data.

1 Like

I use home assistant version : core-2021.3.4 (last one) on a raspberry

I have the same result type :