Few options that pop to mind.
- Have an automation that posts a sensor value to an mqtt topic unless it’s unavailable / unknown. Make sure you set the retain flag on. Have a template sensor that pulls from the mqtt topic unless it’s unavailable / unknown
- Use the Var custom component