Use inputnumber values in config

Hello,

I would like to use an inputnumber for my “babyphone”

#babyphone
- platform: ffmpeg_noise
  name: babycry
  input: "rtsp://admin:[email protected]:8554/Netatmo_Welcome"
  extra_arguments: -filter:a highpass=f=300,lowpass=f=2500,volume=volume=2 -codec:a libmp3lame -ar 16000 -nostats
  initial_state: true
  duration: 2
  reset: 60
  #output: -f mp3 icecast://stream_user:[email protected]:8000/babyphone.mp3
  peak: "{{states('input_number.babyphone_sensitivity')| int(0)}}"

That’s my warning I get:

Invalid config for ‘ffmpeg_noise’ from integration ‘binary_sensor’ at binary_sensors.yaml, line 242: expected int for dictionary value ‘peak’, got “{{states(‘input_number.babyphone_sensitivity’)| int(0)}}”

Normally I know that I have to use a data_template but I don’t know how to use it on that one?

Any suggestions?

Best regards

https://www.home-assistant.io/integrations/ffmpeg_noise/#peak

See where it says “integer”?

That would say “template” if it supported templates.

Like this:

Screenshot 2024-09-08 at 22-23-03 Template Light - Home Assistant

So unfortunately it does not support templates.