Automation for missing energy(history) updates

Hi. I’d like to create notification for case when there no Energy update for the past 5-10 minutes.
I mean, sometimes history is not being written and I can notice it after few days, so my history, basically is broken and no longer accurate.
Is it possible to create some kind of automation to send notification when there is no History updates for Energy or History overall just not updating.

Thank you.

trigger:
  - platform: state
    entity_id: sensor.your_energy_sensor_here
    to:
    for:
      minutes: 5
action:
  - service: notify.etc...