How to get slider to write the value it's set at on a text file

At the moment I have the slider appearing on page and would like to write the value of the slider is set at in a text file.
The output value say 15 on the range of the slider below when moved gets written on /path/to/file.txt

input_number:
slider1:
name: Slider 1
initial: 30
min: -20
max: 35
step: 1
value > /path/to/file.txt

I did get this to work. It’s explained on homeassistant’s help pages

Could you please show us how you did it? Or at least ink to which page?
Thanks

here, at the bottom.
you’ll need another command though, something like this

shell_command:
  write_slider_val_to_file: >
    echo {{ states('input_number.ac_temperature') }} > /path/to/file.txt

and I presume you need to whitelist your path for it to work

Got it thanks. What if I don’t use a slider?
I just want to input an energy value at the end of the day into a file?
Would I still use Shell?

you can use BP or Esso as well provided you drive a petrol car :wink:
on a serious note - why not?
all you need is to chang that thing inside {{}}
where do you have your energy value?