ESPhome D1 mini resets time randomly

I’m using a D1 mini with an Oled display to display the time temperature and humidity. All works well for a time. But at random times the time display resets to 7:00:00.

time:

  • platform: homeassistant
    id: time1

  • platform: ssd1306_i2c
    model: “SSD1306 128x64”
    reset_pin: D0
    address: 0x3C
    lambda: |-
    it.strftime(2, 55, id(font2), TextAlign::BASELINE_LEFT, “%l:%M:%S”, id(time1).now());
    it.printf(1, 15, id(font1), TextAlign::BASELINE_LEFT , “Temp: %.1f”, id(temper).state);
    it.printf(1, 30, id(font1), TextAlign::BASELINE_LEFT , “Humid: %.1f”, id(humid).state);

Does anyone have an idea?

Does the API disconnect? (the esphome logs will show you.)

When I open the ESPHome script, it wipes out the log, and immediately reloads the device, so I cannot see what happened.

Just leave the logging window open until it happens.