Heartbeat with sparse data usage AND without battery - possible?

My Dash project can be expected to operate for a long time (weeks to months) with no data transmitted. However, I need a timely alert if power supply is lost, within a few tens of minutes at most. I can add a battery, monitor USB_5v voltage, and alert when it drops. I’d rather avoid a battery if possible since the device can also be expected to lose external power for months at a time, which would drain the battery and leave it discharged for extended periods.

As I understand the heartbeat function currently in beta, it’s watching subscribed topics, not device connection status. So to use it, my Dash would have to send a blip frequently to reset the heartbeat counter. Not ideal for data usage.

Better ideas?

If you use a 5-10F supercapacitor and voltage detector, you should have enough power to send a message when you lose power. This way, you don’t have to worry about the battery getting cooked and dying on you.