Need automation to check device activity in the past

I have a dehumidifier installed in my crawlspace under the house. It’s powered via an esphome smart plug. I’m looking for advice for an automation that would send a notification if the dehumidifier hasn’t run for more than 12 hours. The smart plug monitors current so easy to determine if the device is currently running but I don’t know how to create a trigger using the entity history?

Probably would also need to send a notification if the smart plug is not available (power failure).

Just have a numeric state trigger of some value below the normal power draw for 12 hours. Could have another trigger for the state going unavailable for whatever specified period of time.

How would I set the time?

Someting like:

trigger:
  platform: numeric_state
  entity_id: ...
  below: 1
  for:
    hours: 12

Perfect​:+1::+1::+1::+1::+1:
Thanks for the help.