dirkjanfaber / victron-vrm-api

Interface with the Victron Energy VRM API
MIT License
11 stars 5 forks source link

[BUG] End time requests 1 hour too much #28

Open nschermer opened 3 weeks ago

nschermer commented 3 weeks ago

Describe the bug It looks like the api node requests an additional hour if you try to fetch (forecast) data. With other data the same will probably happens, but then the api endpoint simply has no data to return, so this is less of an issue.

To Reproduce With the following settings: afbeelding

The following request is send to the vrm api: stats?type=custom&attributeCodes[]=solar_yield_forecast&interval=hours&start=1731315600&end=1731405599

But this returns and array with 25 items. afbeelding

The timestamps send also request this: (1731405599-1731315600)/3600 = 24h 59m

Expected behavior 24h of data, not including the same hour the next day.