Ignore duplicates in MQTT

Hi all,
is it possible to avoid storing duplicate values received via MQTT? Occasionally due to communication failures of even several days, the data from an MQTT sensor sending PV power sends the last real value recorded, imagine what it means for other algorithms that depend on this value to have 25kW day and night. I was looking for an option like ‘ignoreDuplicates’: true

Thanks
paco