Set the temperature of the generic thermostat with a automation

I’m trying to set the temperature of the generic thermostat with a automation. In this way it becomes a kind of clock thermostat. I’ve tried several things but it won’t work. I know that I can use the predefind settings like home, sleep, comfort, etc., but I want to set this in a dashboard.

Below a part of the yaml:
        sequence:
          - service: climate.set_preset_mode
            data:
              preset_mode: comfort
            target:
              entity_id: climate.badkamer
          - service: climate.set_temperature
            data:
              temperature: "{{input_number.badkamer_sleep_temperatuur | float}}"
            target:
              entity_id: climate.badkamer

Replace this bit:

          - service: climate.set_temperature
            data:
              temperature: "{{input_number.badkamer_sleep_temperatuur | float}}"

With this:

          - service: climate.set_temperature
            data:
              temperature: "{{ states('input_number.badkamer_sleep_temperatuur')|float(21) }}"

If that does not work try this:

          - service: climate.set_temperature
            data:
              temperature: "{{ states('input_number.badkamer_sleep_temperatuur')|float(21)|round(0)|int }}"

Thanks for the quick response.
In a way both option worked, but with the withdraw that the temperature is set to 0.0 (with a point). The helper however works with a comma. Can that be the following problem?

The comma is only how it is displayed (“translated” to your local settings in your profile) it has no effect on the maths.

I have the feeling that I’m close, but don’t know how to solve. :frowning:

Take that temperature template string and go to developer tools / templates and paste it in, what does it give you for a value?

Also typically when using a preset mode on a thermostat, this also sets the target temperature. Doing both back to back with no delay in between could cause a timing issue in the device.

Do either of the actions work on their own?

At last found the problem. I had two helpers looking almost identical. You can guess, I used the wrong one. Everyone thanks for helping.