Automation of underfloor heating to keep floor comfortable

I’m using a sonoff 4ch pro relay to control the valves of my water based underfloor heating and zigbee thermostats to control room temperature. Every room has also a Sonoff NSpanel pro to control individual room temperatures.

I’m using generic thermostat in HA and this has been working pretty well for me. When target temperature is reached the room temperature can stay at or above target for a day at least on some occasions leading to the floor cooling down and being uncomfortable to walk on. I made an automation to turn on heating for the floor at max temp for ~20 minutes every 5 hours. Target temp is set in this case to 28 and reverts back to home temp wich is 22. Problem is that whenever someone manually set the temp before for example to 24 it now reverts back to 22 after the automation has run.

Is there any way to record the temp it was set before and revert back to that temperature after boosting?

As an alternative i could use a flood sensor to measure floor temperature instead of room temperature but i would rather set the room temp instead of the floor as its more accurate to represent the actual temperature in the room.

Also maybe use flood sensor to set a min floor temperature to keep it comfortable but struggling to figure out the automation for that too without messing up whatever temp was set manually before.

Thanks. Looked exactly what i needed. Unfortunately doesnt work as expected. The scene returns the values but the temperatures are not set. I suspect it sets the temp before seting the preset mode. And that overrides the temperature maybe?

EDIT: Yes seems to be the case. I changed the automation to change target temp to a higher value and not change the preset of the climate entity. This seems to revert back to the original values.

Here is my automation.

alias: Põrandaküte 30min sisse
description: ""
trigger:
  - platform: state
    entity_id:
      - timer.porandakutte_taimer
    from: active
    to: idle
condition:
  - condition: numeric_state
    entity_id: zone.home
    above: 0
action:
  - service: scene.create
    data:
      scene_id: underfloor_temp
      snapshot_entities:
        - climate.esik
        - climate.kook
        - climate.magamistuba_uus
        - climate.vannituba
  - service: climate.set_preset_mode
    data:
      preset_mode: comfort
    target:
      entity_id:
        - climate.vannituba
        - climate.magamistuba_uus
        - climate.esik
        - climate.kook
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: scene.turn_on
    data: {}
    target:
      entity_id: scene.underfloor_temp
mode: single

I have a similar setup with 4ch relay control for UFH. I am using Versatile Thermostat GitHub - jmcollin78/versatile_thermostat: A full featured Thermostat for Home Assistant: presets, window, motion, presence and overpowering management in HACS which might do what you want - it manages the zones to acheive the confort required.