Question about input_number slider

Hi, i have a mqtt thermostat, i made a slider to set the temp, i would like to use sensor to set the initial value, so if i set it manualy on the thermosat the temp ll be refresh on HA.

input_number:
  thermostat01_slider:
    name: Thermostat-01 slider
    initial: 20
    min: 5
    max: 35
    step: 1

automation:
  - alias: Thermostat01_set_temp
    trigger:
      platform: state
      entity_id: input_number.thermostat01_slider
    action:
      service: mqtt.publish
      data_template:
        topic: '/Thermostat/4eae9f34ea34/cmd/set_temp'
        retain: true
        payload: "{{ states('input_number.thermostat01_slider') | int }}"

i want to use this sensor: sensor.thermostat01_temperature_voulu

  - platform: mqtt
    name: Thermostat-01 Temperature Actuel
    state_topic: "/Thermostat/4eae9f34ea34/room_temp"

someone can help me plz

HA-furnace

Hi @nicecube !
Can you edit or repost using the preformatted text button </> at the top of the reply text box to preserve the code formatting.

Hi-light your code then press the </> button :slight_smile: