Send all data after wifi reconnection

Hello everyone,
I use a Wemos D1 mini with a photoresistor to detect my power meter consumption by adding a Wh at every power meter LED blink. It works great!
Now, it brings me to another challenge: I turn off my wifi at night using Home Assistant. For this, I use two input_datetime which I can change in Lovelace to determine when it switches off then on the wifi.

How can I tell through esphome to my Wemos D1 mini to send all the night data when it reconnects to the wifi in the morning? Will it create duplicates?

I don’t think you can push past data to Home Assistant; there is no option in ESPHome to store a series of sensor values locally and to then send a timestamp with the data captured overnight.