Prevent sensor from becoming unknown

Once a day at 8:00AM I run a script to get the medium price of power (OMIE) and I send it to HA via MQTT. This price is valid for 24 hours. However, after few hours the value will be at an unknown state. My sensor’s definition is:

sensor:
- name: OMIE
  state_topic: "OMIE"
  value_template: "{{ value_json.omie | float / 1000 }}"
  unit_of_measurement: "€/kWh"

How can I make this value valid till the next update that will take place on the next day at 8.00AM?

Instead of setting it up as an MQTT sensor, set it up as a trigger-based template sensor with an MQTT trigger. Make the trigger as specific as possible to avoid false triggers.