Problem with Noorpool prices and heat pump changes mode without reason

Hi

I setup my heat pump in my garage to change heating mode based on nordpool pricing.
I had earlier setup based on average price and it worked perfectly.
Now I changed it to slider where I can give hours how many hours heat pump is on and rest of time its only fan mode. But for some reason it changes mode to heat and I cannot get idea why…?
Here’s my configuration:

- alias: ILP heating
  mode: single
  trigger:
    platform: template
    value_template: "{{ states('sensor.kytkentaraja124') > states('sensor.nordpool_kwh_fi_eur_3_095_024' )}}"
  action:
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.talli_gree
        hvac_mode: heat
    - service: climate.set_fan_mode
      data:
        entity_id: climate.talli_gree
        fan_mode: Medium-High
  id: b6d2d84cd89f4e8ea14c48bae16e7287

- id: "1668185603173"
  alias: ILP not heating
  description: ""
  trigger:
    - platform: template
      value_template: "{{ states('sensor.kytkentaraja124') < states('sensor.nordpool_kwh_fi_eur_3_095_024' )}}"
  condition:
    - condition: numeric_state
      entity_id: sensor.talli_lampotila
      above: 7
  action:
    - service: climate.set_hvac_mode
      data:
        entity_id: climate.talli_gree
        hvac_mode: fan_only
    - service: climate.set_fan_mode
      data:
        entity_id: climate.talli_gree
        fan_mode: Medium-Low
  mode: single

Sensor code in configuration-file:

  - platform: template
    sensors:
      kytkentaraja124:
        unit_of_measurement: c/kWh
        value_template: "{{((state_attr('sensor.nordpool_kwh_fi_eur_3_095_024','raw_today')|sort(attribute='value'))[int(states('input_number.slide_1_24'))-1].value)|round(3)-0.01}}"

And here’s what logbook shows:

Any idea what could be reason ?