Climate temperature at different times

Hi,

I need you help, I need automation for my climate:

between 6 am - 9 am should be the temperature at 25°C
between 9 am - 5 pm at 20°C
between 5 pm - 10 pm at 25°C
between 10 pm - 6 am at 20°C

How I can do that, I relly don’t know :frowning:

Thank you and regards

1 Like

Here is how I would do it:

- alias: Thermostat Schedule
  trigger:
  - platform: time
    at:
      - '06:00:00'
      - '09:00:00'
      - '17:00:00'
      - '22:00:00'
  action:
  - service: climate.set_temperature
    data:
      entity_id: climate.my_thermostat
      temperature: >
        {% set map = {6: 25, 9: 20, 17: 25, 22: 20} %}
        {{ map[trigger.now.hour] if trigger.now.hour in map.keys() else 20 }}

EDIT

Correction. Append > character to temperature:

2 Likes

@123 Thank you. I have issues to use your code in automation, can you tell me how to use it correctly?

There was a small error in my example. I have corrected it.

Please change this:

      temperature:

to this:

      temperature: >

In addition, be sure to replace climate.my_thermostat with the name of your climate entity.