REST sensor or switch with input slider

Hi there,

I have built a simple, custom REST API which can set the temperature on a thermostat through a POST request. All it requires is the temperature that it needs to be set at.

I want to use an input slider, with a trigger, to then call the REST service with the updated temperature. I can’t work out how to do it - would anyone be able to help? I’ve tried with the REST sensor and then with the REST switch:s

 # Thermostat slider
    name: Potage Temperature
    initial: 10
    min: 10
    max: 90
    step: 1

  alias: Set thermostat
    platform: state
    entity_id: input_slider.potage_thermostat
    service: switch.turn_on

  name: Potage Heater
  platform: rest
  body_on: input_slider.potage_thermostat
  body_off: 0
  is_on_template: '{{ value_json.state != 0 }}'

Did you find a solution?
Im trying to do the exact same thing.