CharlesGillanders / homeassistant-alphaESS

Monitor your energy generation, storage, and usage data using the official API from Alpha ESS.
MIT License
101 stars 22 forks source link

Timestamp Error #147

Closed matt-oneill closed 1 week ago

matt-oneill commented 1 week ago

The integration stopped working for me a few days ago.

In the logs image

I have tried

All successful api calls in postman so I don't think its an issue with the alpha api.

Poshy163 commented 1 week ago

Is there a chance that your HAOS machine is out of sync of time? only reason you would be receiving that error is when (according to the docs) "the timespan between request timestamp and server timestamp exceeds 300 seconds"

matt-oneill commented 1 week ago

I've also tried changing the HA Time Zone to GMT (no daylight saving) in case that caused the incorrect time and then back again to GMT London. Each time also a fresh install of the integration and rebooting.

Using developer tools the time seems to be 10 minutes out but I can't see any way to set the time manually. image

10 mins seems an odd offset I would have expected it to be whole hours if its timezone related.

CharlesGillanders commented 1 week ago

The timestamp is UTC based - it counts the number of seconds since 1st January, 1970 UTC so time zone is not important.

That your HA is 10 minutes out suggests that its time sync isn't working - are you running HAOS or a VM or something else? If it's HAOS I am not sure, you may try a complete reboot. If it's a VM I'd suspect that the underlying OS isn't time synced, you should be able to manually change the time there.

matt-oneill commented 1 week ago

HASS OS on raspberry pi 4. Rebooting the host didn't work and looks to be an ntp issue but can't see any way to change the time manually in HA or OS.

obviously not an issue with the integration so I'll close this and keep looking for solutions with the OS. Thanks for your help