How do I get yesterday's power usage on an energy device?

I have an Emporia Vue that has been flashed with esphome and is monitoring my panel. I am trying to monitor energy consumption on one of my circuit breakers and alert me if that device has not been on during the entire day. I can use the daily energy metric for it, which adds up the usage during the day. I tested this automation with a high trigger value and it worked:

alias: Well Pump Status
description: ""
trigger:
  - platform: time
    at: "21:00:00"
condition:
  - type: is_energy
    condition: device
    device_id: 8ed94e26dc545038d65f266e96bf3f5e
    entity_id: sensor.well_pump_daily_energy
    domain: sensor
    below: 100
action:
  - service: notify.me
    data:
      message: Well Pump not Running {{ states('sensor.well_pump_daily_energy') }}
      title: Well Pump not Running
mode: single

My problem is that this fires at 9PM. Ideally, I’d like this to fire in the morning so that I can go outside and investigate the problem. From what I see, the daily energy metric resets to zero at midnight, and I don’t have a way to look at the previous day’s value.

What is the best approach available here?

So you’re just wanting it to alert you in the morning if the previous day had low/no usage? Simple hack would be to have it check right before it resets (so 11:30pm say) and then just add an 8 hour delay before the notification.

Thanks. That is exactly what I want. Do you have a sample code that I can look at to see how I can add this delay? The UI does not offer any options to do it under the actions section

It’s the very last UI option: “wait for time to pass (delay)”.

Duh. I see it now. I assumed this would be a flag I’d add to the action as a conditional or so. I wasn’t expecting it to be another action I add on top of my notify. Thanks for pointing me in the right direction.