HA time source one minute behind, potential bug

Hello friends,
ESPHome seems one minute behind. Howcan that be?

My esphome configuration retrieves absolute time from HA:

time:
  - platform: homeassistant
    id: homeassistant_time

From inside Home Assistant I am calling an esphome script at exactly 9:30 am:

Inside my ESP the esphome script does something and reports back with the time after the activity. Reduced version of my script:

script:
  - id: script_controlled_output
    then:
      - delay: 30s
      - globals.set:
          id: global_dt_last_run_stop
          value: !lambda |-
            return id(homeassistant_time).now().timestamp;
      - sensor.template.publish:
          id: sensor_last_run_dt
          state: !lambda |-
            return id(global_dt_last_run_stop);

The returned value is reported at 9:30:53 but says 9:29:52.


(2024-01-16T08:29:52+00:00)

The ESP seems one minute behind. How can that be? Do I need to resync the time platform inside ESPHome or is that a bug I need to report on GitHub? Thanks

What version of esphome are you using?

There was a fix for home assistant time updates in 2023.12.6 https://esphome.io/changelog/2023.12.0.html#release-2023-12-6-january-15

1 Like

Interesting! I’m indeed on ESPHome 2023.12.5

I have upate the ESP in question now but will have to wait till tomorrow morning to report back :slight_smile: Cheers!

Sadly not the solution.

Is there someone we can @mention? Otherwise I’ll just go ahead and create a ticket.

@ThomDietrich Did you ever find a solution? I seem to be having this exact same issue.

Interesting! I did not follow-up so far. Would you be so kind and create a bug report in he esphome issue tracker? Thanks!