Nordpool spotprice calculation turns unavailable

Hi!
I am trying to monitor the energy costs and savings with PV panels and battery. I have different “price” for import and export of electricity depending on taxes, grid usage aso.
Having variable hour tariffs (spot prices) from nordpool, and using the Nordpool integration in the background.

The template works after reloading all YAML files, but falls unavailable again after som time. (hours), probably when the nordpool integration reloads the energy prices, but not sure (around 13.00 every day). Any suggestions to make this run would be much appreciated!

template:
  - sensor:

## Total import price/kwh
      - name: "Total import price"
        unique_id: "total_import_price"
        icon: mdi:cash
        unit_of_measurement: "SEK/kwh"
        state: >
          {% set spotprice = states('sensor.nordpool_kwh_se3_sek_3_10_025') | float(0) %}
          {% set energytax = 53.5 | float %}     
          {% set additional_import_cost = 0.0 | float %}   
          {% set grid_fee = 28.9 | float %}     
          {{ (spotprice + energytax + additional_import_cost + grid_fee) | round(2) }}
      

## Total export price/kwh
      - name: "Total export price"
        unique_id: "total_export_price"
        icon: mdi:cash
        unit_of_measurement: "SEK/kwh"
        state: >
          {% set spotprice = states('sensor.nordpool_kwh_se3_sek_3_10_025') | float(0) %}
          {% set export_compensation = 60.0 | float %}          
          {{ (spotprice + export_compensation) | round(2) }}

Worked after restart of HA. Nothing wrong in the code.