Thermostat automation: DURATION in temperature setting

Good morning
I am taking my first steps in HA.

I have created an automation to set a temperature in a NETATMO thermostat.

However, I cannot find the mode by which to set that temperature FOR A CERTAIN TIME, for a time duration, to make sure that when time finished, the thermostat returns to the scheduled temperature.

Any suggestions?
Thanks

You would need to automate this.

Start a timer when the temperature is changed.

In another automation trigger on the timer finishing and set the temperature back to what you want.

Thank you. That may be one way.

I will add another variable

Automation is triggered by an event in Google Calendar.

Therefore, that event has a variable duration

Is it possible to calculate the DURATION as the difference between end time and start time of the calendar event, and then determine the duration of the temperature setup accordingly?

I don’t think you can get the end time of the calendar event. There is no “end event” generated as far as I am aware.

Entity has both attributes…

immagine

When you start the trigger… I think it is possible to get both…
But I don’t know if it is possible to use them for any kind of calculation…

Ok so it has attributes but it does not generate an end “event” on the state bus you can trigger off. You will have to calculate the duration using a template sensor that subtracts the attributes.

It is also possible to control the trigger on the END event of the calendar

So I could “lower” the temperature when the event ends.

The problem is that when I raise the temperature, against the START event, the thermostat acquires a MANUAL CHANGE; this change is set for one hour.

If the event lasts for more than an hour, that’s when automatically at the end of the first hour of change the thermostat returns to the scheduled state.

Whereas I should make sure that the temperature remains set for the duration of the event…